-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial contribution per Bug #261590
- Loading branch information
wbeaton
committed
Mar 13, 2009
0 parents
commit 6c36944
Showing
14 changed files
with
773 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<classpath> | ||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/> | ||
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> | ||
<classpathentry kind="src" path="src"/> | ||
<classpathentry kind="output" path="bin"/> | ||
</classpath> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<projectDescription> | ||
<name>org.eclipse.examples.slideshow.text</name> | ||
<comment></comment> | ||
<projects> | ||
</projects> | ||
<buildSpec> | ||
<buildCommand> | ||
<name>org.eclipse.jdt.core.javabuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
<buildCommand> | ||
<name>org.eclipse.pde.ManifestBuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
<buildCommand> | ||
<name>org.eclipse.pde.SchemaBuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
</buildSpec> | ||
<natures> | ||
<nature>org.eclipse.pde.PluginNature</nature> | ||
<nature>org.eclipse.jdt.core.javanature</nature> | ||
</natures> | ||
</projectDescription> |
7 changes: 7 additions & 0 deletions
7
org.eclipse.examples.slideshow.text/.settings/org.eclipse.jdt.core.prefs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#Wed Oct 01 22:00:36 EDT 2008 | ||
eclipse.preferences.version=1 | ||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 | ||
org.eclipse.jdt.core.compiler.compliance=1.5 | ||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error | ||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error | ||
org.eclipse.jdt.core.compiler.source=1.5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
Manifest-Version: 1.0 | ||
Bundle-ManifestVersion: 2 | ||
Bundle-Name: Slideshow Text Plug-in | ||
Bundle-SymbolicName: org.eclipse.examples.slideshow.text | ||
Bundle-Version: 0.2.0.qualifier | ||
Bundle-Vendor: The Eclipse Foundation | ||
Bundle-RequiredExecutionEnvironment: J2SE-1.5 | ||
Require-Bundle: org.eclipse.examples.slideshow.core;bundle-version="0.1.0" | ||
Import-Package: org.eclipse.core.runtime;version="[3.4.0,4.0.0)", | ||
org.eclipse.mylyn.wikitext.core.parser, | ||
org.eclipse.mylyn.wikitext.core.parser.markup, | ||
org.eclipse.mylyn.wikitext.mediawiki.core | ||
Export-Package: org.eclipse.examples.slideshow.text |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" | ||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | ||
<html xmlns="http://www.w3.org/1999/xhtml"> | ||
<head> | ||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/> | ||
<title>About</title> | ||
</head> | ||
<body lang="EN-US"> | ||
<h2>About This Content</h2> | ||
|
||
<p>January 19, 2009</p> | ||
<h3>License</h3> | ||
|
||
<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise | ||
indicated below, the Content is provided to you under the terms and conditions of the | ||
Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available | ||
at <a href="http://www.eclipse.org/org/documents/epl-v10.php">http://www.eclipse.org/org/documents/epl-v10.php</a>. | ||
For purposes of the EPL, "Program" will mean the Content.</p> | ||
|
||
<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is | ||
being redistributed by another party ("Redistributor") and different terms and conditions may | ||
apply to your use of any object code in the Content. Check the Redistributor's license that was | ||
provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise | ||
indicated below, the terms and conditions of the EPL still apply to any source code in the Content | ||
and such source code may be obtained at <a href="http://www.eclipse.org">http://www.eclipse.org</a>.</p> | ||
|
||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
source.. = src/ | ||
output.. = bin/ | ||
bin.includes = META-INF/,\ | ||
. |
82 changes: 82 additions & 0 deletions
82
...lipse.examples.slideshow.text/src/org/eclipse/examples/slideshow/text/CopyrightToken.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2009 The Eclipse Foundation. | ||
* All rights reserved. This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License v1.0 | ||
* which accompanies this distribution, and is available at | ||
* http://www.eclipse.org/legal/epl-v10.html | ||
* | ||
* Contributors: | ||
* The Eclipse Foundation - initial API and implementation | ||
*******************************************************************************/ | ||
package org.eclipse.examples.slideshow.text; | ||
|
||
import org.eclipse.mylyn.wikitext.core.parser.ImageAttributes; | ||
import org.eclipse.mylyn.wikitext.core.parser.ImageAttributes.Align; | ||
import org.eclipse.mylyn.wikitext.core.parser.markup.PatternBasedElement; | ||
import org.eclipse.mylyn.wikitext.core.parser.markup.PatternBasedElementProcessor; | ||
|
||
public class CopyrightToken extends PatternBasedElement { | ||
@Override | ||
protected String getPattern(int groupOffset) { | ||
return "(?:\\{Copyright:([^\\}]*)\\})"; | ||
} | ||
|
||
@Override | ||
protected int getPatternGroupCount() { | ||
return 1; | ||
} | ||
|
||
@Override | ||
protected PatternBasedElementProcessor newProcessor() { | ||
return new PatternBasedElementProcessor() { | ||
@Override | ||
public void emit() { | ||
String message = group(1); | ||
if (builder instanceof SlideDeckDocumentBuilder) { | ||
((SlideDeckDocumentBuilder)builder).copyright(message); | ||
} | ||
} | ||
}; | ||
} | ||
|
||
private static class ImageReplacementTokenProcessor extends PatternBasedElementProcessor { | ||
@Override | ||
public void emit() { | ||
String imageUrl = group(1); | ||
String optionsString = group(2); | ||
|
||
ImageAttributes attributes = new ImageAttributes(); | ||
if (optionsString != null) { | ||
String[] options = optionsString.split("\\s*\\|\\s*"); | ||
for (String option : options) { | ||
if ("center".equals(option)) { | ||
attributes.setAlign(Align.Middle); | ||
} else if ("left".equals(option)) { | ||
attributes.setAlign(Align.Left); | ||
} else if ("right".equals(option)) { | ||
attributes.setAlign(Align.Right); | ||
} else if ("none".equals(option)) { | ||
attributes.setAlign(null); | ||
} else if ("thumb".equals(option) || "thumbnail".equals(option)) { | ||
// ignore | ||
} else if (option.matches("\\d+px")) { | ||
try { | ||
int size = Integer.parseInt(option.substring(0, option.length() - 2)); | ||
attributes.setWidth(size); | ||
attributes.setHeight(size); | ||
} catch (NumberFormatException e) { | ||
// ignore | ||
} | ||
} else if ("frameless".equals(option)) { | ||
attributes.setBorder(0); | ||
} else if ("frame".equals(option)) { | ||
attributes.setBorder(1); | ||
} else { | ||
attributes.setTitle(option); | ||
} | ||
} | ||
} | ||
builder.image(attributes, imageUrl); | ||
} | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
...es.slideshow.text/src/org/eclipse/examples/slideshow/text/ISlideDeckDocumentListener.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2009 The Eclipse Foundation. | ||
* All rights reserved. This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License v1.0 | ||
* which accompanies this distribution, and is available at | ||
* http://www.eclipse.org/legal/epl-v10.html | ||
* | ||
* Contributors: | ||
* The Eclipse Foundation - initial API and implementation | ||
*******************************************************************************/ | ||
package org.eclipse.examples.slideshow.text; | ||
|
||
public interface ISlideDeckDocumentListener { | ||
|
||
void slideAdded(SlideAddedEvent event); | ||
|
||
} |
17 changes: 17 additions & 0 deletions
17
...examples.slideshow.text/src/org/eclipse/examples/slideshow/text/ISlideParserListener.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2009 The Eclipse Foundation. | ||
* All rights reserved. This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License v1.0 | ||
* which accompanies this distribution, and is available at | ||
* http://www.eclipse.org/legal/epl-v10.html | ||
* | ||
* Contributors: | ||
* The Eclipse Foundation - initial API and implementation | ||
*******************************************************************************/ | ||
package org.eclipse.examples.slideshow.text; | ||
|
||
public interface ISlideParserListener { | ||
|
||
void slideAdded(SlideAddedEvent event); | ||
|
||
} |
46 changes: 46 additions & 0 deletions
46
...ipse.examples.slideshow.text/src/org/eclipse/examples/slideshow/text/InsertCodeToken.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2009 The Eclipse Foundation. | ||
* All rights reserved. This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License v1.0 | ||
* which accompanies this distribution, and is available at | ||
* http://www.eclipse.org/legal/epl-v10.html | ||
* | ||
* Contributors: | ||
* The Eclipse Foundation - initial API and implementation | ||
*******************************************************************************/ | ||
package org.eclipse.examples.slideshow.text; | ||
|
||
import org.eclipse.mylyn.wikitext.core.parser.markup.PatternBasedElement; | ||
import org.eclipse.mylyn.wikitext.core.parser.markup.PatternBasedElementProcessor; | ||
|
||
public class InsertCodeToken extends PatternBasedElement { | ||
|
||
// TODO Add ability to turn on/off line numbers | ||
// TODO Add flag to include Javadoc | ||
// TODO Add flag to suppress all comments | ||
// TODO Add flag to reformat | ||
// TODO Add flag to preserve whitespace | ||
@Override | ||
protected String getPattern(int groupOffset) { | ||
return "(?:\\{Code:([^\\}]*)\\})"; | ||
} | ||
|
||
@Override | ||
protected int getPatternGroupCount() { | ||
return 1; | ||
} | ||
|
||
@Override | ||
protected PatternBasedElementProcessor newProcessor() { | ||
return new PatternBasedElementProcessor() { | ||
@Override | ||
public void emit() { | ||
String url = group(1); | ||
if (builder instanceof SlideDeckDocumentBuilder) { | ||
((SlideDeckDocumentBuilder)builder).codeBlock(url); | ||
} | ||
} | ||
}; | ||
} | ||
|
||
} |
25 changes: 25 additions & 0 deletions
25
...ipse.examples.slideshow.text/src/org/eclipse/examples/slideshow/text/SlideAddedEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2009 The Eclipse Foundation. | ||
* All rights reserved. This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License v1.0 | ||
* which accompanies this distribution, and is available at | ||
* http://www.eclipse.org/legal/epl-v10.html | ||
* | ||
* Contributors: | ||
* The Eclipse Foundation - initial API and implementation | ||
*******************************************************************************/ | ||
package org.eclipse.examples.slideshow.text; | ||
|
||
import org.eclipse.examples.slideshow.core.Slide; | ||
|
||
public class SlideAddedEvent { | ||
|
||
public final Slide slide; | ||
public final int lineNumber; | ||
|
||
public SlideAddedEvent(Slide slide, int lineNumber) { | ||
this.slide = slide; | ||
this.lineNumber = lineNumber; | ||
} | ||
|
||
} |
Oops, something went wrong.