Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpelder2006-12-15 09:09:17 -0500
committerpelder2006-12-15 09:09:17 -0500
commit1687269fa8c5d79e670fb64ff8ccf8fb10f6472f (patch)
tree142f15d9a310b5804771ff6a8f5c854c9d2bd2e1
parent9f9617f88115522cb2ef53c0d86ad5137239da73 (diff)
downloadorg.eclipse.jet-1687269fa8c5d79e670fb64ff8ccf8fb10f6472f.tar.gz
org.eclipse.jet-1687269fa8c5d79e670fb64ff8ccf8fb10f6472f.tar.xz
org.eclipse.jet-1687269fa8c5d79e670fb64ff8ccf8fb10f6472f.zip
This commit was manufactured by cvs2svn to create tag 'build_200612211022'.build_200612211022
-rw-r--r--plugins/org.eclipse.jet.editor/.classpath7
-rw-r--r--plugins/org.eclipse.jet.editor/.cvsignore1
-rw-r--r--plugins/org.eclipse.jet.editor/.jetproperties4
-rw-r--r--plugins/org.eclipse.jet.editor/.project34
-rw-r--r--plugins/org.eclipse.jet.editor/.settings/org.eclipse.jdt.core.prefs12
-rw-r--r--plugins/org.eclipse.jet.editor/.settings/org.eclipse.jet.prefs4
-rw-r--r--plugins/org.eclipse.jet.editor/META-INF/MANIFEST.MF26
-rw-r--r--plugins/org.eclipse.jet.editor/build.properties6
-rw-r--r--plugins/org.eclipse.jet.editor/icons/sample.gifbin983 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jet.editor/plugin.xml24
-rw-r--r--plugins/org.eclipse.jet.editor/schema/partitionConfigurationDelegates.exsd105
-rw-r--r--plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/Activator.java61
-rw-r--r--plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/JETEditorHelper.java318
-rw-r--r--plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/JETSourceViewer.java139
-rw-r--r--plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/JETTextEditor.java411
-rw-r--r--plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/configuration/DoubleClickStrategy.java112
-rw-r--r--plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/configuration/IJETColorConstants.java17
-rw-r--r--plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/configuration/JETDocumentProvider.java31
-rw-r--r--plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/configuration/JETEditorPreferenceConstants.java109
-rw-r--r--plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/configuration/JETSourceViewerConfiguration.java94
-rw-r--r--plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/configuration/JETTokenStyleManager.java150
-rw-r--r--plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/configuration/JETWhitespaceDetector.java10
-rw-r--r--plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/configuration/NonRuleBasedDamagerRepairer.java138
-rw-r--r--plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/configuration/delegates/AbstractJETTextPartitionConfigurationDelegate.java38
-rw-r--r--plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/configuration/delegates/IJETTextPartitionConfigurationDelegate.java24
-rw-r--r--plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/configuration/delegates/JavaContentPartitionConfigurationDelegate.java249
-rw-r--r--plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/contentassist/AbstractJETAssistProcessor.java17
-rw-r--r--plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/contentassist/JETCustomTagAssistProcessor.java45
-rw-r--r--plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/contentassist/JETDirectiveAssistProcessor.java45
-rw-r--r--plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/contentassist/JETJavaDeclarationAssistProcessor.java63
-rw-r--r--plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/contentassist/JETJavaExpressionAssistProcessor.java101
-rw-r--r--plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/contentassist/JETJavaScriptletAssistProcessor.java98
-rw-r--r--plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/contentassist/JETTagAssistProcessor.java47
-rw-r--r--plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/formatter/JETCustomTagFormattingStrategy.java34
-rw-r--r--plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/formatter/JETDirectiveFormattingStrategy.java34
-rw-r--r--plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/formatter/JETJavaDeclarationFormattingStrategy.java34
-rw-r--r--plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/formatter/JETJavaExpressionFormattingStrategy.java34
-rw-r--r--plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/formatter/JETJavaScriptletFormattingStrategy.java34
-rw-r--r--plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/i18n/TextEditorMessages.properties1
-rw-r--r--plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/outline/JETOutlineContentProvider.java180
-rw-r--r--plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/outline/JETOutlineLabelProvider.java111
-rw-r--r--plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/outline/JETOutlinePage.java57
-rw-r--r--plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/partition/JETDocumentPartitionScanner.java512
-rw-r--r--plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/rules/JETBracketRule.java77
-rw-r--r--plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/rules/JETCommentRule.java10
-rw-r--r--plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/rules/JETCustomTagRule.java78
-rw-r--r--plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/rules/JETDirectiveRule.java10
-rw-r--r--plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/rules/JETJavaDeclarationRule.java10
-rw-r--r--plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/rules/JETJavaExpressionRule.java10
-rw-r--r--plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/rules/JETJavaScriptletRule.java10
-rw-r--r--plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/rules/WordListDetectorRule.java48
-rw-r--r--plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/scanners/JETCommentScanner.java19
-rw-r--r--plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/scanners/JETCustomTagScanner.java69
-rw-r--r--plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/scanners/JETDefaultContentScanner.java12
-rw-r--r--plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/scanners/JETDirectiveScanner.java61
-rw-r--r--plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/scanners/JETJavaCodeScanner.java241
-rw-r--r--plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/scanners/JETJavaDeclarationScanner.java34
-rw-r--r--plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/scanners/JETJavaExpressionScanner.java41
-rw-r--r--plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/scanners/JETJavaScriptletScanner.java35
-rw-r--r--transforms/org.eclipse.jet.transforms.newproject/.classpath7
-rw-r--r--transforms/org.eclipse.jet.transforms.newproject/.cvsignore2
-rw-r--r--transforms/org.eclipse.jet.transforms.newproject/.project29
-rw-r--r--transforms/org.eclipse.jet.transforms.newproject/META-INF/MANIFEST.MF10
-rw-r--r--transforms/org.eclipse.jet.transforms.newproject/about.html28
-rw-r--r--transforms/org.eclipse.jet.transforms.newproject/build.properties13
-rw-r--r--transforms/org.eclipse.jet.transforms.newproject/newproject.xsd81
-rw-r--r--transforms/org.eclipse.jet.transforms.newproject/plugin.xml35
-rw-r--r--transforms/org.eclipse.jet.transforms.newproject/sample.xml3
-rw-r--r--transforms/org.eclipse.jet.transforms.newproject/templates/control.jet9
-rw-r--r--transforms/org.eclipse.jet.transforms.newproject/templates/createBasicProject.jet45
-rw-r--r--transforms/org.eclipse.jet.transforms.newproject/templates/createExtendedProject.jet0
-rw-r--r--transforms/org.eclipse.jet.transforms.newproject/templates/dump.jet2
-rw-r--r--transforms/org.eclipse.jet.transforms.newproject/templates/project/build.properties.jet10
-rw-r--r--transforms/org.eclipse.jet.transforms.newproject/templates/project/classpath.jet8
-rw-r--r--transforms/org.eclipse.jet.transforms.newproject/templates/project/control.jet.jet24
-rw-r--r--transforms/org.eclipse.jet.transforms.newproject/templates/project/dump.jet.jet3
-rw-r--r--transforms/org.eclipse.jet.transforms.newproject/templates/project/manifest.mf.jet9
-rw-r--r--transforms/org.eclipse.jet.transforms.newproject/templates/project/plugin.xml.jet21
-rw-r--r--transforms/org.eclipse.jet.transforms.newproject/templates/project/project.jet30
-rw-r--r--transforms/org.eclipse.jet.transforms.newproject/templates/project/sample.xml.jet3
-rw-r--r--transforms/org.eclipse.jet.transforms.taglibdoc/.classpath7
-rw-r--r--transforms/org.eclipse.jet.transforms.taglibdoc/.cvsignore2
-rw-r--r--transforms/org.eclipse.jet.transforms.taglibdoc/.project29
-rw-r--r--transforms/org.eclipse.jet.transforms.taglibdoc/META-INF/MANIFEST.MF10
-rw-r--r--transforms/org.eclipse.jet.transforms.taglibdoc/about.html28
-rw-r--r--transforms/org.eclipse.jet.transforms.taglibdoc/build.properties12
-rw-r--r--transforms/org.eclipse.jet.transforms.taglibdoc/plugin.xml34
-rw-r--r--transforms/org.eclipse.jet.transforms.taglibdoc/sample.xml3
-rw-r--r--transforms/org.eclipse.jet.transforms.taglibdoc/templates/allTags/tag.html.jet165
-rw-r--r--transforms/org.eclipse.jet.transforms.taglibdoc/templates/control.jet90
-rw-r--r--transforms/org.eclipse.jet.transforms.taglibdoc/templates/dump.jet2
-rw-r--r--transforms/org.eclipse.jet.transforms.taglibdoc/templates/tagLibrary/overview.html.jet53
-rw-r--r--transforms/org.eclipse.jet.transforms.taglibdoc/templates/tagLibrary/toc.xml.jet11
93 files changed, 0 insertions, 5154 deletions
diff --git a/plugins/org.eclipse.jet.editor/.classpath b/plugins/org.eclipse.jet.editor/.classpath
deleted file mode 100644
index 751c8f2..0000000
--- a/plugins/org.eclipse.jet.editor/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/plugins/org.eclipse.jet.editor/.cvsignore b/plugins/org.eclipse.jet.editor/.cvsignore
deleted file mode 100644
index ba077a4..0000000
--- a/plugins/org.eclipse.jet.editor/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-bin
diff --git a/plugins/org.eclipse.jet.editor/.jetproperties b/plugins/org.eclipse.jet.editor/.jetproperties
deleted file mode 100644
index 5585019..0000000
--- a/plugins/org.eclipse.jet.editor/.jetproperties
+++ /dev/null
@@ -1,4 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<jet-settings>
- <template-container>templates</template-container> <source-container>src</source-container>
-</jet-settings>
diff --git a/plugins/org.eclipse.jet.editor/.project b/plugins/org.eclipse.jet.editor/.project
deleted file mode 100644
index 9c4f7a4..0000000
--- a/plugins/org.eclipse.jet.editor/.project
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jet.editor</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jet.builder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <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.jet.jet2Nature</nature>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/plugins/org.eclipse.jet.editor/.settings/org.eclipse.jdt.core.prefs b/plugins/org.eclipse.jet.editor/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index e9571be..0000000
--- a/plugins/org.eclipse.jet.editor/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,12 +0,0 @@
-#Fri Nov 03 16:29:20 PST 2006
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.4
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning
-org.eclipse.jdt.core.compiler.source=1.3
diff --git a/plugins/org.eclipse.jet.editor/.settings/org.eclipse.jet.prefs b/plugins/org.eclipse.jet.editor/.settings/org.eclipse.jet.prefs
deleted file mode 100644
index 2767a7b..0000000
--- a/plugins/org.eclipse.jet.editor/.settings/org.eclipse.jet.prefs
+++ /dev/null
@@ -1,4 +0,0 @@
-#Sun Nov 12 18:00:04 PST 2006
-eclipse.preferences.version=1
-org.eclipse.jet.compiledTemplateSrcDir=src
-org.eclipse.jet.projectPrefs=true
diff --git a/plugins/org.eclipse.jet.editor/META-INF/MANIFEST.MF b/plugins/org.eclipse.jet.editor/META-INF/MANIFEST.MF
deleted file mode 100644
index f434cc4..0000000
--- a/plugins/org.eclipse.jet.editor/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,26 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: JET Editor Plug-in
-Bundle-SymbolicName: org.eclipse.jet.editor; singleton:=true
-Bundle-Version: 0.0.1
-Bundle-Activator: org.eclipse.jet.editor.Activator
-Require-Bundle: org.eclipse.core.runtime,
- org.eclipse.core.resources,
- org.eclipse.jface.text,
- org.eclipse.ui,
- org.eclipse.ui.ide,
- org.eclipse.ui.editors,
- org.eclipse.ui.workbench.texteditor,
- org.eclipse.ui.views,
- org.eclipse.ui.views.properties.tabbed,
- org.eclipse.jdt.core,
- org.eclipse.jdt.ui,
- org.eclipse.jet
-Eclipse-LazyStart: true
-Export-Package: org.eclipse.jet.editor,
- org.eclipse.jet.editor.configuration,
- org.eclipse.jet.editor.configuration.delegates,
- org.eclipse.jet.editor.outline,
- org.eclipse.jet.editor.partition,
- org.eclipse.jet.editor.rules,
- org.eclipse.jet.editor.scanners
diff --git a/plugins/org.eclipse.jet.editor/build.properties b/plugins/org.eclipse.jet.editor/build.properties
deleted file mode 100644
index 0d3d3a7..0000000
--- a/plugins/org.eclipse.jet.editor/build.properties
+++ /dev/null
@@ -1,6 +0,0 @@
-source.. = src/
-output.. = bin/
-bin.includes = plugin.xml,\
- META-INF/,\
- .,\
- icons/
diff --git a/plugins/org.eclipse.jet.editor/icons/sample.gif b/plugins/org.eclipse.jet.editor/icons/sample.gif
deleted file mode 100644
index 34fb3c9..0000000
--- a/plugins/org.eclipse.jet.editor/icons/sample.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jet.editor/plugin.xml b/plugins/org.eclipse.jet.editor/plugin.xml
deleted file mode 100644
index 6f27b6b..0000000
--- a/plugins/org.eclipse.jet.editor/plugin.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.2"?>
-<plugin>
- <extension-point id="partitionConfigurationDelegates" name="Partition Configuration Delegates" schema="schema/partitionConfigurationDelegates.exsd"/>
-
- <extension
- point="org.eclipse.ui.editors">
- <editor
- name="Java Emitter Templates Editor"
- extensions="jet"
- icon="icons/sample.gif"
- contributorClass="org.eclipse.ui.texteditor.BasicTextEditorActionContributor"
- class="org.eclipse.jet.editor.JETTextEditor"
- id="org.eclipse.jet.editor.editors.JETEditor">
- </editor>
- </extension>
- <extension
- point="org.eclipse.jet.editor.partitionConfigurationDelegates">
- <partitionConfigurationDelegate
- delegateClass="org.eclipse.jet.editor.configuration.delegates.JavaContentPartitionConfigurationDelegate">
- </partitionConfigurationDelegate>
- </extension>
-
-</plugin>
diff --git a/plugins/org.eclipse.jet.editor/schema/partitionConfigurationDelegates.exsd b/plugins/org.eclipse.jet.editor/schema/partitionConfigurationDelegates.exsd
deleted file mode 100644
index e542633..0000000
--- a/plugins/org.eclipse.jet.editor/schema/partitionConfigurationDelegates.exsd
+++ /dev/null
@@ -1,105 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.jet.editor">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.jet.editor" id="partitionConfigurationDelegates" name="Partition Configuration Delegates"/>
- </appInfo>
- <documentation>
- [Enter description of this extension point.]
- </documentation>
- </annotation>
-
- <element name="extension">
- <complexType>
- <sequence>
- <element ref="partitionConfigurationDelegate" minOccurs="1" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- <appInfo>
- <meta.attribute translatable="true"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="partitionConfigurationDelegate">
- <complexType>
- <attribute name="delegateClass" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- <appInfo>
- <meta.attribute kind="java" basedOn="org.eclipse.jet.editor.configuration.delegates.AbstractJETTextPartitionConfigurationDelegate"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="since"/>
- </appInfo>
- <documentation>
- [Enter the first release in which this extension point appears.]
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="examples"/>
- </appInfo>
- <documentation>
- [Enter extension point usage example here.]
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="apiInfo"/>
- </appInfo>
- <documentation>
- [Enter API information here.]
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="implementation"/>
- </appInfo>
- <documentation>
- [Enter information about supplied implementation of this extension point.]
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="copyright"/>
- </appInfo>
- <documentation>
-
- </documentation>
- </annotation>
-
-</schema>
diff --git a/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/Activator.java b/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/Activator.java
deleted file mode 100644
index 87de916..0000000
--- a/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/Activator.java
+++ /dev/null
@@ -1,61 +0,0 @@
-package org.eclipse.jet.editor;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.osgi.framework.BundleContext;
-
-/**
- * The activator class controls the plug-in life cycle
- */
-public class Activator extends AbstractUIPlugin {
-
- // The plug-in ID
- public static final String PLUGIN_ID = "org.eclipse.jet.editor";
-
- // The shared instance
- private static Activator plugin;
-
- /**
- * The constructor
- */
- public Activator() {
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
- */
- public void start(BundleContext context) throws Exception {
- super.start(context);
- plugin = this;
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
- */
- public void stop(BundleContext context) throws Exception {
- plugin = null;
- super.stop(context);
- }
-
- /**
- * Returns the shared instance
- *
- * @return the shared instance
- */
- public static Activator getDefault() {
- return plugin;
- }
-
- /**
- * Returns an image descriptor for the image file at the given
- * plug-in relative path
- *
- * @param path the path
- * @return the image descriptor
- */
- public static ImageDescriptor getImageDescriptor(String path) {
- return imageDescriptorFromPlugin(PLUGIN_ID, path);
- }
-}
diff --git a/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/JETEditorHelper.java b/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/JETEditorHelper.java
deleted file mode 100644
index 7701b82..0000000
--- a/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/JETEditorHelper.java
+++ /dev/null
@@ -1,318 +0,0 @@
-package org.eclipse.jet.editor;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jdt.core.eval.IEvaluationContext;
-import org.eclipse.jdt.internal.ui.text.java.AbstractJavaCompletionProposal;
-import org.eclipse.jdt.ui.text.java.CompletionProposalCollector;
-import org.eclipse.jdt.ui.text.java.IJavaCompletionProposal;
-import org.eclipse.jet.BodyContentWriter;
-import org.eclipse.jet.JET2Context;
-import org.eclipse.jet.JET2Template;
-import org.eclipse.jet.JET2TemplateLoader;
-import org.eclipse.jet.JET2Writer;
-import org.eclipse.jet.compiler.Comment;
-import org.eclipse.jet.compiler.DefaultJET2ASTVisitor;
-import org.eclipse.jet.compiler.JET2ASTElement;
-import org.eclipse.jet.compiler.JET2CompilationUnit;
-import org.eclipse.jet.compiler.JET2Declaration;
-import org.eclipse.jet.compiler.JET2Directive;
-import org.eclipse.jet.compiler.JET2Expression;
-import org.eclipse.jet.compiler.JET2Scriptlet;
-import org.eclipse.jet.compiler.TextElement;
-import org.eclipse.jet.compiler.XMLBodyElement;
-import org.eclipse.jet.compiler.XMLBodyElementEnd;
-import org.eclipse.jet.compiler.XMLEmptyElement;
-import org.eclipse.jet.internal.compiler.MethodBodyCreator;
-import org.eclipse.jet.internal.compiler.templates.CodeGenTemplateLoader;
-import org.eclipse.jet.transform.TransformContextExtender;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.Position;
-import org.eclipse.swt.graphics.Point;
-
-public class JETEditorHelper {
-
- public static class JETEditorMethodBodyCreator extends MethodBodyCreator
- {
-
- private Map generatedBodyMappingPositions;
-
- public JETEditorMethodBodyCreator(JET2TemplateLoader templateLoader, Map mappingPositions) {
- super(templateLoader);
- this.generatedBodyMappingPositions = mappingPositions;
- }
-
-
- /**
- * @see org.eclipse.jet.compiler.DefaultJET2ASTVisitor#visit(org.eclipse.jet.compiler.XMLBodyElement)
- */
- public void visit(XMLBodyElement element)
- {
- Position position = new Position(getBuffer().length());
- generatedBodyMappingPositions.put(element, position);
- super.visit(element);
- position.setLength(getBuffer().length() - position.offset);
- }
-
- /**
- * @see org.eclipse.jet.compiler.DefaultJET2ASTVisitor#endVisit(org.eclipse.jet.compiler.XMLBodyElement)
- */
- public void endVisit(XMLBodyElement element)
- {
- Position position = new Position(getBuffer().length());
- generatedBodyMappingPositions.put(element, position);
- super.endVisit(element);
- position.setLength(getBuffer().length() - position.offset);
- }
-
- /**
- * @see org.eclipse.jet.compiler.DefaultJET2ASTVisitor#visit(org.eclipse.jet.compiler.XMLEmptyElement)
- */
- public void visit(XMLEmptyElement element)
- {
- Position position = new Position(getBuffer().length());
- generatedBodyMappingPositions.put(element, position);
- super.visit(element);
- position.setLength(getBuffer().length() - position.offset);
- }
-
-
- /**
- * @see org.eclipse.jet.compiler.DefaultJET2ASTVisitor#visit(org.eclipse.jet.compiler.JET2Expression)
- */
- public void visit(JET2Expression expression)
- {
- Position position = new Position(getBuffer().length());
- generatedBodyMappingPositions.put(expression, position);
- super.visit(expression);
- position.setLength(getBuffer().length() - position.offset);
- }
-
- /**
- * @see org.eclipse.jet.compiler.DefaultJET2ASTVisitor#visit(org.eclipse.jet.compiler.JET2Scriptlet)
- */
- public void visit(JET2Scriptlet scriptlet)
- {
- Position position = new Position(getBuffer().length());
- generatedBodyMappingPositions.put(scriptlet, position);
- super.visit(scriptlet);
- position.setLength(getBuffer().length() - position.offset);
- }
-
- /**
- * @see org.eclipse.jet.compiler.DefaultJET2ASTVisitor#visit(org.eclipse.jet.compiler.TextElement)
- */
- public void visit(TextElement text)
- {
- Position position = new Position(getBuffer().length());
- generatedBodyMappingPositions.put(text, position);
- super.visit(text);
- position.setLength(getBuffer().length() - position.offset);
- }
-
- }
- private static class RelevantElementFoundExcetion extends RuntimeException {
- private static final long serialVersionUID = -7146049866718374643L;
- }
- private static class Detector extends DefaultJET2ASTVisitor {
- JET2ASTElement match;
- int documentOffset;
-
- public Detector(int offset) {
- documentOffset = offset;
- }
-
- public void visit(JET2Declaration declaration) {
- matchOffset(declaration);
- }
-
- public void visit(JET2Directive directive) {
- matchOffset(directive);
- }
-
- public void visit(JET2Expression expression) {
- matchOffset(expression);
- }
-
- public void visit(JET2Scriptlet scriptlet) {
- matchOffset(scriptlet);
- }
-
- public void visit(TextElement text) {
- matchOffset(text);
- }
-
- public void visit(XMLEmptyElement xmlEmptyElement) {
- matchOffset(xmlEmptyElement);
- }
-
- public void visit(XMLBodyElement xmlBodyElement) {
- matchOffset(xmlBodyElement);
- }
-
- public void visit(XMLBodyElementEnd xmlBodyElementEnd) {
- matchOffset(xmlBodyElementEnd);
- }
-
- public void visit(Comment comment) {
- matchOffset(comment);
- }
-
- public void matchOffset(JET2ASTElement element) {
- if (element.getStart() <= documentOffset && element.getEnd() > documentOffset) {
- match = element;
- throw new RelevantElementFoundExcetion();
- }
- }
- }
-
-
-// public static String computeJavaSource(JET2CompilationUnit cu, Map mappedPositions) {
-// Map variables = new HashMap();
-// variables.put("org.eclipse.jet.storeJavaMappingPositions", mappedPositions);
-// variables.put("cu", cu);
-// JET2Context context = new JET2Context(null, variables); //$NON-NLS-1$
-// JET2TemplateLoader templateLoader = new CodeGenTemplateLoader();
-// TransformContextExtender.getInstance(context).setLoader(templateLoader);
-// JET2Template template = new JETEditorJET2JavaGenerator(); //$NON-NLS-1$
-// JET2Writer out = new BodyContentWriter();
-// template.generate(context, out);
-// return out.getDocument().get();
-// }
-
- public static JET2ASTElement getASTElementAt(JET2CompilationUnit cu, int documentOffset) {
- Detector detector = new Detector(documentOffset);
- try {
- cu.accept(detector);
- } catch (RelevantElementFoundExcetion e) {
- // element found
- }
- return detector.match;
- }
-
- private static JET2Declaration[] getAllJavaDeclarations(JET2CompilationUnit cu) {
- final List result = new ArrayList();
- cu.accept(new DefaultJET2ASTVisitor() {
- public void visit(JET2Declaration declaration) {
- result.add(declaration);
- }
- });
- return (JET2Declaration[]) result.toArray(new JET2Declaration[result.size()]);
- }
-
- public static String getDeclarationsSourceCode(JET2CompilationUnit cu) {
- JET2Declaration[] declarations = getAllJavaDeclarations(cu);
- StringBuffer declarationsSource = new StringBuffer(declarations.length * 20);
- for (int i = 0; i < declarations.length; i++) {
- JET2Declaration declaration = declarations[i];
- declarationsSource.append(declaration.getJavaContent());
- }
- return declarationsSource.toString();
- }
-
- public static String getPreviousGeneratedJavaSource(IJavaProject javaProject, JET2CompilationUnit cu,
- JET2ASTElement bodyElement) {
- JET2TemplateLoader templateLoader = new CodeGenTemplateLoader();
- MethodBodyCreator generatedBody = new MethodBodyCreator(templateLoader);
-
- List sortedPrevElements = new ArrayList();
- JET2ASTElement prevASTElement = bodyElement.getPrevElement();
- while (prevASTElement != null) {
- sortedPrevElements.add(0, prevASTElement);
- prevASTElement = prevASTElement.getPrevElement();
- }
- for (Iterator iterator = sortedPrevElements.iterator(); iterator.hasNext();) {
- JET2ASTElement prevElement = (JET2ASTElement) iterator.next();
- prevElement.accept(generatedBody);
- }
- return generatedBody.getBuffer();
- }
-
- public static CompletionProposalCollector collect(IJavaProject javaProject, JET2CompilationUnit cu,
- String codeSnippet, int offset) {
- IEvaluationContext context = javaProject.newEvaluationContext();
- List importList = new ArrayList();
- importList.addAll(cu.getImports());
- importList.add("org.eclipse.jet.JET2Context");
- importList.add("org.eclipse.jet.JET2Template");
- importList.add("org.eclipse.jet.JET2Writer");
- importList.add("org.eclipse.jet.taglib.RuntimeTagElement");
- importList.add("org.eclipse.jet.taglib.TagInfo");
- String[] imports = new String[importList.size()];
- importList.toArray(imports);
- String packageName = cu.getOutputJavaPackage();
-
- context.setPackageName(packageName);
- context.setImports(imports);
-
- CompletionProposalCollector proposalCollector = new CompletionProposalCollector(javaProject);
- try {
- context.codeComplete(codeSnippet, offset, proposalCollector);
- return proposalCollector;
- } catch (JavaModelException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- return null;
- }
-
- public static IJavaCompletionProposal[] getJavaCompletionProposal(IJavaProject javaProject, JET2CompilationUnit cu,
- String codeSnippet, ITextViewer viewer, int offset) {
- CompletionProposalCollector proposalCollector = collect(javaProject, cu, codeSnippet, offset);
- if (proposalCollector != null) {
- Point selection = viewer.getSelectedRange();
- if (selection.y > 0)
- proposalCollector.setReplacementLength(selection.y);
- IJavaCompletionProposal[] javaProposals = proposalCollector.getJavaCompletionProposals();
- IJavaCompletionProposal[] keywordsProposals = proposalCollector.getKeywordCompletionProposals();
-
- IJavaCompletionProposal[] unsortedJavaProposals = new IJavaCompletionProposal[javaProposals.length
- + keywordsProposals.length];
- System.arraycopy(keywordsProposals, 0, unsortedJavaProposals, 0, keywordsProposals.length);
- System.arraycopy(javaProposals, 0, unsortedJavaProposals, keywordsProposals.length, javaProposals.length);
-
- // sort them by relevance (which is given, but they are unsorted)
- List sortedJavaProposals = new LinkedList();
- for (int i = 0; i < unsortedJavaProposals.length; i++) {
- IJavaCompletionProposal unsortedJavaProposal = unsortedJavaProposals[i];
- int index = 0;
- for (Iterator iterator = sortedJavaProposals.iterator(); iterator.hasNext();) {
- IJavaCompletionProposal proposal = (IJavaCompletionProposal) iterator.next();
- if (proposal.getRelevance() <= unsortedJavaProposal.getRelevance()) {
- index = sortedJavaProposals.indexOf(proposal);
- break;
- }
- }
- sortedJavaProposals.add(index, unsortedJavaProposal);
- }
- IJavaCompletionProposal[] results = new IJavaCompletionProposal[sortedJavaProposals.size()];
- sortedJavaProposals.toArray(results);
- return results;
- }
- return new IJavaCompletionProposal[0];
- }
-
- public static String getMethodBodySource(JET2CompilationUnit cu, Map generatedBodyMappingPositions) {
- JET2TemplateLoader templateLoader = new CodeGenTemplateLoader();
- JETEditorMethodBodyCreator generatedBody = new JETEditorMethodBodyCreator(templateLoader,
- generatedBodyMappingPositions);
- cu.accept(generatedBody);
- return generatedBody.getBuffer();
- }
-
- public static void adjustResults(IJavaCompletionProposal[] results, int offset) {
- for (int i = 0; i < results.length; i++) {
- if (results[i] instanceof AbstractJavaCompletionProposal) {
- AbstractJavaCompletionProposal proposal = (AbstractJavaCompletionProposal) results[i];
- proposal.setReplacementOffset(offset);
- }
- }
- }
-}
diff --git a/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/JETSourceViewer.java b/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/JETSourceViewer.java
deleted file mode 100644
index d07b38b..0000000
--- a/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/JETSourceViewer.java
+++ /dev/null
@@ -1,139 +0,0 @@
-package org.eclipse.jet.editor;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.preference.PreferenceConverter;
-import org.eclipse.jface.text.source.IOverviewRuler;
-import org.eclipse.jface.text.source.IVerticalRuler;
-import org.eclipse.jface.text.source.projection.ProjectionViewer;
-import org.eclipse.jface.util.IPropertyChangeListener;
-import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.swt.custom.StyledText;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.RGB;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.texteditor.AbstractDecoratedTextEditorPreferenceConstants;
-import org.eclipse.ui.texteditor.AbstractTextEditor;
-
-public class JETSourceViewer extends ProjectionViewer implements IPropertyChangeListener {
-
- private IPreferenceStore preferenceStore;
- private Color foregroundColor;
- private Color backgroundColor;
- private Color selectionForegroundColor;
- private Color selectionBackgroundColor;
-
- public JETSourceViewer(Composite parent, IVerticalRuler ruler, IOverviewRuler overviewRuler,
- boolean showsAnnotationOverview, int styles, IPreferenceStore store) {
- super(parent, ruler, overviewRuler, showsAnnotationOverview, styles);
- setPreferenceStore(store);
- // TODO Auto-generated constructor stub
- }
-
- public void setPreferenceStore(IPreferenceStore store) {
- if (preferenceStore != null)
- preferenceStore.removePropertyChangeListener(this);
-
- preferenceStore = store;
-
- if (preferenceStore != null) {
- preferenceStore.addPropertyChangeListener(this);
- initializeViewerColors();
- }
- }
-
- private void initializeViewerColors() {
- if (preferenceStore != null) {
-
- StyledText styledText = getTextWidget();
- if (styledText == null)
- return;
- // ----------- foreground color --------------------
- Color color = preferenceStore.getBoolean(AbstractTextEditor.PREFERENCE_COLOR_FOREGROUND_SYSTEM_DEFAULT) ? null
- : createColor(preferenceStore, AbstractTextEditor.PREFERENCE_COLOR_FOREGROUND, styledText.getDisplay());
- styledText.setForeground(color);
-
- if (foregroundColor != null)
- foregroundColor.dispose();
-
- foregroundColor = color;
-
- // ---------- background color ----------------------
- color = preferenceStore.getBoolean(AbstractTextEditor.PREFERENCE_COLOR_BACKGROUND_SYSTEM_DEFAULT) ? null
- : createColor(preferenceStore, AbstractTextEditor.PREFERENCE_COLOR_BACKGROUND, styledText.getDisplay());
- styledText.setBackground(color);
-
- if (backgroundColor != null)
- backgroundColor.dispose();
-
- backgroundColor = color;
-
- // ----------- selection foreground color --------------------
- color = preferenceStore
- .getBoolean(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_SELECTION_FOREGROUND_DEFAULT_COLOR) ? null
- : createColor(preferenceStore,
- AbstractDecoratedTextEditorPreferenceConstants.EDITOR_SELECTION_FOREGROUND_COLOR, styledText.getDisplay());
- styledText.setSelectionForeground(color);
-
- if (selectionForegroundColor != null)
- selectionForegroundColor.dispose();
-
- selectionForegroundColor = color;
-
- // ---------- selection background color ----------------------
- color = preferenceStore
- .getBoolean(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_SELECTION_BACKGROUND_DEFAULT_COLOR) ? null
- : createColor(preferenceStore,
- AbstractDecoratedTextEditorPreferenceConstants.EDITOR_SELECTION_BACKGROUND_COLOR, styledText.getDisplay());
- styledText.setSelectionBackground(color);
-
- if (selectionBackgroundColor != null)
- selectionBackgroundColor.dispose();
-
- selectionBackgroundColor = color;
- }
- }
-
- /**
- * Creates a color from the information stored in the given preference store.
- * Returns <code>null</code> if there is no such information available.
- *
- * @param store the store to read from
- * @param key the key used for the lookup in the preference store
- * @param display the display used create the color
- * @return the created color according to the specification in the preference store
- * @since 3.0
- */
- private Color createColor(IPreferenceStore store, String key, Display display) {
-
- RGB rgb = null;
-
- if (store.contains(key)) {
-
- if (store.isDefault(key))
- rgb = PreferenceConverter.getDefaultColor(store, key);
- else
- rgb = PreferenceConverter.getColor(store, key);
-
- if (rgb != null)
- return new Color(display, rgb);
- }
-
- return null;
- }
-
- public void propertyChange(PropertyChangeEvent event) {
- String property = event.getProperty();
- if (AbstractTextEditor.PREFERENCE_COLOR_FOREGROUND.equals(property)
- || AbstractTextEditor.PREFERENCE_COLOR_FOREGROUND_SYSTEM_DEFAULT.equals(property)
- || AbstractTextEditor.PREFERENCE_COLOR_BACKGROUND.equals(property)
- || AbstractTextEditor.PREFERENCE_COLOR_BACKGROUND_SYSTEM_DEFAULT.equals(property)
- || AbstractDecoratedTextEditorPreferenceConstants.EDITOR_SELECTION_FOREGROUND_COLOR.equals(property)
- || AbstractDecoratedTextEditorPreferenceConstants.EDITOR_SELECTION_FOREGROUND_DEFAULT_COLOR.equals(property)
- || AbstractDecoratedTextEditorPreferenceConstants.EDITOR_SELECTION_BACKGROUND_COLOR.equals(property)
- || AbstractDecoratedTextEditorPreferenceConstants.EDITOR_SELECTION_BACKGROUND_DEFAULT_COLOR.equals(property))
- {
- initializeViewerColors();
- }
- }
-}
diff --git a/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/JETTextEditor.java b/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/JETTextEditor.java
deleted file mode 100644
index 8e1cd3a..0000000
--- a/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/JETTextEditor.java
+++ /dev/null
@@ -1,411 +0,0 @@
-package org.eclipse.jet.editor;
-
-import java.io.ByteArrayInputStream;
-import java.io.InputStream;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.ResourceBundle;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jet.JET2Platform;
-import org.eclipse.jet.compiler.Comment;
-import org.eclipse.jet.compiler.DefaultJET2ASTVisitor;
-import org.eclipse.jet.compiler.JET2ASTElement;
-import org.eclipse.jet.compiler.JET2CompilationUnit;
-import org.eclipse.jet.compiler.JET2Declaration;
-import org.eclipse.jet.compiler.JET2Directive;
-import org.eclipse.jet.compiler.JET2Expression;
-import org.eclipse.jet.compiler.JET2Scriptlet;
-import org.eclipse.jet.compiler.TextElement;
-import org.eclipse.jet.compiler.XMLBodyElement;
-import org.eclipse.jet.compiler.XMLBodyElementEnd;
-import org.eclipse.jet.compiler.XMLEmptyElement;
-import org.eclipse.jet.editor.configuration.JETDocumentProvider;
-import org.eclipse.jet.editor.configuration.JETEditorPreferenceConstants;
-import org.eclipse.jet.editor.configuration.JETSourceViewerConfiguration;
-import org.eclipse.jet.editor.configuration.JETTokenStyleManager;
-import org.eclipse.jet.editor.outline.JETOutlinePage;
-import org.eclipse.jet.editor.partition.JETDocumentPartitionScanner;
-import org.eclipse.jet.internal.parser.JETParser;
-import org.eclipse.jet.internal.parser.JETReader;
-import org.eclipse.jet.taglib.TagLibrary;
-import org.eclipse.jet.taglib.TagLibraryManager;
-import org.eclipse.jet.taglib.TagLibraryReference;
-import org.eclipse.jet.transform.IJETBundleDescriptor;
-import org.eclipse.jet.transform.IJETBundleManager;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.internal.text.link.contentassist.HTMLTextPresenter;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.text.DefaultInformationControl;
-import org.eclipse.jface.text.IInformationControl;
-import org.eclipse.jface.text.IInformationControlCreator;
-import org.eclipse.jface.text.ITextListener;
-import org.eclipse.jface.text.Position;
-import org.eclipse.jface.text.TextEvent;
-import org.eclipse.jface.text.source.ISourceViewer;
-import org.eclipse.jface.text.source.IVerticalRuler;
-import org.eclipse.jface.text.source.projection.ProjectionSupport;
-import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.RGB;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorSite;
-import org.eclipse.ui.IFileEditorInput;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.editors.text.IEncodingSupport;
-import org.eclipse.ui.editors.text.TextEditor;
-import org.eclipse.ui.texteditor.ContentAssistAction;
-import org.eclipse.ui.texteditor.ITextEditorActionDefinitionIds;
-import org.eclipse.ui.views.contentoutline.IContentOutlinePage;
-
-public class JETTextEditor extends TextEditor {
-
- private JETTokenStyleManager tokenStyleManager;
- private JETSourceViewer sourceViewer;
- private JETDocumentPartitionScanner partitionScanner;
- private ProjectionSupport projectionSupport;
- private IContentOutlinePage outlinePage;
-
- private JET2CompilationUnit cUnit;
- private IJavaProject javaProject;
- private Map positions = Collections.EMPTY_MAP;
- private Map registeredPrefixMap;
-
- public JETTextEditor() {
- super();
- IPreferenceStore preferenceStore = Activator.getDefault().getPreferenceStore();
- JETEditorPreferenceConstants.initializeDefaultValues(preferenceStore);
- setPreferenceStore(preferenceStore);
- tokenStyleManager = new JETTokenStyleManager(preferenceStore);
- partitionScanner = new JETDocumentPartitionScanner(this);
- setSourceViewerConfiguration(new JETSourceViewerConfiguration(this));
- setDocumentProvider(new JETDocumentProvider(this));
- }
-
- public void dispose() {
- tokenStyleManager.dispose();
- super.dispose();
- }
-
- public void init(IEditorSite site, IEditorInput input) throws PartInitException {
- super.init(site, input);
- if (input instanceof IFileEditorInput) {
- IFile jetTemplateFile = ((IFileEditorInput) input).getFile();
- javaProject = JavaCore.create(jetTemplateFile.getProject());
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.texteditor.AbstractDecoratedTextEditor#createSourceViewer(org.eclipse.swt.widgets.Composite, org.eclipse.jface.text.source.IVerticalRuler, int)
- */
- protected ISourceViewer createSourceViewer(Composite parent, IVerticalRuler ruler, int styles) {
- fAnnotationAccess= getAnnotationAccess();
- fOverviewRuler= createOverviewRuler(getSharedColors());
-
- sourceViewer= new JETSourceViewer(parent, ruler, getOverviewRuler(), isOverviewRulerVisible(), styles, getPreferenceStore());
- // ensure decoration support has been created and configured.
- getSourceViewerDecorationSupport(sourceViewer);
-
- projectionSupport= new ProjectionSupport(sourceViewer, getAnnotationAccess(), getSharedColors());
- projectionSupport.addSummarizableAnnotationType("org.eclipse.ui.workbench.texteditor.error"); //$NON-NLS-1$
- projectionSupport.addSummarizableAnnotationType("org.eclipse.ui.workbench.texteditor.warning"); //$NON-NLS-1$
- projectionSupport.setHoverControlCreator(new IInformationControlCreator() {
- public IInformationControl createInformationControl(Shell shell) {
- return new DefaultInformationControl(shell, SWT.TOOL | SWT.NO_TRIM | getOrientation(), SWT.NONE, new HTMLTextPresenter());
- }
- });
- projectionSupport.install();
- sourceViewer.addTextListener(new ITextListener() {
- public void textChanged(TextEvent event) {
- int changeOffset = event.getOffset();
-
- int replacedTextLength = event.getReplacedText() == null ? 0 : event.getReplacedText().length();
- int textLength = event.getText() == null ? 0 : event.getText().length();
-
- int shift = textLength - replacedTextLength; // can be negative
-
- JET2ASTElement elementAtChangeOffset = getCachedASTElement(changeOffset);
- JET2ASTElement elementAtEndOfChange = getCachedASTElement(changeOffset + replacedTextLength);
-
- if (elementAtChangeOffset != null) {
- int start = elementAtChangeOffset.getStart();
- int end = elementAtEndOfChange == null ?
- elementAtChangeOffset.getEnd() :
- elementAtEndOfChange.getEnd();
- try {
- String newText =
- sourceViewer.getDocument().get(start, end - start + shift);
- // reparse this portion of the document only
-// JET2CompilationUnit incrementalCUnit = new JET2CompilationUnit();
-// Map cUnitPredefLibs = new HashMap();
-// for (int i = 0; i < cUnit.getTagLibraryReferences().length; i++) {
-// TagLibraryReference tagLibRef = cUnit.getTagLibraryReferences()[i];
-// cUnitPredefLibs.put(tagLibRef.getPrefix(), tagLibRef.getTagLibraryId());
-// }
-// incrementalCUnit.setPredefinedTagLibraries(cUnitPredefLibs);
-// incrementalCUnit.parse(newText);
-// List parsedBodyElements = incrementalCUnit.getBodyElements();
-//
-// // remove previous body elements on the original cUnit
-// int index = cUnit.getBodyElements().indexOf(elementAtChangeOffset);
-// if (elementAtChangeOffset == elementAtEndOfChange || elementAtEndOfChange == null) {
-// cUnit.getBodyElements().remove(elementAtChangeOffset);
-// } else {
-// JET2ASTElement nextElement = elementAtChangeOffset.getNextElement();
-// while (nextElement != elementAtEndOfChange) {
-// cUnit.getBodyElements().remove(elementAtEndOfChange);
-// nextElement = nextElement.getNextElement();
-// }
-// cUnit.getBodyElements().remove(elementAtChangeOffset);
-// cUnit.getBodyElements().remove(elementAtEndOfChange);
-// }
-// cUnit.getBodyElements().addAll(index, parsedBodyElements);
-// if (outlinePage != null)
-// ((JETOutlinePage)outlinePage).setInput();
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- //editorTextChanged();
- }
- });
- return sourceViewer;
- }
-
- public ISourceViewer getEditorSourceViewer() {
- return sourceViewer;
- }
-
- public IPreferenceStore getEditorPreferenceStore() {
- return super.getPreferenceStore();
- }
-
- public JETDocumentPartitionScanner getPartitionScanner() {
- return partitionScanner;
- }
-
- public JETTokenStyleManager getTokenStyleManager() {
- return tokenStyleManager;
- }
-
- protected void handleEditorInputChanged() {
- super.handleEditorInputChanged();
- editorTextChanged();
- }
-
- private void editorTextChanged() {
- cUnit = null;
-// if (outlinePage != null && outlinePage.getControl().isVisible())
-// ((JETOutlinePage)outlinePage).setInput();
- }
-
- public JET2CompilationUnit requestCompilationUnit() {
- if (cUnit == null) {
- IEditorInput editorInput = getEditorInput();
- String charset = "UTF-8";
- InputStream is = new ByteArrayInputStream(sourceViewer.getDocument().get().getBytes());
- cUnit = new JET2CompilationUnit();
- Map predefinedLibraryMap = getRegisteredPrefixMap();
- if (editorInput instanceof IFileEditorInput) {
- IFile jetTemplateFile = ((IFileEditorInput) editorInput).getFile();
- IJETBundleManager bundleManager = JET2Platform.getJETBundleManager();
- IJETBundleDescriptor descriptor = bundleManager.getDescriptorForProject(jetTemplateFile.getProject().getName());
- predefinedLibraryMap.putAll(descriptor != null ? getPredefinedPrefixMap(descriptor) : Collections.EMPTY_MAP);
- }
- cUnit.setPredefinedTagLibraries(predefinedLibraryMap);
- cUnit.parse(is, charset);
- PositionsCollector collector = new PositionsCollector();
- cUnit.accept(collector);
- positions = collector.getPositions();
- }
- return cUnit;
- }
-
- public JET2ASTElement getASTElement(int offset) {
- if (cUnit == null)
- requestCompilationUnit(); // recompute the positions if the compilation unit has been invalidated
- return getCachedASTElement(offset);
- }
-
- private JET2ASTElement getCachedASTElement(int offset) {
- for (Iterator iterator = positions.keySet().iterator(); iterator.hasNext();) {
- Position pos = (Position) iterator.next();
- if (pos.offset <= offset && (pos.length + pos.offset) > offset)
- return (JET2ASTElement) positions.get(pos);
- }
- return null;
- }
-
- public IJavaProject getJETJavaProject() {
- return javaProject;
- }
-
- private Map getRegisteredPrefixMap() {
- if (registeredPrefixMap == null) {
- String[] tagLibIds = TagLibraryManager.getInstance().getKnownLibraryIds();
- registeredPrefixMap = new HashMap(tagLibIds.length);
- for (int i = 0; i < tagLibIds.length; i++) {
- String id = tagLibIds[i];
- TagLibrary tagLib = TagLibraryManager.getInstance().getTagLibrary(id, true);
- registeredPrefixMap.put(tagLib.getDefaultPrefix(), tagLib.getLibraryId());
- }
- }
- return registeredPrefixMap;
- }
-
- private Map getPredefinedPrefixMap(IJETBundleDescriptor descriptor) {
- final TagLibraryReference[] tlRefs = descriptor.getTagLibraryReferences();
- final Map result = new HashMap(tlRefs.length);
- for (int i = 0; i < tlRefs.length; i++) {
- if (tlRefs[i].isAutoImport()) {
- result.put(tlRefs[i].getPrefix(), tlRefs[i].getTagLibraryId());
- }
- }
- return result;
- }
-
- /*
- * @see AbstractTextEditor#createActions()
- */
- protected void createActions() {
- super.createActions();
- ResourceBundle resourceBundle = ResourceBundle.getBundle("org.eclipse.jet.editor.i18n.TextEditorMessages");
- Action action = new ContentAssistAction(resourceBundle,"ContentAssistProposal.", this); //$NON-NLS-1$
- action.setActionDefinitionId(ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS);
- setAction("ContentAssistProposal", action); //$NON-NLS-1$
- markAsStateDependentAction("ContentAssistProposal", true); //$NON-NLS-1$
- }
-
- protected void handlePreferenceStoreChanged(PropertyChangeEvent event) {
- // TODO Auto-generated method stub
- super.handlePreferenceStoreChanged(event);
- if (event.getNewValue() instanceof RGB) {
- getTokenStyleManager().bindColor(event.getProperty(), (RGB) event.getNewValue());
- }
- }
-
- /*
- * @see AbstractTextEditor#getAdapter(Class)
- */
- public Object getAdapter(Class required) {
-
- if (IContentOutlinePage.class.equals(required)) {
- if (outlinePage == null)
- outlinePage= createOutlinePage();
- return outlinePage;
- }
-
- if (IEncodingSupport.class.equals(required))
- return fEncodingSupport;
-
- if (projectionSupport != null) {
- Object adapter= projectionSupport.getAdapter(getSourceViewer(), required);
- if (adapter != null)
- return adapter;
- }
-
- return super.getAdapter(required);
- }
-
- protected IContentOutlinePage createOutlinePage() {
- JETOutlinePage page= new JETOutlinePage(this);
- // Listen to selection so that we can handle it is a special way.
- //
- page.addSelectionChangedListener(new ISelectionChangedListener() {
- // This ensures that we handle selections correctly.
- //
- public void selectionChanged(SelectionChangedEvent event) {
- handleContentOutlineSelection(event.getSelection());
- }
- });
- return page;
- }
-
- protected void handleContentOutlineSelection(ISelection selection) {
- // TODO Auto-generated method stub
- IStructuredSelection ssel = (IStructuredSelection) selection;
- Object firstElement = ssel.getFirstElement();
- if (firstElement instanceof JET2ASTElement) {
- JET2ASTElement astElement = (JET2ASTElement) firstElement;
- int start = astElement.getStart();
- int end = astElement.getEnd();
- if (astElement instanceof TextElement) {
- if (astElement.getPrevElement()!= null)
- start = astElement.getPrevElement().getEnd();
- else
- start = 0;
- if (astElement.getNextElement() != null)
- end = astElement.getNextElement().getStart();
- else
- end = sourceViewer.getDocument().getLength();
- }
- sourceViewer.setSelectedRange(start, end - start);
- sourceViewer.revealRange(start, end - start);
- }
- }
-
- public void createContextMenuFor(TreeViewer contentOutlineViewer) {
- // TODO Auto-generated method stub
-
- }
-
- private static class PositionsCollector extends DefaultJET2ASTVisitor {
- private Map positions = new HashMap();
-
- public Map getPositions() {
- return positions;
- }
-
- public void visit(JET2Declaration declaration) {
- matchOffset(declaration);
- }
-
- public void visit(JET2Directive directive) {
- matchOffset(directive);
- }
-
- public void visit(JET2Expression expression) {
- matchOffset(expression);
- }
-
- public void visit(JET2Scriptlet scriptlet) {
- matchOffset(scriptlet);
- }
-
- public void visit(TextElement text) {
- matchOffset(text);
- }
-
- public void visit(XMLEmptyElement xmlEmptyElement) {
- matchOffset(xmlEmptyElement);
- }
-
- public void visit(XMLBodyElement xmlBodyElement) {
- matchOffset(xmlBodyElement);
- }
-
- public void visit(XMLBodyElementEnd xmlBodyElementEnd) {
- matchOffset(xmlBodyElementEnd);
- }
-
- public void visit(Comment comment) {
- matchOffset(comment);
- }
-
- public void matchOffset(JET2ASTElement element) {
- positions.put(new Position(element.getStart(), element.getEnd() - element.getStart()), element);
- }
- }
-}
diff --git a/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/configuration/DoubleClickStrategy.java b/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/configuration/DoubleClickStrategy.java
deleted file mode 100644
index 10fd0e9..0000000
--- a/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/configuration/DoubleClickStrategy.java
+++ /dev/null
@@ -1,112 +0,0 @@
-package org.eclipse.jet.editor.configuration;
-
-import org.eclipse.jface.text.*;
-
-public class DoubleClickStrategy implements ITextDoubleClickStrategy {
- protected ITextViewer fText;
-
- public void doubleClicked(ITextViewer part) {
- int pos = part.getSelectedRange().x;
-
- if (pos < 0)
- return;
-
- fText = part;
-
- if (!selectComment(pos)) {
- selectWord(pos);
- }
- }
- protected boolean selectComment(int caretPos) {
- IDocument doc = fText.getDocument();
- int startPos, endPos;
-
- try {
- int pos = caretPos;
- char c = ' ';
-
- while (pos >= 0) {
- c = doc.getChar(pos);
- if (c == '\\') {
- pos -= 2;
- continue;
- }
- if (c == Character.LINE_SEPARATOR || c == '\"')
- break;
- --pos;
- }
-
- if (c != '\"')
- return false;
-
- startPos = pos;
-
- pos = caretPos;
- int length = doc.getLength();
- c = ' ';
-
- while (pos < length) {
- c = doc.getChar(pos);
- if (c == Character.LINE_SEPARATOR || c == '\"')
- break;
- ++pos;
- }
- if (c != '\"')
- return false;
-
- endPos = pos;
-
- int offset = startPos + 1;
- int len = endPos - offset;
- fText.setSelectedRange(offset, len);
- return true;
- } catch (BadLocationException x) {
- }
-
- return false;
- }
- protected boolean selectWord(int caretPos) {
-
- IDocument doc = fText.getDocument();
- int startPos, endPos;
-
- try {
-
- int pos = caretPos;
- char c;
-
- while (pos >= 0) {
- c = doc.getChar(pos);
- if (!Character.isJavaIdentifierPart(c))
- break;
- --pos;
- }
-
- startPos = pos;
-
- pos = caretPos;
- int length = doc.getLength();
-
- while (pos < length) {
- c = doc.getChar(pos);
- if (!Character.isJavaIdentifierPart(c))
- break;
- ++pos;
- }
-
- endPos = pos;
- selectRange(startPos, endPos);
- return true;
-
- } catch (BadLocationException x) {
- }
-
- return false;
- }
-
- private void selectRange(int startPos, int stopPos) {
- int offset = startPos + 1;
- int length = stopPos - offset;
- fText.setSelectedRange(offset, length);
- }
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/configuration/IJETColorConstants.java b/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/configuration/IJETColorConstants.java
deleted file mode 100644
index f109ac0..0000000
--- a/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/configuration/IJETColorConstants.java
+++ /dev/null
@@ -1,17 +0,0 @@
-package org.eclipse.jet.editor.configuration;
-
-import org.eclipse.swt.graphics.RGB;
-
-interface IJETColorConstants {
- RGB JET_CUSTOM_TAG_FG = new RGB(180, 128, 0);
- RGB JET_COMMENT_FG = new RGB(0, 155, 50);
- RGB JET_DIRECTIVE_FG = new RGB(180, 128, 0);
- RGB JET_EXPRESSION_FG = new RGB (180, 128, 0);
- RGB JET_SCRIPTLET_FG = new RGB(180, 128, 0);
-
- RGB JET_EXPRESSION_BG = new RGB(220, 230, 255);
- RGB JET_DEFAULT_BG = new RGB(230, 230, 230);
-
- RGB JET_JAVA_CODE = new RGB(128, 128, 128);
- RGB PROC_INSTR = new RGB(128, 128, 128);
-}
diff --git a/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/configuration/JETDocumentProvider.java b/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/configuration/JETDocumentProvider.java
deleted file mode 100644
index 22b88eb..0000000
--- a/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/configuration/JETDocumentProvider.java
+++ /dev/null
@@ -1,31 +0,0 @@
-package org.eclipse.jet.editor.configuration;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jet.editor.JETTextEditor;
-import org.eclipse.jet.editor.partition.JETDocumentPartitionScanner;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IDocumentPartitioner;
-import org.eclipse.jface.text.rules.FastPartitioner;
-import org.eclipse.ui.editors.text.FileDocumentProvider;
-
-public class JETDocumentProvider extends FileDocumentProvider {
-
- private JETTextEditor editor;
- public JETDocumentProvider(JETTextEditor editor) {
- this.editor = editor;
- }
-
- protected IDocument createDocument(Object element) throws CoreException {
- IDocument document = super.createDocument(element);
- JETDocumentPartitionScanner partitionScanner = editor.getPartitionScanner();
- if (document != null) {
- IDocumentPartitioner partitioner =
- new FastPartitioner(
- partitionScanner,
- partitionScanner.getContentTypes(editor.getEditorSourceViewer()));
- partitioner.connect(document);
- document.setDocumentPartitioner(partitioner);
- }
- return document;
- }
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/configuration/JETEditorPreferenceConstants.java b/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/configuration/JETEditorPreferenceConstants.java
deleted file mode 100644
index 30f5ea5..0000000
--- a/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/configuration/JETEditorPreferenceConstants.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 - 2006 Joel Cheuoua & others.
- * 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:
- * Joel Cheuoua - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jet.editor.configuration;
-
-import org.eclipse.jdt.ui.PreferenceConstants;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.preference.PreferenceConverter;
-import org.eclipse.ui.texteditor.AbstractDecoratedTextEditorPreferenceConstants;
-
-/**
- * Preference Constants used for the IRL Editor
- * @author lmirguet
- * @version $Revision: 1.1 $
- */
-public class JETEditorPreferenceConstants {
- public static final String JET_CUSTOM_TAG_FG_COLOR = "jet_custom_tag_foreground";
- public static final String JET_CUSTOM_TAG_BOLD = "jet_custom_tag_bold";
- public static final String JET_CUSTOM_TAG_ITALIC = "jet_custom_tag_italic";
- public static final String JET_CUSTOM_TAG_UNDERLINE = "jet_custom_tag_underline";
-
- public static final String JET_COMMENT_FG_COLOR = "jet_comment_foreground";
- public static final String JET_COMMENT_BOLD = "jet_comment_bold";
- public static final String JET_COMMENT_ITALIC = "jet_comment_italic";
- public static final String JET_COMMENT_UNDERLINE = "jet_comment_underline";
-
- public static final String JET_EXPRESSION_FG_COLOR = "jet_expression_foreground";
- public static final String JET_EXPRESSION_BOLD = "jet_expression_bold";
- public static final String JET_EXPRESSION_ITALIC = "jet_expression_italic";
- public static final String JET_EXPRESSION_UNDERLINE = "jet_expression_underline";
-
- public static final String JET_SCRIPTLET_FG_COLOR = "jet_scriptlet_foreground";
- public static final String JET_SCRIPTLET_BOLD = "jet_scriptlet_bold";
- public static final String JET_SCRIPTLET_ITALIC = "jet_scriptlet_italic";
- public static final String JET_SCRIPTLET_UNDERLINE = "jet_scriptlet_underline";
-
- public static final String JET_DIRECTIVE_FG_COLOR = "jet_directive_foreground";
- public static final String JET_DIRECTIVE_BOLD = "jet_directive_bold";
- public static final String JET_DIRECTIVE_ITALIC = "jet_directive_italic";
- public static final String JET_DIRECTIVE_UNDERLINE = "jet_directive_underline";
-
- public static final String JET_DIRECTIVE_KEYWORD_BOLD = "jet_directive_keyword_bold";
- public static final String JET_EXPRESSION_BG_COLOR = "jet_expression_background";
- public static final String JET_DEFAULT_BG_COLOR = "jet_default_background";
-
- public static final String AUTO_COMPLETE_ENABLED = "autoCompleteEnable";
- public static final String AUTO_COMPLETE_DELAY = "autoCompleteDelay";
-
-
-
-
-
- /**
- * Should not be instanciated.
- *
- */
- private JETEditorPreferenceConstants() {
- }
-
- /**
- * Initialize with the default values.
- * @param store IPreferenceStore
- */
- public static void initializeDefaultValues(IPreferenceStore store) {
-
- PreferenceConstants.initializeDefaultValues(store);
- AbstractDecoratedTextEditorPreferenceConstants.initializeDefaultValues(store);
-
- PreferenceConverter.setDefault(store, JET_COMMENT_FG_COLOR, IJETColorConstants.JET_COMMENT_FG);
- store.setDefault(JET_COMMENT_BOLD, false);
- store.setDefault(JET_COMMENT_ITALIC, true);
- store.setDefault(JET_COMMENT_UNDERLINE, false);
-
- PreferenceConverter.setDefault(store, JET_CUSTOM_TAG_FG_COLOR, IJETColorConstants.JET_CUSTOM_TAG_FG);
- store.setDefault(JET_CUSTOM_TAG_BOLD, false);
- store.setDefault(JET_CUSTOM_TAG_ITALIC, false);
- store.setDefault(JET_CUSTOM_TAG_UNDERLINE, true);
-
- PreferenceConverter.setDefault(store, JET_EXPRESSION_FG_COLOR, IJETColorConstants.JET_EXPRESSION_FG);
- store.setDefault(JET_EXPRESSION_BOLD, false);
- store.setDefault(JET_EXPRESSION_ITALIC, false);
- store.setDefault(JET_EXPRESSION_UNDERLINE, false);
-
- PreferenceConverter.setDefault(store, JET_DIRECTIVE_FG_COLOR, IJETColorConstants.JET_DIRECTIVE_FG);
- store.setDefault(JET_DIRECTIVE_BOLD, false);
- store.setDefault(JET_DIRECTIVE_KEYWORD_BOLD, true);
- store.setDefault(JET_DIRECTIVE_ITALIC, false);
- store.setDefault(JET_DIRECTIVE_UNDERLINE, false);
-
- PreferenceConverter.setDefault(store, JET_SCRIPTLET_FG_COLOR, IJETColorConstants.JET_SCRIPTLET_FG);
- store.setDefault(JET_SCRIPTLET_BOLD, false);
- store.setDefault(JET_SCRIPTLET_ITALIC, true);
- store.setDefault(JET_SCRIPTLET_UNDERLINE, false);
-
- PreferenceConverter.setDefault(store, JET_DEFAULT_BG_COLOR, IJETColorConstants.JET_DEFAULT_BG);
- PreferenceConverter.setDefault(store, JET_EXPRESSION_BG_COLOR, IJETColorConstants.JET_EXPRESSION_BG);
-
- store.setDefault(AUTO_COMPLETE_ENABLED, store.getDefaultBoolean(PreferenceConstants.CODEASSIST_AUTOACTIVATION));
- store.setDefault(AUTO_COMPLETE_DELAY, store.getDefaultInt(PreferenceConstants.CODEASSIST_AUTOACTIVATION_DELAY));
- }
-
-}
diff --git a/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/configuration/JETSourceViewerConfiguration.java b/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/configuration/JETSourceViewerConfiguration.java
deleted file mode 100644
index 6ae34ef..0000000
--- a/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/configuration/JETSourceViewerConfiguration.java
+++ /dev/null
@@ -1,94 +0,0 @@
-package org.eclipse.jet.editor.configuration;
-
-import org.eclipse.jet.editor.JETTextEditor;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.ITextDoubleClickStrategy;
-import org.eclipse.jface.text.contentassist.ContentAssistant;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.jface.text.contentassist.IContentAssistant;
-import org.eclipse.jface.text.formatter.IContentFormatter;
-import org.eclipse.jface.text.formatter.IFormattingStrategy;
-import org.eclipse.jface.text.formatter.MultiPassContentFormatter;
-import org.eclipse.jface.text.presentation.IPresentationDamager;
-import org.eclipse.jface.text.presentation.IPresentationReconciler;
-import org.eclipse.jface.text.presentation.IPresentationRepairer;
-import org.eclipse.jface.text.presentation.PresentationReconciler;
-import org.eclipse.jface.text.source.ISourceViewer;
-import org.eclipse.jface.text.source.SourceViewerConfiguration;
-
-public class JETSourceViewerConfiguration extends SourceViewerConfiguration {
- private DoubleClickStrategy doubleClickStrategy;
- private JETTextEditor editor;
-
- public JETSourceViewerConfiguration(JETTextEditor editor) {
- this.editor = editor;
- }
-
- public String[] getConfiguredContentTypes(ISourceViewer sourceViewer) {
- return editor.getPartitionScanner().getContentTypes(sourceViewer);
- }
-
- public ITextDoubleClickStrategy getDoubleClickStrategy(
- ISourceViewer sourceViewer,
- String contentType) {
- if (doubleClickStrategy == null)
- doubleClickStrategy = new DoubleClickStrategy();
- return doubleClickStrategy;
- }
-
-
- public IContentAssistant getContentAssistant(ISourceViewer sourceViewer) {
- ContentAssistant assistant= new ContentAssistant();
- assistant.setDocumentPartitioning(getConfiguredDocumentPartitioning(sourceViewer));
-
- //assistant.setRestoreCompletionProposalSize(getSettings("completion_proposal_size")); //$NON-NLS-1$
-
- String[] configuredContentTypes = getConfiguredContentTypes(sourceViewer);
- for (int i = 0; i < configuredContentTypes.length; i++) {
- String contentType = configuredContentTypes[i];
- IContentAssistProcessor processor = editor.getPartitionScanner().getCompletionProcessor(contentType, assistant);
- if (processor != null)
- assistant.setContentAssistProcessor(processor, contentType);
- }
-
- assistant.setContextInformationPopupOrientation(IContentAssistant.CONTEXT_INFO_ABOVE);
- assistant.setInformationControlCreator(getInformationControlCreator(sourceViewer));
-
- assistant.enableAutoInsert(false);
- assistant.enableAutoActivation(true);
- return assistant;
- }
-
- public IContentFormatter getContentFormatter(ISourceViewer sourceViewer) {
- MultiPassContentFormatter formatter= new MultiPassContentFormatter(getConfiguredDocumentPartitioning(sourceViewer), IDocument.DEFAULT_CONTENT_TYPE);
-
- String[] configuredContentTypes = getConfiguredContentTypes(sourceViewer);
- for (int i = 0; i < configuredContentTypes.length; i++) {
- String contentType = configuredContentTypes[i];
- IFormattingStrategy strategy = editor.getPartitionScanner().getFormattingStrategy(contentType);
- if (strategy != null) {
- if (IDocument.DEFAULT_CONTENT_TYPE.equals(contentType))
- formatter.setMasterStrategy(strategy);
- else
- formatter.setSlaveStrategy(strategy, contentType);
- }
- }
- return formatter;
- }
-
- public IPresentationReconciler getPresentationReconciler(ISourceViewer sourceViewer) {
- PresentationReconciler reconciler = new PresentationReconciler();
- String[] configuredContentTypes = getConfiguredContentTypes(sourceViewer);
- for (int i = 0; i < configuredContentTypes.length; i++) {
- String contentType = configuredContentTypes[i];
- IPresentationDamager damager = editor.getPartitionScanner().getDamager(contentType);
- IPresentationRepairer repairer = editor.getPartitionScanner().getRepairer(contentType);
- if (damager != null)
- reconciler.setDamager(damager, contentType);
- if (repairer != null)
- reconciler.setRepairer(repairer, contentType);
- }
- return reconciler;
- }
-
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/configuration/JETTokenStyleManager.java b/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/configuration/JETTokenStyleManager.java
deleted file mode 100644
index 638c566..0000000
--- a/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/configuration/JETTokenStyleManager.java
+++ /dev/null
@@ -1,150 +0,0 @@
-package org.eclipse.jet.editor.configuration;
-
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
-import org.eclipse.jdt.ui.text.IColorManager;
-import org.eclipse.jdt.ui.text.IColorManagerExtension;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.preference.PreferenceConverter;
-import org.eclipse.jface.text.TextAttribute;
-import org.eclipse.jface.text.rules.IToken;
-import org.eclipse.jface.text.rules.Token;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.RGB;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.texteditor.AbstractTextEditor;
-
-public class JETTokenStyleManager implements IColorManager, IColorManagerExtension {
- private IPreferenceStore preferenceStore;
-
- protected Map colorTable = new HashMap(10);
- protected Map keyTable= new HashMap(10);
- protected Map tokenMap = new HashMap(10);
-
- public JETTokenStyleManager(IPreferenceStore store) {
- this.preferenceStore = store;
- }
- public void dispose() {
- Iterator e = colorTable.values().iterator();
- while (e.hasNext())
- ((Color) e.next()).dispose();
- }
- public Color getColor(RGB rgb) {
- Color color = (Color) colorTable.get(rgb);
- if (color == null) {
- color = new Color(Display.getCurrent(), rgb);
- colorTable.put(rgb, color);
- }
- return color;
- }
- public Color getColor(String key) {
- if (key == null)
- return null;
- RGB rgb= (RGB) keyTable.get(key);
- if (rgb == null) {
- rgb= PreferenceConverter.getColor(preferenceStore, key);
- if (rgb == null)
- return null;
- keyTable.put(key, rgb);
- }
- return getColor(rgb);
- }
-
- /*
- * @see IColorManagerExtension#bindColor(String, RGB)
- */
- public void bindColor(String key, RGB rgb) {
- Object value= keyTable.get(key);
- if (value != null)
- throw new UnsupportedOperationException();
- keyTable.put(key, rgb);
- }
-
- /*
- * @see IColorManagerExtension#unbindColor(String)
- */
- public void unbindColor(String key) {
- keyTable.remove(key);
- }
-
- public IToken getCachedToken(String id) {
- return ((IToken)tokenMap.get(id));
- }
-
- public IToken requestToken(String id,
- String fgColorKey,
- String bgColorKey,
- String boldKey,
- String italicKey,
- String strikethroughKey,
- String underlineKey) {
- if (fgColorKey != null && getColor(fgColorKey) == null) {
- RGB rgb= PreferenceConverter.getColor(preferenceStore, fgColorKey);
- unbindColor(fgColorKey);
- bindColor(fgColorKey, rgb);
- }
-
- if (bgColorKey != null && getColor(bgColorKey) == null) {
- RGB rgb= PreferenceConverter.getColor(preferenceStore, bgColorKey);
- unbindColor(bgColorKey);
- bindColor(bgColorKey, rgb);
- }
-
- Token token= ((Token)tokenMap.get(id));
- if (token == null) {
- token = new Token(createTextAttribute(fgColorKey, bgColorKey, boldKey, italicKey, strikethroughKey, underlineKey));
- tokenMap.put(id, token);
- } else {
- token.setData(createTextAttribute(fgColorKey, bgColorKey, boldKey, italicKey, strikethroughKey, underlineKey));
- }
- return token;
- }
-
- /**
- * Create a text attribute based on the given color, bold, italic, strikethrough and underline preference keys.
- *
- * @param fgColorKey the fg color preference key
- * @param bgColorKey the fg color preference key
- * @param boldKey the bold preference key
- * @param italicKey the italic preference key
- * @param strikethroughKey the strikethrough preference key
- * @param underlineKey the italic preference key
- * @return the created text attribute
- * @since 3.0
- */
- private TextAttribute createTextAttribute(String fgColorKey, String bgColorKey, String boldKey, String italicKey, String strikethroughKey, String underlineKey) {
- Color fgColor= null;
- if (fgColorKey != null)
- fgColor= getColor(fgColorKey);
- Color bgColor= null;
- if (bgColorKey != null)
- bgColor= getColor(bgColorKey);
-
- int style = (boldKey != null && preferenceStore.getBoolean(boldKey))? SWT.BOLD : SWT.NORMAL;
-
- if (italicKey != null && preferenceStore.getBoolean(italicKey))
- style |= SWT.ITALIC;
-
- if (strikethroughKey != null && preferenceStore.getBoolean(strikethroughKey))
- style |= TextAttribute.STRIKETHROUGH;
-
- if (underlineKey != null && preferenceStore.getBoolean(underlineKey))
- style |= TextAttribute.UNDERLINE;
-
- return new TextAttribute(fgColor, bgColor, style);
- }
-
- public IToken requestDefaultToken() {
- return requestToken("__jet_default_return_token",
- AbstractTextEditor.PREFERENCE_COLOR_FOREGROUND,
- JETEditorPreferenceConstants.JET_DEFAULT_BG_COLOR,
- null,
- null,
- null,
- null);
-
- }
-}
diff --git a/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/configuration/JETWhitespaceDetector.java b/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/configuration/JETWhitespaceDetector.java
deleted file mode 100644
index dba8371..0000000
--- a/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/configuration/JETWhitespaceDetector.java
+++ /dev/null
@@ -1,10 +0,0 @@
-package org.eclipse.jet.editor.configuration;
-
-import org.eclipse.jface.text.rules.IWhitespaceDetector;
-
-public class JETWhitespaceDetector implements IWhitespaceDetector {
-
- public boolean isWhitespace(char c) {
- return (c == ' ' || c == '\t' || c == '\n' || c == '\r');
- }
-}
diff --git a/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/configuration/NonRuleBasedDamagerRepairer.java b/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/configuration/NonRuleBasedDamagerRepairer.java
deleted file mode 100644
index a494ca2..0000000
--- a/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/configuration/NonRuleBasedDamagerRepairer.java
+++ /dev/null
@@ -1,138 +0,0 @@
-package org.eclipse.jet.editor.configuration;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.DocumentEvent;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.ITypedRegion;
-import org.eclipse.jface.text.Region;
-import org.eclipse.jface.text.TextAttribute;
-import org.eclipse.jface.text.TextPresentation;
-import org.eclipse.jface.text.presentation.IPresentationDamager;
-import org.eclipse.jface.text.presentation.IPresentationRepairer;
-import org.eclipse.swt.custom.StyleRange;
-
-public class NonRuleBasedDamagerRepairer
- implements IPresentationDamager, IPresentationRepairer {
-
- /** The document this object works on */
- protected IDocument fDocument;
- /** The default text attribute if non is returned as data by the current token */
- protected TextAttribute fDefaultTextAttribute;
-
- /**
- * Constructor for NonRuleBasedDamagerRepairer.
- */
- public NonRuleBasedDamagerRepairer(TextAttribute defaultTextAttribute) {
- Assert.isNotNull(defaultTextAttribute);
-
- fDefaultTextAttribute = defaultTextAttribute;
- }
-
- /**
- * @see IPresentationRepairer#setDocument(IDocument)
- */
- public void setDocument(IDocument document) {
- fDocument = document;
- }
-
- /**
- * Returns the end offset of the line that contains the specified offset or
- * if the offset is inside a line delimiter, the end offset of the next line.
- *
- * @param offset the offset whose line end offset must be computed
- * @return the line end offset for the given offset
- * @exception BadLocationException if offset is invalid in the current document
- */
- protected int endOfLineOf(int offset) throws BadLocationException {
-
- IRegion info = fDocument.getLineInformationOfOffset(offset);
- if (offset <= info.getOffset() + info.getLength())
- return info.getOffset() + info.getLength();
-
- int line = fDocument.getLineOfOffset(offset);
- try {
- info = fDocument.getLineInformation(line + 1);
- return info.getOffset() + info.getLength();
- } catch (BadLocationException x) {
- return fDocument.getLength();
- }
- }
-
- /**
- * @see IPresentationDamager#getDamageRegion(ITypedRegion, DocumentEvent, boolean)
- */
- public IRegion getDamageRegion(
- ITypedRegion partition,
- DocumentEvent event,
- boolean documentPartitioningChanged) {
- if (!documentPartitioningChanged) {
- try {
-
- IRegion info =
- fDocument.getLineInformationOfOffset(event.getOffset());
- int start = Math.max(partition.getOffset(), info.getOffset());
-
- int end =
- event.getOffset()
- + (event.getText() == null
- ? event.getLength()
- : event.getText().length());
-
- if (info.getOffset() <= end
- && end <= info.getOffset() + info.getLength()) {
- // optimize the case of the same line
- end = info.getOffset() + info.getLength();
- } else
- end = endOfLineOf(end);
-
- end =
- Math.min(
- partition.getOffset() + partition.getLength(),
- end);
- return new Region(start, end - start);
-
- } catch (BadLocationException x) {
- }
- }
-
- return partition;
- }
-
- /**
- * @see IPresentationRepairer#createPresentation(TextPresentation, ITypedRegion)
- */
- public void createPresentation(
- TextPresentation presentation,
- ITypedRegion region) {
- addRange(
- presentation,
- region.getOffset(),
- region.getLength(),
- fDefaultTextAttribute);
- }
-
- /**
- * Adds style information to the given text presentation.
- *
- * @param presentation the text presentation to be extended
- * @param offset the offset of the range to be styled
- * @param length the length of the range to be styled
- * @param attr the attribute describing the style of the range to be styled
- */
- protected void addRange(
- TextPresentation presentation,
- int offset,
- int length,
- TextAttribute attr) {
- if (attr != null)
- presentation.addStyleRange(
- new StyleRange(
- offset,
- length,
- attr.getForeground(),
- attr.getBackground(),
- attr.getStyle()));
- }
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/configuration/delegates/AbstractJETTextPartitionConfigurationDelegate.java b/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/configuration/delegates/AbstractJETTextPartitionConfigurationDelegate.java
deleted file mode 100644
index 2f8f058..0000000
--- a/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/configuration/delegates/AbstractJETTextPartitionConfigurationDelegate.java
+++ /dev/null
@@ -1,38 +0,0 @@
-package org.eclipse.jet.editor.configuration.delegates;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.jface.text.presentation.IPresentationDamager;
-import org.eclipse.jface.text.presentation.IPresentationRepairer;
-import org.eclipse.jface.text.rules.DefaultDamagerRepairer;
-import org.eclipse.jface.text.rules.ITokenScanner;
-import org.eclipse.ui.IEditorInput;
-
-public abstract class AbstractJETTextPartitionConfigurationDelegate implements IJETTextPartitionConfigurationDelegate {
-
- private Map defaultDamagerRepairers = new HashMap();
-
- public IPresentationDamager getDamager(String contentType) {
- DefaultDamagerRepairer dr = (DefaultDamagerRepairer) defaultDamagerRepairers.get(contentType);
- ITokenScanner tokenScanner = getTokenScanner(contentType);
- if (dr == null && tokenScanner != null) {
- dr = new DefaultDamagerRepairer(tokenScanner);
- }
- return dr;
- }
-
- public IPresentationRepairer getRepairer(String contentType) {
- DefaultDamagerRepairer dr = (DefaultDamagerRepairer) defaultDamagerRepairers.get(contentType);
- ITokenScanner tokenScanner = getTokenScanner(contentType);
- if (dr == null && tokenScanner != null) {
- dr = new DefaultDamagerRepairer(tokenScanner);
- }
- return dr;
- }
-
- public boolean isActiveFor(IEditorInput editorInput) {
- return true;
- }
-
-}
diff --git a/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/configuration/delegates/IJETTextPartitionConfigurationDelegate.java b/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/configuration/delegates/IJETTextPartitionConfigurationDelegate.java
deleted file mode 100644
index 63e34e3..0000000
--- a/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/configuration/delegates/IJETTextPartitionConfigurationDelegate.java
+++ /dev/null
@@ -1,24 +0,0 @@
-package org.eclipse.jet.editor.configuration.delegates;
-
-import org.eclipse.jface.text.contentassist.ContentAssistant;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.jface.text.formatter.IFormattingStrategy;
-import org.eclipse.jface.text.presentation.IPresentationDamager;
-import org.eclipse.jface.text.presentation.IPresentationRepairer;
-import org.eclipse.jface.text.rules.IPredicateRule;
-import org.eclipse.jface.text.rules.ITokenScanner;
-import org.eclipse.jface.text.source.ISourceViewer;
-import org.eclipse.ui.IEditorInput;
-
-public interface IJETTextPartitionConfigurationDelegate {
- boolean isActiveFor(IEditorInput editorInput);
-
- String[] getContentTypes(ISourceViewer sourceViewer);
- IPredicateRule[] getPartitioningRules();
-
- IPresentationDamager getDamager(String contentType);
- IPresentationRepairer getRepairer(String contentType);
- IContentAssistProcessor getContentAssistProcessor(String contentType, ContentAssistant assistant);
- IFormattingStrategy getFormattingStrategy(String contentType);
- ITokenScanner getTokenScanner(String contentType);
-}
diff --git a/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/configuration/delegates/JavaContentPartitionConfigurationDelegate.java b/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/configuration/delegates/JavaContentPartitionConfigurationDelegate.java
deleted file mode 100644
index fac5832..0000000
--- a/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/configuration/delegates/JavaContentPartitionConfigurationDelegate.java
+++ /dev/null
@@ -1,249 +0,0 @@
-package org.eclipse.jet.editor.configuration.delegates;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jdt.internal.ui.text.comment.CommentFormattingStrategy;
-import org.eclipse.jdt.internal.ui.text.java.JavaCompletionProcessor;
-import org.eclipse.jdt.internal.ui.text.java.JavaFormattingStrategy;
-import org.eclipse.jdt.internal.ui.text.javadoc.JavadocCompletionProcessor;
-import org.eclipse.jdt.ui.JavaUI;
-import org.eclipse.jdt.ui.text.IJavaPartitions;
-import org.eclipse.jdt.ui.text.JavaSourceViewerConfiguration;
-import org.eclipse.jet.editor.JETTextEditor;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.contentassist.ContentAssistant;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.jface.text.formatter.IFormattingStrategy;
-import org.eclipse.jface.text.rules.EndOfLineRule;
-import org.eclipse.jface.text.rules.ICharacterScanner;
-import org.eclipse.jface.text.rules.IPredicateRule;
-import org.eclipse.jface.text.rules.IToken;
-import org.eclipse.jface.text.rules.ITokenScanner;
-import org.eclipse.jface.text.rules.IWordDetector;
-import org.eclipse.jface.text.rules.MultiLineRule;
-import org.eclipse.jface.text.rules.RuleBasedScanner;
-import org.eclipse.jface.text.rules.SingleLineRule;
-import org.eclipse.jface.text.rules.Token;
-import org.eclipse.jface.text.rules.WordRule;
-import org.eclipse.jface.text.source.ISourceViewer;
-
-public class JavaContentPartitionConfigurationDelegate extends AbstractJETTextPartitionConfigurationDelegate {
- private JETJavaSourceViewerConfiguration javaConfiguration;
-
- public JavaContentPartitionConfigurationDelegate(JETTextEditor editor) {
- javaConfiguration = new JETJavaSourceViewerConfiguration(editor);
- }
-
- public String[] getContentTypes(ISourceViewer sourceViewer) {
- return new String[] {
- IDocument.DEFAULT_CONTENT_TYPE,
- IJavaPartitions.JAVA_DOC,
- IJavaPartitions.JAVA_MULTI_LINE_COMMENT,
- IJavaPartitions.JAVA_SINGLE_LINE_COMMENT,
- IJavaPartitions.JAVA_STRING,
- IJavaPartitions.JAVA_CHARACTER
- };
- }
-
- public IPredicateRule[] getPartitioningRules() {
- IToken string= new Token(IJavaPartitions.JAVA_STRING);
- IToken character= new Token(IJavaPartitions.JAVA_CHARACTER);
- IToken javaDoc= new Token(IJavaPartitions.JAVA_DOC);
- IToken multiLineComment= new Token(IJavaPartitions.JAVA_MULTI_LINE_COMMENT);
- IToken singleLineComment= new Token(IJavaPartitions.JAVA_SINGLE_LINE_COMMENT);
-
- List rules= new ArrayList();
-
- // Add rule for single line comments.
- rules.add(new EndOfLineRule("//", singleLineComment)); //$NON-NLS-1$
-
- // Add rule for strings.
- rules.add(new SingleLineRule("\"", "\"", string, '\\')); //$NON-NLS-2$ //$NON-NLS-1$
-
- // Add rule for character constants.
- rules.add(new SingleLineRule("'", "'", character, '\\')); //$NON-NLS-2$ //$NON-NLS-1$
-
- // Add special case word rule.
- EmptyCommentRule wordRule= new EmptyCommentRule(multiLineComment);
- rules.add(wordRule);
-
- // Add rules for multi-line comments and javadoc.
- rules.add(new MultiLineRule("/**", "*/", javaDoc)); //$NON-NLS-1$ //$NON-NLS-2$
- rules.add(new MultiLineRule("/*", "*/", multiLineComment)); //$NON-NLS-1$ //$NON-NLS-2$
-
- IPredicateRule[] result= new IPredicateRule[rules.size()];
- rules.toArray(result);
- return result;
- }
-
- public ITokenScanner getTokenScanner(String contentType) {
- if (IDocument.DEFAULT_CONTENT_TYPE.equals(contentType))
- return javaConfiguration.getCodeScanner();
- if (IJavaPartitions.JAVA_DOC.equals(contentType))
- return javaConfiguration.getJavaDocScanner();
- if (IJavaPartitions.JAVA_MULTI_LINE_COMMENT.equals(contentType))
- return javaConfiguration.getMultilineCommentScanner();
- if (IJavaPartitions.JAVA_SINGLE_LINE_COMMENT.equals(contentType))
- return javaConfiguration.getSinglelineCommentScanner();
- if (IJavaPartitions.JAVA_STRING.equals(contentType))
- return javaConfiguration.getStringScanner();
- if (IJavaPartitions.JAVA_CHARACTER.equals(contentType))
- return javaConfiguration.getStringScanner();
- return javaConfiguration.getCodeScanner();
- }
-
- public IContentAssistProcessor getContentAssistProcessor(String contentType, ContentAssistant assistant) {
- if (IDocument.DEFAULT_CONTENT_TYPE.equals(contentType))
- return javaConfiguration.getCodeAssistProcessor(assistant);
- if (IJavaPartitions.JAVA_DOC.equals(contentType))
- return javaConfiguration.getJavaDocAssistProcessor(assistant);
- if (IJavaPartitions.JAVA_MULTI_LINE_COMMENT.equals(contentType))
- return javaConfiguration.getMultilineCommentAssistProcessor(assistant);
- if (IJavaPartitions.JAVA_SINGLE_LINE_COMMENT.equals(contentType))
- return javaConfiguration.getSinglelineCommentAssistProcessor(assistant);
- if (IJavaPartitions.JAVA_STRING.equals(contentType))
- return javaConfiguration.getStringAssistProcessor(assistant);
- if (IJavaPartitions.JAVA_CHARACTER.equals(contentType))
- return javaConfiguration.getStringAssistProcessor(assistant);
- return null;
- }
-
- public IFormattingStrategy getFormattingStrategy(String contentType) {
- if (IDocument.DEFAULT_CONTENT_TYPE.equals(contentType))
- return javaConfiguration.getCodeFormattingStrategy();
- if (IJavaPartitions.JAVA_DOC.equals(contentType))
- return javaConfiguration.getJavaDocFormattingStrategy();
- if (IJavaPartitions.JAVA_MULTI_LINE_COMMENT.equals(contentType))
- return javaConfiguration.getMultilineCommentFormattingStrategy();
- if (IJavaPartitions.JAVA_SINGLE_LINE_COMMENT.equals(contentType))
- return javaConfiguration.getSinglelineCommentFormattingStrategy();
- return null;
- }
-
- private class JETJavaSourceViewerConfiguration extends JavaSourceViewerConfiguration {
- public JETJavaSourceViewerConfiguration(JETTextEditor editor) {
- super(JavaUI.getColorManager(), editor.getEditorPreferenceStore(), editor, null);
- }
-
- public IFormattingStrategy getSinglelineCommentFormattingStrategy() {
- IFormattingStrategy strategy = new CommentFormattingStrategy();
- return strategy;
- }
-
- public IFormattingStrategy getMultilineCommentFormattingStrategy() {
- IFormattingStrategy strategy = new CommentFormattingStrategy();
- return strategy;
- }
-
- public IFormattingStrategy getJavaDocFormattingStrategy() {
- IFormattingStrategy strategy = new CommentFormattingStrategy();
- return strategy;
- }
-
- public IFormattingStrategy getCodeFormattingStrategy() {
- IFormattingStrategy strategy = new JavaFormattingStrategy();
- return strategy;
- }
-
- public IContentAssistProcessor getStringAssistProcessor(ContentAssistant assistant) {
- IContentAssistProcessor stringProcessor= new JavaCompletionProcessor(getEditor(), assistant, IJavaPartitions.JAVA_STRING);
- return stringProcessor;
- }
-
- public IContentAssistProcessor getSinglelineCommentAssistProcessor(ContentAssistant assistant) {
- IContentAssistProcessor singleLineProcessor= new JavaCompletionProcessor(getEditor(), assistant, IJavaPartitions.JAVA_SINGLE_LINE_COMMENT);
- return singleLineProcessor;
- }
-
- public IContentAssistProcessor getMultilineCommentAssistProcessor(ContentAssistant assistant) {
- IContentAssistProcessor multiLineProcessor= new JavaCompletionProcessor(getEditor(), assistant, IJavaPartitions.JAVA_MULTI_LINE_COMMENT);
- return multiLineProcessor;
- }
-
- public IContentAssistProcessor getJavaDocAssistProcessor(ContentAssistant assistant) {
- IContentAssistProcessor javadocProcessor= new JavadocCompletionProcessor(getEditor(), assistant);
- return javadocProcessor;
- }
-
- public IContentAssistProcessor getCodeAssistProcessor(ContentAssistant assistant) {
- IContentAssistProcessor javaProcessor= new JavaCompletionProcessor(getEditor(), assistant, IDocument.DEFAULT_CONTENT_TYPE);
- return javaProcessor;
- }
-
- public RuleBasedScanner getCodeScanner() {
- return super.getCodeScanner();
- };
-
- public RuleBasedScanner getMultilineCommentScanner() {
- return super.getMultilineCommentScanner();
- }
-
- public RuleBasedScanner getSinglelineCommentScanner() {
- return super.getSinglelineCommentScanner();
- }
-
- public RuleBasedScanner getStringScanner() {
- return super.getStringScanner();
- }
-
- public RuleBasedScanner getJavaDocScanner() {
- return super.getJavaDocScanner();
- }
- }
-
- /**
- * Detector for empty comments.
- */
- static class EmptyCommentDetector implements IWordDetector {
-
- /*
- * @see IWordDetector#isWordStart
- */
- public boolean isWordStart(char c) {
- return (c == '/');
- }
-
- /*
- * @see IWordDetector#isWordPart
- */
- public boolean isWordPart(char c) {
- return (c == '*' || c == '/');
- }
- }
-
-
- /**
- * Word rule for empty comments.
- */
- static class EmptyCommentRule extends WordRule implements IPredicateRule {
-
- private IToken fSuccessToken;
- /**
- * Constructor for EmptyCommentRule.
- * @param successToken
- */
- public EmptyCommentRule(IToken successToken) {
- super(new EmptyCommentDetector());
- fSuccessToken= successToken;
- addWord("/**/", fSuccessToken); //$NON-NLS-1$
- }
-
- /*
- * @see IPredicateRule#evaluate(ICharacterScanner, boolean)
- */
- public IToken evaluate(ICharacterScanner scanner, boolean resume) {
- return evaluate(scanner);
- }
-
- /*
- * @see IPredicateRule#getSuccessToken()
- */
- public IToken getSuccessToken() {
- return fSuccessToken;
- }
- }
-
-
-
-}
diff --git a/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/contentassist/AbstractJETAssistProcessor.java b/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/contentassist/AbstractJETAssistProcessor.java
deleted file mode 100644
index f79aee8..0000000
--- a/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/contentassist/AbstractJETAssistProcessor.java
+++ /dev/null
@@ -1,17 +0,0 @@
-package org.eclipse.jet.editor.contentassist;
-
-import org.eclipse.jet.editor.JETTextEditor;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-
-public abstract class AbstractJETAssistProcessor implements IContentAssistProcessor {
- protected JETTextEditor editor;
- public AbstractJETAssistProcessor(JETTextEditor editor) {
- this.editor = editor;
- }
-
- public String getErrorMessage() {
- // TODO Auto-generated method stub
- return null;
- }
-
-}
diff --git a/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/contentassist/JETCustomTagAssistProcessor.java b/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/contentassist/JETCustomTagAssistProcessor.java
deleted file mode 100644
index ffb654b..0000000
--- a/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/contentassist/JETCustomTagAssistProcessor.java
+++ /dev/null
@@ -1,45 +0,0 @@
-package org.eclipse.jet.editor.contentassist;
-
-import org.eclipse.jet.editor.JETTextEditor;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.jface.text.contentassist.IContextInformation;
-import org.eclipse.jface.text.contentassist.IContextInformationValidator;
-
-public class JETCustomTagAssistProcessor extends AbstractJETAssistProcessor {
-
- public JETCustomTagAssistProcessor(JETTextEditor editor) {
- super(editor);
- }
-
- public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer, int offset) {
- // TODO Auto-generated method stub
- return null;
- }
-
- public IContextInformation[] computeContextInformation(ITextViewer viewer, int offset) {
- // TODO Auto-generated method stub
- return null;
- }
-
- public char[] getCompletionProposalAutoActivationCharacters() {
- // TODO Auto-generated method stub
- return null;
- }
-
- public char[] getContextInformationAutoActivationCharacters() {
- // TODO Auto-generated method stub
- return null;
- }
-
- public IContextInformationValidator getContextInformationValidator() {
- // TODO Auto-generated method stub
- return null;
- }
-
- public String getErrorMessage() {
- // TODO Auto-generated method stub
- return null;
- }
-
-}
diff --git a/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/contentassist/JETDirectiveAssistProcessor.java b/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/contentassist/JETDirectiveAssistProcessor.java
deleted file mode 100644
index 642cbf7..0000000
--- a/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/contentassist/JETDirectiveAssistProcessor.java
+++ /dev/null
@@ -1,45 +0,0 @@
-package org.eclipse.jet.editor.contentassist;
-
-import org.eclipse.jet.editor.JETTextEditor;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.jface.text.contentassist.IContextInformation;
-import org.eclipse.jface.text.contentassist.IContextInformationValidator;
-
-public class JETDirectiveAssistProcessor extends AbstractJETAssistProcessor {
-
- public JETDirectiveAssistProcessor(JETTextEditor editor) {
- super(editor);
- }
-
- public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer, int offset) {
- // TODO Auto-generated method stub
- return null;
- }
-
- public IContextInformation[] computeContextInformation(ITextViewer viewer, int offset) {
- // TODO Auto-generated method stub
- return null;
- }
-
- public char[] getCompletionProposalAutoActivationCharacters() {
- // TODO Auto-generated method stub
- return null;
- }
-
- public char[] getContextInformationAutoActivationCharacters() {
- // TODO Auto-generated method stub
- return null;
- }
-
- public IContextInformationValidator getContextInformationValidator() {
- // TODO Auto-generated method stub
- return null;
- }
-
- public String getErrorMessage() {
- // TODO Auto-generated method stub
- return null;
- }
-
-}
diff --git a/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/contentassist/JETJavaDeclarationAssistProcessor.java b/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/contentassist/JETJavaDeclarationAssistProcessor.java
deleted file mode 100644
index 8abf132..0000000
--- a/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/contentassist/JETJavaDeclarationAssistProcessor.java
+++ /dev/null
@@ -1,63 +0,0 @@
-package org.eclipse.jet.editor.contentassist;
-
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.ui.PreferenceConstants;
-import org.eclipse.jdt.ui.text.java.IJavaCompletionProposal;
-import org.eclipse.jet.compiler.JET2CompilationUnit;
-import org.eclipse.jet.compiler.JET2Declaration;
-import org.eclipse.jet.editor.JETEditorHelper;
-import org.eclipse.jet.editor.JETTextEditor;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.jface.text.contentassist.IContextInformation;
-import org.eclipse.jface.text.contentassist.IContextInformationValidator;
-
-public class JETJavaDeclarationAssistProcessor extends AbstractJETAssistProcessor {
- private char[] completionProposalAutoActivationCharacters;
- public JETJavaDeclarationAssistProcessor(JETTextEditor editor) {
- super(editor);
- completionProposalAutoActivationCharacters = editor.getEditorPreferenceStore().getString(PreferenceConstants.CODEASSIST_AUTOACTIVATION_TRIGGERS_JAVA).toCharArray();
- }
-
- public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer, int offset) {
- JET2CompilationUnit cu = editor.requestCompilationUnit();
- JET2Declaration declaration = (JET2Declaration) JETEditorHelper.getASTElementAt(cu, offset);
-
- int jetStart = declaration.getStart() + 3; // 3 = "<%!" length
-
- IJavaProject javaProject = editor.getJETJavaProject();
- if (javaProject != null && javaProject.isOpen()) {
- int javaOffset = offset - jetStart;
- String javaContent = declaration.getJavaContent();
- IJavaCompletionProposal[] javaCompletionProposals = JETEditorHelper.getJavaCompletionProposal(javaProject, cu, javaContent, viewer, javaOffset);
- JETEditorHelper.adjustResults(javaCompletionProposals, offset);
- return javaCompletionProposals;
- }
- return null;
- }
-
- public IContextInformation[] computeContextInformation(ITextViewer viewer, int offset) {
- // TODO Auto-generated method stub
- return null;
- }
-
- public char[] getCompletionProposalAutoActivationCharacters() {
- return completionProposalAutoActivationCharacters;
- }
-
- public char[] getContextInformationAutoActivationCharacters() {
- // TODO Auto-generated method stub
- return null;
- }
-
- public IContextInformationValidator getContextInformationValidator() {
- // TODO Auto-generated method stub
- return null;
- }
-
- public String getErrorMessage() {
- // TODO Auto-generated method stub
- return null;
- }
-
-}
diff --git a/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/contentassist/JETJavaExpressionAssistProcessor.java b/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/contentassist/JETJavaExpressionAssistProcessor.java
deleted file mode 100644
index e91cdb4..0000000
--- a/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/contentassist/JETJavaExpressionAssistProcessor.java
+++ /dev/null
@@ -1,101 +0,0 @@
-package org.eclipse.jet.editor.contentassist;
-
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.ui.PreferenceConstants;
-import org.eclipse.jdt.ui.text.java.IJavaCompletionProposal;
-import org.eclipse.jet.compiler.JET2CompilationUnit;
-import org.eclipse.jet.compiler.JET2Expression;
-import org.eclipse.jet.editor.JETEditorHelper;
-import org.eclipse.jet.editor.JETTextEditor;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.jface.text.contentassist.IContextInformation;
-import org.eclipse.jface.text.contentassist.IContextInformationValidator;
-
-public class JETJavaExpressionAssistProcessor extends AbstractJETAssistProcessor {
-
- private char[] completionProposalAutoActivationCharacters;
-
- public JETJavaExpressionAssistProcessor(JETTextEditor editor) {
- super(editor);
- completionProposalAutoActivationCharacters = editor.getEditorPreferenceStore().getString(
- PreferenceConstants.CODEASSIST_AUTOACTIVATION_TRIGGERS_JAVA).toCharArray();
- }
-
- public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer, int offset) {
- JET2CompilationUnit cu = editor.requestCompilationUnit();
- JET2Expression expression = (JET2Expression) JETEditorHelper.getASTElementAt(cu, offset);
-
- int jetStart = expression.getStart();// + 3; // 3 = "<%=" length
- // Look for the start of the first non null character
- try {
- while (viewer.getDocument().getChar(jetStart) == '<' ||
- viewer.getDocument().getChar(jetStart) == '%' ||
- viewer.getDocument().getChar(jetStart) == '=' ||
- viewer.getDocument().getChar(jetStart) == ' ' ||
- viewer.getDocument().getChar(jetStart) == '\t' ||
- viewer.getDocument().getChar(jetStart) == '\r' ||
- viewer.getDocument().getChar(jetStart) == '\n')
- jetStart++;
- } catch (BadLocationException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
-// try {
-// System.out.println(" JET Text at offset : " + viewer.getDocument().get(offset, 50));
-// } catch (BadLocationException e) {
-// // TODO Auto-generated catch block
-// e.printStackTrace();
-// }
-// Map mappedPositions = new HashMap();
-// String javaSource = JETEditorHelper.computeJavaSource(cu, mappedPositions);
-
- IJavaProject javaProject = editor.getJETJavaProject();
- if (javaProject != null && javaProject.isOpen()) {
- String declarationsSource = JETEditorHelper.getDeclarationsSourceCode(cu);
- String bodyMethodDecl = "public void generate(final JET2Context context, JET2Writer out) {\r\n" ;
- String previousJavaBodyContent = JETEditorHelper.getPreviousGeneratedJavaSource(javaProject, cu, expression);
- String writeStr = "out.write(";
- String expBody = "out.write(" + expression.getJavaContent().trim() + ");";
-
- String javaContent = declarationsSource + bodyMethodDecl + previousJavaBodyContent + expBody;
- int javaOffset = (offset - jetStart) + declarationsSource.length() + bodyMethodDecl.length() + previousJavaBodyContent.length() + writeStr.length();
-
- //System.out.println(" Java Text at offset : " + javaContent.substring(javaOffset, javaOffset + 50));
-
- IJavaCompletionProposal[] javaCompletionProposals = JETEditorHelper.getJavaCompletionProposal(javaProject, cu,
- javaContent, viewer, javaOffset);
- JETEditorHelper.adjustResults(javaCompletionProposals, offset);
- return javaCompletionProposals;
- }
- return null;
- }
-
-
-
- public IContextInformation[] computeContextInformation(ITextViewer viewer, int offset) {
- // TODO Auto-generated method stub
- return null;
- }
-
- public char[] getCompletionProposalAutoActivationCharacters() {
- return completionProposalAutoActivationCharacters;
- }
-
- public char[] getContextInformationAutoActivationCharacters() {
- // TODO Auto-generated method stub
- return null;
- }
-
- public IContextInformationValidator getContextInformationValidator() {
- // TODO Auto-generated method stub
- return null;
- }
-
- public String getErrorMessage() {
- // TODO Auto-generated method stub
- return null;
- }
-
-}
diff --git a/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/contentassist/JETJavaScriptletAssistProcessor.java b/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/contentassist/JETJavaScriptletAssistProcessor.java
deleted file mode 100644
index fee9b38..0000000
--- a/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/contentassist/JETJavaScriptletAssistProcessor.java
+++ /dev/null
@@ -1,98 +0,0 @@
-package org.eclipse.jet.editor.contentassist;
-
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.ui.PreferenceConstants;
-import org.eclipse.jdt.ui.text.java.IJavaCompletionProposal;
-import org.eclipse.jet.compiler.JET2CompilationUnit;
-import org.eclipse.jet.compiler.JET2Scriptlet;
-import org.eclipse.jet.editor.JETEditorHelper;
-import org.eclipse.jet.editor.JETTextEditor;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.jface.text.contentassist.IContextInformation;
-import org.eclipse.jface.text.contentassist.IContextInformationValidator;
-
-public class JETJavaScriptletAssistProcessor extends AbstractJETAssistProcessor {
-
- private char[] completionProposalAutoActivationCharacters;
-
- public JETJavaScriptletAssistProcessor(JETTextEditor editor) {
- super(editor);
- completionProposalAutoActivationCharacters = editor.getEditorPreferenceStore().getString(
- PreferenceConstants.CODEASSIST_AUTOACTIVATION_TRIGGERS_JAVA).toCharArray();
- }
-
- public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer, int offset) {
- JET2CompilationUnit cu = editor.requestCompilationUnit();
- JET2Scriptlet scriptlet = (JET2Scriptlet) JETEditorHelper.getASTElementAt(cu, offset);
-
- int jetStart = scriptlet.getStart();// + 2; // 2 = "<%" length
- // Look for the start of the first non null character
- try {
- while (viewer.getDocument().getChar(jetStart) == '<' ||
- viewer.getDocument().getChar(jetStart) == '%' ||
- viewer.getDocument().getChar(jetStart) == ' ' ||
- viewer.getDocument().getChar(jetStart) == '\t' ||
- viewer.getDocument().getChar(jetStart) == '\r' ||
- viewer.getDocument().getChar(jetStart) == '\n')
- jetStart++;
- } catch (BadLocationException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
-// try {
-// System.out.println(" JET Text at offset : " + viewer.getDocument().get(offset, 50));
-// } catch (BadLocationException e) {
-// // TODO Auto-generated catch block
-// e.printStackTrace();
-// }
-// Map mappedPositions = new HashMap();
-// String javaSource = JETEditorHelper.computeJavaSource(cu, mappedPositions);
-
- IJavaProject javaProject = editor.getJETJavaProject();
- if (javaProject != null && javaProject.isOpen()) {
- String declarationsSource = JETEditorHelper.getDeclarationsSourceCode(cu);
- String bodyMethodDecl = "public void generate(final JET2Context context, JET2Writer out) {\r\n" ;
- String previousJavaBodyContent = JETEditorHelper.getPreviousGeneratedJavaSource(javaProject, cu, scriptlet);
-
- String scriptletBody = scriptlet.getJavaContent().trim();
-
- String javaContent = declarationsSource + bodyMethodDecl + previousJavaBodyContent + scriptletBody;
- int javaOffset = (offset - jetStart) + declarationsSource.length() + bodyMethodDecl.length() + previousJavaBodyContent.length();
-
- //System.out.println(" Java Text at offset : " + javaContent.substring(javaOffset, javaOffset + 50));
-
- IJavaCompletionProposal[] javaCompletionProposals = JETEditorHelper.getJavaCompletionProposal(javaProject, cu,
- javaContent, viewer, javaOffset);
- JETEditorHelper.adjustResults(javaCompletionProposals, offset);
- return javaCompletionProposals;
- }
- return null;
- }
-
- public IContextInformation[] computeContextInformation(ITextViewer viewer, int offset) {
- // TODO Auto-generated method stub
- return null;
- }
-
- public char[] getCompletionProposalAutoActivationCharacters() {
- return completionProposalAutoActivationCharacters;
- }
-
- public char[] getContextInformationAutoActivationCharacters() {
- // TODO Auto-generated method stub
- return null;
- }
-
- public IContextInformationValidator getContextInformationValidator() {
- // TODO Auto-generated method stub
- return null;
- }
-
- public String getErrorMessage() {
- // TODO Auto-generated method stub
- return null;
- }
-
-}
diff --git a/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/contentassist/JETTagAssistProcessor.java b/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/contentassist/JETTagAssistProcessor.java
deleted file mode 100644
index d242a7d..0000000
--- a/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/contentassist/JETTagAssistProcessor.java
+++ /dev/null
@@ -1,47 +0,0 @@
-package org.eclipse.jet.editor.contentassist;
-
-import org.eclipse.jet.editor.JETTextEditor;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.jface.text.contentassist.IContextInformation;
-import org.eclipse.jface.text.contentassist.IContextInformationValidator;
-
-
-public class JETTagAssistProcessor extends AbstractJETAssistProcessor {
-
- public JETTagAssistProcessor(JETTextEditor editor) {
- super(editor);
- // TODO Auto-generated constructor stub
- }
-
- public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer, int offset) {
- // TODO Auto-generated method stub
- return null;
- }
-
- public IContextInformation[] computeContextInformation(ITextViewer viewer, int offset) {
- // TODO Auto-generated method stub
- return null;
- }
-
- public char[] getCompletionProposalAutoActivationCharacters() {
- // TODO Auto-generated method stub
- return null;
- }
-
- public char[] getContextInformationAutoActivationCharacters() {
- // TODO Auto-generated method stub
- return null;
- }
-
- public IContextInformationValidator getContextInformationValidator() {
- // TODO Auto-generated method stub
- return null;
- }
-
- public String getErrorMessage() {
- // TODO Auto-generated method stub
- return null;
- }
-
-}
diff --git a/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/formatter/JETCustomTagFormattingStrategy.java b/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/formatter/JETCustomTagFormattingStrategy.java
deleted file mode 100644
index b9b7178..0000000
--- a/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/formatter/JETCustomTagFormattingStrategy.java
+++ /dev/null
@@ -1,34 +0,0 @@
-package org.eclipse.jet.editor.formatter;
-
-import org.eclipse.jface.text.formatter.IFormattingContext;
-import org.eclipse.jface.text.formatter.IFormattingStrategy;
-import org.eclipse.jface.text.formatter.IFormattingStrategyExtension;
-
-public class JETCustomTagFormattingStrategy implements IFormattingStrategy, IFormattingStrategyExtension {
-
- public String format(String content, boolean isLineStart, String indentation, int[] positions) {
- // TODO Auto-generated method stub
- return null;
- }
-
- public void formatterStarts(String initialIndentation) {
- // TODO Auto-generated method stub
-
- }
-
- public void formatterStops() {
- // TODO Auto-generated method stub
-
- }
-
- public void format() {
- // TODO Auto-generated method stub
-
- }
-
- public void formatterStarts(IFormattingContext context) {
- // TODO Auto-generated method stub
-
- }
-
-}
diff --git a/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/formatter/JETDirectiveFormattingStrategy.java b/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/formatter/JETDirectiveFormattingStrategy.java
deleted file mode 100644
index 990a8d3..0000000
--- a/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/formatter/JETDirectiveFormattingStrategy.java
+++ /dev/null
@@ -1,34 +0,0 @@
-package org.eclipse.jet.editor.formatter;
-
-import org.eclipse.jface.text.formatter.IFormattingContext;
-import org.eclipse.jface.text.formatter.IFormattingStrategy;
-import org.eclipse.jface.text.formatter.IFormattingStrategyExtension;
-
-public class JETDirectiveFormattingStrategy implements IFormattingStrategy, IFormattingStrategyExtension {
-
- public String format(String content, boolean isLineStart, String indentation, int[] positions) {
- // TODO Auto-generated method stub
- return null;
- }
-
- public void formatterStarts(String initialIndentation) {
- // TODO Auto-generated method stub
-
- }
-
- public void formatterStops() {
- // TODO Auto-generated method stub
-
- }
-
- public void format() {
- // TODO Auto-generated method stub
-
- }
-
- public void formatterStarts(IFormattingContext context) {
- // TODO Auto-generated method stub
-
- }
-
-}
diff --git a/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/formatter/JETJavaDeclarationFormattingStrategy.java b/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/formatter/JETJavaDeclarationFormattingStrategy.java
deleted file mode 100644
index 62d8a24..0000000
--- a/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/formatter/JETJavaDeclarationFormattingStrategy.java
+++ /dev/null
@@ -1,34 +0,0 @@
-package org.eclipse.jet.editor.formatter;
-
-import org.eclipse.jface.text.formatter.IFormattingContext;
-import org.eclipse.jface.text.formatter.IFormattingStrategy;
-import org.eclipse.jface.text.formatter.IFormattingStrategyExtension;
-
-public class JETJavaDeclarationFormattingStrategy implements IFormattingStrategy, IFormattingStrategyExtension {
-
- public String format(String content, boolean isLineStart, String indentation, int[] positions) {
- // TODO Auto-generated method stub
- return null;
- }
-
- public void formatterStarts(String initialIndentation) {
- // TODO Auto-generated method stub
-
- }
-
- public void formatterStops() {
- // TODO Auto-generated method stub
-
- }
-
- public void format() {
- // TODO Auto-generated method stub
-
- }
-
- public void formatterStarts(IFormattingContext context) {
- // TODO Auto-generated method stub
-
- }
-
-}
diff --git a/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/formatter/JETJavaExpressionFormattingStrategy.java b/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/formatter/JETJavaExpressionFormattingStrategy.java
deleted file mode 100644
index cab496e..0000000
--- a/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/formatter/JETJavaExpressionFormattingStrategy.java
+++ /dev/null
@@ -1,34 +0,0 @@
-package org.eclipse.jet.editor.formatter;
-
-import org.eclipse.jface.text.formatter.IFormattingContext;
-import org.eclipse.jface.text.formatter.IFormattingStrategy;
-import org.eclipse.jface.text.formatter.IFormattingStrategyExtension;
-
-public class JETJavaExpressionFormattingStrategy implements IFormattingStrategy, IFormattingStrategyExtension {
-
- public String format(String content, boolean isLineStart, String indentation, int[] positions) {
- // TODO Auto-generated method stub
- return null;
- }
-
- public void formatterStarts(String initialIndentation) {
- // TODO Auto-generated method stub
-
- }
-
- public void formatterStops() {
- // TODO Auto-generated method stub
-
- }
-
- public void format() {
- // TODO Auto-generated method stub
-
- }
-
- public void formatterStarts(IFormattingContext context) {
- // TODO Auto-generated method stub
-
- }
-
-}
diff --git a/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/formatter/JETJavaScriptletFormattingStrategy.java b/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/formatter/JETJavaScriptletFormattingStrategy.java
deleted file mode 100644
index 3103c4b..0000000
--- a/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/formatter/JETJavaScriptletFormattingStrategy.java
+++ /dev/null
@@ -1,34 +0,0 @@
-package org.eclipse.jet.editor.formatter;
-
-import org.eclipse.jface.text.formatter.IFormattingContext;
-import org.eclipse.jface.text.formatter.IFormattingStrategy;
-import org.eclipse.jface.text.formatter.IFormattingStrategyExtension;
-
-public class JETJavaScriptletFormattingStrategy implements IFormattingStrategy, IFormattingStrategyExtension {
-
- public String format(String content, boolean isLineStart, String indentation, int[] positions) {
- // TODO Auto-generated method stub
- return null;
- }
-
- public void formatterStarts(String initialIndentation) {
- // TODO Auto-generated method stub
-
- }
-
- public void formatterStops() {
- // TODO Auto-generated method stub
-
- }
-
- public void format() {
- // TODO Auto-generated method stub
-
- }
-
- public void formatterStarts(IFormattingContext context) {
- // TODO Auto-generated method stub
-
- }
-
-}
diff --git a/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/i18n/TextEditorMessages.properties b/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/i18n/TextEditorMessages.properties
deleted file mode 100644
index 7deaa82..0000000
--- a/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/i18n/TextEditorMessages.properties
+++ /dev/null
@@ -1 +0,0 @@
-ContentAssistProposal.label = Content Assist \ No newline at end of file
diff --git a/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/outline/JETOutlineContentProvider.java b/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/outline/JETOutlineContentProvider.java
deleted file mode 100644
index a21a742..0000000
--- a/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/outline/JETOutlineContentProvider.java
+++ /dev/null
@@ -1,180 +0,0 @@
-package org.eclipse.jet.editor.outline;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Iterator;
-
-import org.eclipse.jet.compiler.JET2ASTElement;
-import org.eclipse.jet.compiler.JET2CompilationUnit;
-import org.eclipse.jet.compiler.TextElement;
-import org.eclipse.jet.compiler.XMLBodyElement;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.Viewer;
-
-public class JETOutlineContentProvider implements ITreeContentProvider {
-
- private ImportsContainerInput importContainerInput;
- private CompilationUnitContainerInput astContainerInput;
- private OutputPackageInput outputPackageInput;
-
- private JET2CompilationUnit cu;
- private OutputClassInput outputClassInput;
-
- public void dispose() {
- // TODO Auto-generated method stub
- }
-
- public class OutputClassInput {
- private JET2CompilationUnit compilationUnit;
- public OutputClassInput(JET2CompilationUnit cu) {
- this.compilationUnit = cu;
- }
- public JET2CompilationUnit getCompilationUnit() {
- return compilationUnit;
- }
- }
-
- public class OutputPackageInput {
- private JET2CompilationUnit compilationUnit;
- public OutputPackageInput(JET2CompilationUnit cu) {
- this.compilationUnit = cu;
- }
- public JET2CompilationUnit getCompilationUnit() {
- return compilationUnit;
- }
- }
-
- public class ImportInput {
- private ImportsContainerInput container;
- private String imp;
-
- public ImportInput(ImportsContainerInput container, String imp) {
- this.container = container;
- this.imp = imp;
- }
- public ImportsContainerInput getImportsContainerInput() {
- return container;
- }
- public String toString() {
- return imp;
- }
- }
-
- public class ImportsContainerInput {
- private JET2CompilationUnit compilationUnit;
- private Collection importInputs;
- public ImportsContainerInput(JET2CompilationUnit cu) {
- this.compilationUnit = cu;
- importInputs = new ArrayList();
- for (Iterator iterator = cu.getImports().iterator(); iterator.hasNext();) {
- String imp = (String) iterator.next();
- importInputs.add(new ImportInput(this, imp));
- }
- }
- public JET2CompilationUnit getCompilationUnit() {
- return compilationUnit;
- }
- public Collection getImportImputs() {
- return importInputs;
- }
- }
-
- public class CompilationUnitContainerInput {
- private Collection bodyElements;
- private JET2CompilationUnit compilationUnit;
- public CompilationUnitContainerInput(JET2CompilationUnit cu) {
- this.bodyElements = new ArrayList();
- this.compilationUnit = cu;
- for (Iterator iterator = cu.getBodyElements().iterator(); iterator.hasNext();) {
- JET2ASTElement elt = (JET2ASTElement) iterator.next();
- if (isFiltered(elt))
- continue;
- bodyElements.add(elt);
- }
- }
- public Collection getFilteredASTElements() {
- return bodyElements;
- }
- public JET2CompilationUnit getCompilationUnit() {
- return compilationUnit;
- }
- private boolean isFiltered(JET2ASTElement elt) {
- if (elt instanceof TextElement) {
- String text = new String(((TextElement)elt).getText());
- text = text.replace('\r', ' ');
- text = text.replace('\n', ' ');
- text = text.replace('\t', ' ');
- text = text.trim();
- return text.length() == 0;
- }
-// if (elt instanceof JET2Directive) {
-// JET2Directive directive = (JET2Directive) elt;
-// if ("import".equals(directive.getName()) ||
-// "package".equals(directive.getName()))
-// return true;
-// }
- return false;
- }
- }
-
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- cu = (JET2CompilationUnit) newInput;
- }
-
- public Object[] getElements(Object inputElement) {
- Collection results = new ArrayList();
- if (inputElement instanceof JET2CompilationUnit) {
- JET2CompilationUnit cu = (JET2CompilationUnit) inputElement;
- results.add(outputPackageInput = new OutputPackageInput(cu));
- results.add(importContainerInput = new ImportsContainerInput(cu));
- results.add(astContainerInput = new CompilationUnitContainerInput(cu));
- results.addAll(Arrays.asList(cu.getTagLibraryReferences()));
- }
- return results.toArray();
- }
-
- public Object[] getChildren(Object parentElement) {
- if (parentElement == outputPackageInput) {
- return new Object[] {outputClassInput = new OutputClassInput(cu)};
- }
- if (parentElement == importContainerInput) {
- return importContainerInput.getImportImputs().toArray();
- }
- if (parentElement == astContainerInput) {
- return astContainerInput.bodyElements.toArray();
- }
- if (parentElement instanceof XMLBodyElement) {
- XMLBodyElement astElement = (XMLBodyElement) parentElement;
- return astElement.getBodyElements().toArray();
- }
- return null;
- }
-
- public Object getParent(Object element) {
- if (element == outputPackageInput ||
- element == importContainerInput ||
- element == astContainerInput)
- return cu;
- if (element == outputClassInput)
- return outputPackageInput;
- if (element instanceof ImportInput)
- return ((ImportInput)element).getImportsContainerInput();
- if (element instanceof JET2ASTElement) {
- if (((JET2ASTElement)element).getParent() == cu)
- return astContainerInput;
- return ((JET2ASTElement)element).getParent();
- }
- if (importContainerInput.getCompilationUnit().getImports().contains(element))
- return importContainerInput;
- return null;
- }
-
- public boolean hasChildren(Object element) {
- return (element instanceof XMLBodyElement) ||
- (element == outputPackageInput) ||
- (element == importContainerInput) ||
- (element == astContainerInput);
- }
-
-}
diff --git a/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/outline/JETOutlineLabelProvider.java b/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/outline/JETOutlineLabelProvider.java
deleted file mode 100644
index 3adc7eb..0000000
--- a/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/outline/JETOutlineLabelProvider.java
+++ /dev/null
@@ -1,111 +0,0 @@
-package org.eclipse.jet.editor.outline;
-
-import java.util.Iterator;
-import java.util.Map;
-
-import org.eclipse.jdt.ui.JavaUI;
-import org.eclipse.jet.compiler.Comment;
-import org.eclipse.jet.compiler.JET2Declaration;
-import org.eclipse.jet.compiler.JET2Directive;
-import org.eclipse.jet.compiler.JET2Expression;
-import org.eclipse.jet.compiler.JET2Scriptlet;
-import org.eclipse.jet.compiler.TextElement;
-import org.eclipse.jet.compiler.XMLElement;
-import org.eclipse.jet.editor.Activator;
-import org.eclipse.jet.taglib.TagLibraryReference;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.ISharedImages;
-
-public class JETOutlineLabelProvider extends LabelProvider {
-
- public Image getImage(Object element) {
- if (element instanceof Comment) {
- return JavaUI.getSharedImages().getImage(org.eclipse.jdt.ui.ISharedImages.IMG_OBJS_JAVADOCTAG);
- } else if (element instanceof JET2Declaration) {
- return JavaUI.getSharedImages().getImage(org.eclipse.jdt.ui.ISharedImages.IMG_OBJS_PUBLIC);
- } else if (element instanceof JET2Expression) {
- return JavaUI.getSharedImages().getImage(org.eclipse.jdt.ui.ISharedImages.IMG_OBJS_DEFAULT);
- } else if (element instanceof JET2Scriptlet) {
- return JavaUI.getSharedImages().getImage(org.eclipse.jdt.ui.ISharedImages.IMG_OBJS_PUBLIC);
- } else if (element instanceof JET2Directive) {
- return JavaUI.getSharedImages().getImage(org.eclipse.jdt.ui.ISharedImages.IMG_OBJS_PROTECTED);
- } else if (element instanceof TextElement) {
- return JavaUI.getSharedImages().getImage(org.eclipse.jdt.ui.ISharedImages.IMG_OBJS_IMPDECL);
- } else if (element instanceof XMLElement) {
- return JavaUI.getSharedImages().getImage(org.eclipse.jdt.ui.ISharedImages.IMG_OBJS_PROTECTED);
- } else if (element instanceof JETOutlineContentProvider.ImportsContainerInput) {
- return JavaUI.getSharedImages().getImage(org.eclipse.jdt.ui.ISharedImages.IMG_OBJS_IMPCONT);
- } else if (element instanceof JETOutlineContentProvider.ImportInput) {
- return JavaUI.getSharedImages().getImage(org.eclipse.jdt.ui.ISharedImages.IMG_OBJS_IMPDECL);
- } else if (element instanceof JETOutlineContentProvider.CompilationUnitContainerInput) {
- return Activator.getDefault().getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJ_FILE);
- } else if (element instanceof JETOutlineContentProvider.OutputPackageInput) {
- return JavaUI.getSharedImages().getImage(org.eclipse.jdt.ui.ISharedImages.IMG_OBJS_PACKDECL);
- } else if (element instanceof JETOutlineContentProvider.OutputClassInput) {
- return JavaUI.getSharedImages().getImage(org.eclipse.jdt.ui.ISharedImages.IMG_OBJS_CUNIT);
- } else if (element instanceof TagLibraryReference) {
- return JavaUI.getSharedImages().getImage(org.eclipse.jdt.ui.ISharedImages.IMG_OBJS_ANNOTATION);
- }
- return super.getImage(element);
- }
-
- public String getText(Object element) {
- if (element instanceof Comment) {
- return getShortText(((Comment)element).getCommentText());
- } else if (element instanceof JET2Declaration) {
- return "<%!" + getShortText(((JET2Declaration)element).getJavaContent()) + "%>";
- } else if (element instanceof JET2Expression) {
- return "<%=" + getShortText(((JET2Expression)element).getJavaContent()) + "%>";
- } else if (element instanceof JET2Scriptlet) {
- return "<%" + getShortText(((JET2Scriptlet)element).getJavaContent()) + "%>";
- } else if (element instanceof JET2Directive) {
- return "<%@" + ((JET2Directive)element).getName() + " " + getAttributesText(((JET2Directive)element)) + "%>";
- } else if (element instanceof TextElement) {
- return getShortText(new String(((TextElement)element).getText()));
- } else if (element instanceof XMLElement) {
- return "<" + ((XMLElement)element).getName() + " " + getAttributesText(((XMLElement)element)) + ">";
- } else if (element instanceof JETOutlineContentProvider.ImportsContainerInput) {
- return "import declarations";
- } else if (element instanceof JETOutlineContentProvider.CompilationUnitContainerInput) {
- return "Template AST";
- } else if (element instanceof JETOutlineContentProvider.OutputPackageInput) {
- return ((JETOutlineContentProvider.OutputPackageInput)element).getCompilationUnit().getOutputJavaPackage();
- } else if (element instanceof JETOutlineContentProvider.OutputClassInput) {
- return ((JETOutlineContentProvider.OutputClassInput)element).getCompilationUnit().getOutputJavaClassName();
- } else if (element instanceof TagLibraryReference) {
- return ((TagLibraryReference)element).getTagLibraryId();
- }
- return super.getText(element);
- }
-
- private String getShortText(String text) {
- if (text.length() > 25)
- text = text.substring(0, 25) + "...";
- return text;
- }
-
- private String getAttributesText(XMLElement element) {
- Map attributes = element.getAttributes();
- StringBuffer textBuffer = new StringBuffer(attributes.size() * 5);
- for (Iterator iterator = attributes.keySet().iterator(); iterator.hasNext();) {
- String attrName = (String) iterator.next();
- String attrValue = (String) attributes.get(attrName);
- textBuffer.append(attrName).append("=\"").append(attrValue).append("\"");
- textBuffer.append(' ');
- }
- return textBuffer.toString();
- }
-
- private String getAttributesText(JET2Directive directive) {
- Map attributes = directive.getAttributes();
- StringBuffer textBuffer = new StringBuffer(attributes.size() * 5);
- for (Iterator iterator = attributes.keySet().iterator(); iterator.hasNext();) {
- String attrName = (String) iterator.next();
- String attrValue = (String) attributes.get(attrName);
- textBuffer.append(attrName).append("=\"").append(attrValue).append("\"");
- textBuffer.append(' ');
- }
- return textBuffer.toString();
- }
-}
diff --git a/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/outline/JETOutlinePage.java b/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/outline/JETOutlinePage.java
deleted file mode 100644
index b2286da..0000000
--- a/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/outline/JETOutlinePage.java
+++ /dev/null
@@ -1,57 +0,0 @@
-package org.eclipse.jet.editor.outline;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.jet.compiler.JET2CompilationUnit;
-import org.eclipse.jet.editor.JETTextEditor;
-import org.eclipse.jface.viewers.IPostSelectionProvider;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.views.contentoutline.ContentOutlinePage;
-
-public class JETOutlinePage extends ContentOutlinePage implements IAdaptable , IPostSelectionProvider {
- private JETTextEditor editor;
- private TreeViewer contentOutlineViewer;
- public JETOutlinePage(JETTextEditor editor) {
- this.editor = editor;
- }
-
- public void createControl(Composite parent) {
- // TODO Auto-generated method stub
- super.createControl(parent);
- contentOutlineViewer = getTreeViewer();
- contentOutlineViewer.addSelectionChangedListener(this);
-
- // Set up the tree viewer.
- //
- contentOutlineViewer.setContentProvider(new JETOutlineContentProvider());
- contentOutlineViewer.setLabelProvider(new JETOutlineLabelProvider());
-
- setInput();
-
- // Make sure our popups work.
- //
- editor.createContextMenuFor(contentOutlineViewer);
- }
-
- public void setInput() {
- JET2CompilationUnit cu = editor.requestCompilationUnit();
- contentOutlineViewer.setInput(cu);
- }
-
- public Object getAdapter(Class adapter) {
- // TODO Auto-generated method stub
- return null;
- }
-
- public void addPostSelectionChangedListener(ISelectionChangedListener listener) {
- // TODO Auto-generated method stub
-
- }
-
- public void removePostSelectionChangedListener(ISelectionChangedListener listener) {
- // TODO Auto-generated method stub
-
- }
-
-}
diff --git a/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/partition/JETDocumentPartitionScanner.java b/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/partition/JETDocumentPartitionScanner.java
deleted file mode 100644
index c53b865..0000000
--- a/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/partition/JETDocumentPartitionScanner.java
+++ /dev/null
@@ -1,512 +0,0 @@
-package org.eclipse.jet.editor.partition;
-
-import java.lang.reflect.Constructor;
-import java.lang.reflect.InvocationTargetException;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtensionRegistry;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jet.editor.JETTextEditor;
-import org.eclipse.jet.editor.configuration.JETTokenStyleManager;
-import org.eclipse.jet.editor.configuration.delegates.IJETTextPartitionConfigurationDelegate;
-import org.eclipse.jet.editor.contentassist.JETCustomTagAssistProcessor;
-import org.eclipse.jet.editor.contentassist.JETDirectiveAssistProcessor;
-import org.eclipse.jet.editor.contentassist.JETJavaDeclarationAssistProcessor;
-import org.eclipse.jet.editor.contentassist.JETJavaExpressionAssistProcessor;
-import org.eclipse.jet.editor.contentassist.JETJavaScriptletAssistProcessor;
-import org.eclipse.jet.editor.formatter.JETCustomTagFormattingStrategy;
-import org.eclipse.jet.editor.formatter.JETDirectiveFormattingStrategy;
-import org.eclipse.jet.editor.formatter.JETJavaDeclarationFormattingStrategy;
-import org.eclipse.jet.editor.formatter.JETJavaExpressionFormattingStrategy;
-import org.eclipse.jet.editor.formatter.JETJavaScriptletFormattingStrategy;
-import org.eclipse.jet.editor.rules.JETCommentRule;
-import org.eclipse.jet.editor.rules.JETCustomTagRule;
-import org.eclipse.jet.editor.rules.JETDirectiveRule;
-import org.eclipse.jet.editor.rules.JETJavaDeclarationRule;
-import org.eclipse.jet.editor.rules.JETJavaExpressionRule;
-import org.eclipse.jet.editor.rules.JETJavaScriptletRule;
-import org.eclipse.jet.editor.scanners.JETCommentScanner;
-import org.eclipse.jet.editor.scanners.JETCustomTagScanner;
-import org.eclipse.jet.editor.scanners.JETDefaultContentScanner;
-import org.eclipse.jet.editor.scanners.JETDirectiveScanner;
-import org.eclipse.jet.editor.scanners.JETJavaDeclarationScanner;
-import org.eclipse.jet.editor.scanners.JETJavaExpressionScanner;
-import org.eclipse.jet.editor.scanners.JETJavaScriptletScanner;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.contentassist.ContentAssistant;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.jface.text.formatter.IFormattingStrategy;
-import org.eclipse.jface.text.presentation.IPresentationDamager;
-import org.eclipse.jface.text.presentation.IPresentationRepairer;
-import org.eclipse.jface.text.rules.DefaultDamagerRepairer;
-import org.eclipse.jface.text.rules.IPredicateRule;
-import org.eclipse.jface.text.rules.IToken;
-import org.eclipse.jface.text.rules.ITokenScanner;
-import org.eclipse.jface.text.rules.RuleBasedPartitionScanner;
-import org.eclipse.jface.text.rules.Token;
-import org.eclipse.jface.text.source.ISourceViewer;
-import org.osgi.framework.Bundle;
-
-public class JETDocumentPartitionScanner extends RuleBasedPartitionScanner {
-
- public final static String JET_COMMENT = "__jet_comment";
- public final static String JET_CUSTOM_TAG = "__jet_xml_tag";
- public final static String JET_DIRECTIVE = "__jet_directive";
- public final static String JET_JAVA_DECLARATION = "__jet_java_declaration";
- public final static String JET_JAVA_EXPRESSION = "__jet_java_expression";
- public final static String JET_JAVA_SCRIPTLET = "__jet_java_scriptlet";
-
- private Map tokenScanners;
- private Map damagerRepairers;
- private Map damagersOnly;
- private Map repairersOnly;
- private Map completionProcessors;
- private Map formattingStrategies;
-
- private JETTextEditor editor;
-
- private List contentTypes;
- private Map delegatesContentTypes;
-
- private Collection partitionConfigurationDelegates;
-
- private JETDefaultContentScanner defaultContentScanner;
- private JETCustomTagScanner tagScanner;
- private JETDirectiveScanner directiveScanner;
- private JETJavaDeclarationScanner declarationScanner;
- private JETJavaExpressionScanner expressionScanner;
- private JETJavaScriptletScanner scriptletScanner;
- private JETCommentScanner commentScanner;
-
- private IContentAssistProcessor tagAssistProcessor;
- private IContentAssistProcessor scriptletAssistProcessor;
- private IContentAssistProcessor expressionAssistProcessor;
- private IContentAssistProcessor declarationAssistProcessor;
- private IContentAssistProcessor directiveAssistProcessor;
-
- private IFormattingStrategy tagFormattingStrategy;
- private IFormattingStrategy scriptletFormattingStrategy;
- private IFormattingStrategy expressionFormattingStrategy;
- private IFormattingStrategy declarationFormattingStrategy;
- private IFormattingStrategy directiveFormattingStrategy;
-
- public JETDocumentPartitionScanner(JETTextEditor editor) {
- this.editor = editor;
- initPartitionScannerDelegetes();
- List rules = new ArrayList();
-
- IToken jetComments = new Token(JET_COMMENT);
- IToken jetCustomTags = new Token(JET_CUSTOM_TAG);
- IToken jetDirective = new Token(JET_DIRECTIVE);
- IToken jetJavaDeclaration = new Token(JET_JAVA_DECLARATION);
- IToken jetJavaExpression = new Token(JET_JAVA_EXPRESSION);
- IToken jetJavaScriptlet = new Token(JET_JAVA_SCRIPTLET);
-
- rules.add(new JETCommentRule(jetComments));
- rules.add(new JETCustomTagRule(jetCustomTags));
- rules.add(new JETDirectiveRule(jetDirective));
- rules.add(new JETJavaDeclarationRule(jetJavaDeclaration));
- rules.add(new JETJavaExpressionRule(jetJavaExpression));
- rules.add(new JETJavaScriptletRule(jetJavaScriptlet));
-
- for (Iterator iterator = partitionConfigurationDelegates.iterator(); iterator.hasNext();) {
- IJETTextPartitionConfigurationDelegate delegate = (IJETTextPartitionConfigurationDelegate) iterator.next();
- if (delegate.isActiveFor(editor.getEditorInput())) {
- IPredicateRule[] partitioningRules = delegate.getPartitioningRules();
- for (int i = 0; i < partitioningRules.length; i++) {
- IPredicateRule rule = partitioningRules[i];
- rules.add(rule);
- }
- }
- }
-
- IPredicateRule[] result = new IPredicateRule[rules.size()];
- result = (IPredicateRule[]) rules.toArray(result);
- setPredicateRules(result);
- }
-
- public int getNextCharacterOffset() {
- return fOffset;
- }
- private void initPartitionScannerDelegetes() {
- partitionConfigurationDelegates = new ArrayList();
- IExtensionRegistry registry = Platform.getExtensionRegistry();
- IConfigurationElement[] elements = registry.getConfigurationElementsFor("org.eclipse.jet.editor", "partitionConfigurationDelegates");
- for (int i = 0; i < elements.length; i++) {
- IConfigurationElement element = elements[i];
- Bundle bundle = Platform.getBundle(element.getNamespaceIdentifier());
- String delegateClass = element.getAttribute("delegateClass");
- IJETTextPartitionConfigurationDelegate delegate = null;
- try {
- Class clazz = bundle.loadClass(delegateClass);
- Class[] argTypes = new Class[] {JETTextEditor.class};
- Constructor ctorWithTextEditor = null;
- try {
- ctorWithTextEditor = clazz.getConstructor(argTypes);
- } catch (SecurityException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } catch (NoSuchMethodException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- if (ctorWithTextEditor != null)
- delegate = (IJETTextPartitionConfigurationDelegate) ctorWithTextEditor.newInstance(new Object[] {editor});
- else
- delegate = (IJETTextPartitionConfigurationDelegate) clazz.newInstance();
- partitionConfigurationDelegates.add(delegate);
- } catch (ClassNotFoundException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } catch (InstantiationException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } catch (IllegalAccessException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } catch (IllegalArgumentException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } catch (InvocationTargetException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
-
- }
-
- public String[] getContentTypes(ISourceViewer sourceViewer) {
- if (contentTypes == null) {
- contentTypes = new ArrayList();
- delegatesContentTypes = new HashMap();
-
- contentTypes.add(IDocument.DEFAULT_CONTENT_TYPE);
- contentTypes.add(JET_COMMENT);
- contentTypes.add(JET_CUSTOM_TAG);
- contentTypes.add(JET_DIRECTIVE);
- contentTypes.add(JET_JAVA_DECLARATION);
- contentTypes.add(JET_JAVA_EXPRESSION);
- contentTypes.add(JET_JAVA_SCRIPTLET);
-
- for (Iterator iterator = partitionConfigurationDelegates.iterator(); iterator.hasNext();) {
- IJETTextPartitionConfigurationDelegate delegate = (IJETTextPartitionConfigurationDelegate) iterator.next();
- if (delegate.isActiveFor(editor.getEditorInput())) {
- String[] delegateContentTypes = delegate.getContentTypes(sourceViewer);
- for (int i = 0; i < delegateContentTypes.length; i++) {
- String contentType = delegateContentTypes[i];
- contentTypes.add(contentType);
- delegatesContentTypes.put(contentType, delegate);
- }
- }
- }
- }
- String[] result = new String[contentTypes.size()];
- result = (String[]) contentTypes.toArray(result);
- return result;
- }
-
- private void initTokenScanners() {
- tokenScanners = new HashMap();
- tokenScanners.put(IDocument.DEFAULT_CONTENT_TYPE, getDefaultContentScanner());
- tokenScanners.put(JET_COMMENT, getCommentScanner());
- tokenScanners.put(JET_CUSTOM_TAG, getCustomTagScanner());
- tokenScanners.put(JET_DIRECTIVE, getDirectiveScanner());
- tokenScanners.put(JET_JAVA_DECLARATION, getJavaDeclarationScanner());
- tokenScanners.put(JET_JAVA_EXPRESSION, getJavaExpressionScanner());
- tokenScanners.put(JET_JAVA_SCRIPTLET, getJavaScriptletScanner());
-
- for (Iterator iterator = delegatesContentTypes.keySet().iterator(); iterator.hasNext();) {
- String contentType = (String) iterator.next();
- IJETTextPartitionConfigurationDelegate delegate = (IJETTextPartitionConfigurationDelegate) delegatesContentTypes.get(contentType);
- ITokenScanner tokenScanner = delegate.getTokenScanner(contentType);
- if (tokenScanner != null)
- tokenScanners.put(contentType, tokenScanner);
- }
- }
-
- private void initCompletionProcessors(ContentAssistant assistant) {
- completionProcessors = new HashMap();
- completionProcessors.put(IDocument.DEFAULT_CONTENT_TYPE, getDefaultContentAssistProcessor(assistant));
- completionProcessors.put(JET_COMMENT, getCommentAssistProcessor(assistant));
- completionProcessors.put(JET_CUSTOM_TAG, getCustomTagAssistProcessor(assistant));
- completionProcessors.put(JET_DIRECTIVE, getDirectiveAssistProcessor(assistant));
- completionProcessors.put(JET_JAVA_DECLARATION, getJavaDeclarationAssistProcessor(assistant));
- completionProcessors.put(JET_JAVA_EXPRESSION, getJavaExpressionAssistProcessor(assistant));
- completionProcessors.put(JET_JAVA_SCRIPTLET, getJavaScriptletAssistProcessor(assistant));
-
- for (Iterator iterator = delegatesContentTypes.keySet().iterator(); iterator.hasNext();) {
- String contentType = (String) iterator.next();
- IJETTextPartitionConfigurationDelegate delegate = (IJETTextPartitionConfigurationDelegate) delegatesContentTypes.get(contentType);
- IContentAssistProcessor processor = delegate.getContentAssistProcessor(contentType, assistant);
- if (processor != null)
- completionProcessors.put(contentType, processor);
- }
- }
-
- private void initFormattingStrategies() {
- formattingStrategies = new HashMap();
- formattingStrategies.put(IDocument.DEFAULT_CONTENT_TYPE, getDefaultFormattingStrategy());
- formattingStrategies.put(JET_COMMENT, getCommentFormattingStrategy());
- formattingStrategies.put(JET_CUSTOM_TAG, getCustomTagFormattingStrategy());
- formattingStrategies.put(JET_DIRECTIVE, getDirectiveFormattingStrategy());
- formattingStrategies.put(JET_JAVA_DECLARATION, getJavaDeclarationFormattingStrategy());
- formattingStrategies.put(JET_JAVA_EXPRESSION, getJavaExpressionFormattingStrategy());
- formattingStrategies.put(JET_JAVA_SCRIPTLET, getJavaScriptletFormattingStrategy());
-
- for (Iterator iterator = delegatesContentTypes.keySet().iterator(); iterator.hasNext();) {
- String contentType = (String) iterator.next();
- IJETTextPartitionConfigurationDelegate delegate = (IJETTextPartitionConfigurationDelegate) delegatesContentTypes.get(contentType);
- IFormattingStrategy strategy = delegate.getFormattingStrategy(contentType);
- if (strategy != null)
- formattingStrategies.put(contentType, strategy);
- }
- }
-
- private void initDamagerRepairers() {
- damagerRepairers = new HashMap();
-
- damagerRepairers.put(JET_COMMENT, createDefaultDamagerRepairer(JET_COMMENT));
- damagerRepairers.put(JET_CUSTOM_TAG, createDefaultDamagerRepairer(JET_CUSTOM_TAG));
- damagerRepairers.put(JET_DIRECTIVE, createDefaultDamagerRepairer(JET_DIRECTIVE));
- damagerRepairers.put(JET_JAVA_DECLARATION, createDefaultDamagerRepairer(JET_JAVA_DECLARATION));
- damagerRepairers.put(JET_JAVA_EXPRESSION, createDefaultDamagerRepairer(JET_JAVA_EXPRESSION));
- damagerRepairers.put(JET_JAVA_SCRIPTLET, createDefaultDamagerRepairer(JET_JAVA_SCRIPTLET));
- for (Iterator iterator = delegatesContentTypes.keySet().iterator(); iterator.hasNext();) {
- String contentType = (String) iterator.next();
- IJETTextPartitionConfigurationDelegate delegate = (IJETTextPartitionConfigurationDelegate) delegatesContentTypes.get(contentType);
- IPresentationDamager delegateDamager = delegate.getDamager(contentType);
- IPresentationRepairer delegateRepairer = delegate.getRepairer(contentType);
- if (delegateDamager != null && delegateDamager == delegateRepairer)
- damagerRepairers.put(contentType, delegateDamager);
- }
- }
-
- private void initDamagersOnly() {
- damagersOnly = new HashMap();
- for (Iterator iterator = delegatesContentTypes.keySet().iterator(); iterator.hasNext();) {
- String contentType = (String) iterator.next();
- IJETTextPartitionConfigurationDelegate delegate = (IJETTextPartitionConfigurationDelegate) delegatesContentTypes.get(contentType);
- IPresentationDamager delegateDamager = delegate.getDamager(contentType);
- if (delegateDamager != null && !damagerRepairers.containsValue(delegateDamager))
- damagersOnly.put(contentType, delegateDamager);
- }
- }
-
- protected void initRepairersOnly() {
- repairersOnly = new HashMap();
- for (Iterator iterator = delegatesContentTypes.keySet().iterator(); iterator.hasNext();) {
- String contentType = (String) iterator.next();
- IJETTextPartitionConfigurationDelegate delegate = (IJETTextPartitionConfigurationDelegate) delegatesContentTypes.get(contentType);
- IPresentationRepairer delegateRepairer = delegate.getRepairer(contentType);
- if (delegateRepairer != null && !damagerRepairers.containsValue(delegateRepairer))
- repairersOnly.put(contentType, delegateRepairer);
- }
- }
-
- protected IFormattingStrategy getDefaultFormattingStrategy() {
- return null;
- }
-
- protected IFormattingStrategy getCommentFormattingStrategy() {
- return null;
- }
-
- protected IFormattingStrategy getCustomTagFormattingStrategy() {
- if (tagFormattingStrategy == null) {
- tagFormattingStrategy = new JETCustomTagFormattingStrategy();
- }
- return tagFormattingStrategy;
- }
-
- protected IFormattingStrategy getJavaScriptletFormattingStrategy() {
- if (scriptletFormattingStrategy == null) {
- scriptletFormattingStrategy = new JETJavaScriptletFormattingStrategy();
- }
- return scriptletFormattingStrategy;
- }
-
- protected IFormattingStrategy getJavaExpressionFormattingStrategy() {
- if (expressionFormattingStrategy == null) {
- expressionFormattingStrategy = new JETJavaExpressionFormattingStrategy();
- }
- return expressionFormattingStrategy;
- }
-
- protected IFormattingStrategy getJavaDeclarationFormattingStrategy() {
- if (declarationFormattingStrategy == null) {
- declarationFormattingStrategy = new JETJavaDeclarationFormattingStrategy();
- }
- return declarationFormattingStrategy;
- }
-
- protected IFormattingStrategy getDirectiveFormattingStrategy() {
- if (directiveFormattingStrategy == null) {
- directiveFormattingStrategy = new JETDirectiveFormattingStrategy();
- }
- return directiveFormattingStrategy;
- }
-
- protected IContentAssistProcessor getDefaultContentAssistProcessor(ContentAssistant assistant) {
- return null;
- }
-
- protected IContentAssistProcessor getCommentAssistProcessor(ContentAssistant assistant) {
- return null;
- }
-
- protected IContentAssistProcessor getCustomTagAssistProcessor(ContentAssistant assistant) {
- if (tagAssistProcessor == null) {
- tagAssistProcessor = new JETCustomTagAssistProcessor(editor);
- }
- return tagAssistProcessor;
- }
-
- protected IContentAssistProcessor getJavaScriptletAssistProcessor(ContentAssistant assistant) {
- if (scriptletAssistProcessor == null) {
- scriptletAssistProcessor = new JETJavaScriptletAssistProcessor(editor);
- }
- return scriptletAssistProcessor;
- }
-
- protected IContentAssistProcessor getJavaExpressionAssistProcessor(ContentAssistant assistant) {
- if (expressionAssistProcessor == null) {
- expressionAssistProcessor = new JETJavaExpressionAssistProcessor(editor);
- }
- return expressionAssistProcessor;
- }
-
- protected IContentAssistProcessor getJavaDeclarationAssistProcessor(ContentAssistant assistant) {
- if (declarationAssistProcessor == null) {
- declarationAssistProcessor = new JETJavaDeclarationAssistProcessor(editor);
- }
- return declarationAssistProcessor;
- }
-
- protected IContentAssistProcessor getDirectiveAssistProcessor(ContentAssistant assistant) {
- if (directiveAssistProcessor == null) {
- directiveAssistProcessor = new JETDirectiveAssistProcessor(editor);
- }
- return directiveAssistProcessor;
- }
-
- protected ITokenScanner getDefaultContentScanner() {
- JETTokenStyleManager tokenStyleManager = editor.getTokenStyleManager();
- IPreferenceStore preferenceStore = editor.getEditorPreferenceStore();
- if (defaultContentScanner == null) {
- defaultContentScanner = new JETDefaultContentScanner(tokenStyleManager, preferenceStore);
- }
- return defaultContentScanner;
- }
-
- protected ITokenScanner getCommentScanner() {
- JETTokenStyleManager tokenStyleManager = editor.getTokenStyleManager();
- IPreferenceStore preferenceStore = editor.getEditorPreferenceStore();
- if (commentScanner == null) {
- commentScanner = new JETCommentScanner(tokenStyleManager, preferenceStore);
- }
- return commentScanner;
- }
-
- protected ITokenScanner getCustomTagScanner() {
- JETTokenStyleManager tokenStyleManager = editor.getTokenStyleManager();
- IPreferenceStore preferenceStore = editor.getEditorPreferenceStore();
- if (tagScanner == null) {
- tagScanner = new JETCustomTagScanner(tokenStyleManager, preferenceStore);
- }
- return tagScanner;
- }
-
- protected ITokenScanner getJavaScriptletScanner() {
- JETTokenStyleManager tokenStyleManager = editor.getTokenStyleManager();
- IPreferenceStore preferenceStore = editor.getEditorPreferenceStore();
- if (scriptletScanner == null) {
- scriptletScanner = new JETJavaScriptletScanner(tokenStyleManager, preferenceStore);
- }
- return scriptletScanner;
- }
-
- protected ITokenScanner getJavaExpressionScanner() {
- JETTokenStyleManager tokenStyleManager = editor.getTokenStyleManager();
- IPreferenceStore preferenceStore = editor.getEditorPreferenceStore();
- if (expressionScanner == null) {
- expressionScanner = new JETJavaExpressionScanner(tokenStyleManager, preferenceStore);
- }
- return expressionScanner;
- }
-
- protected ITokenScanner getJavaDeclarationScanner() {
- JETTokenStyleManager tokenStyleManager = editor.getTokenStyleManager();
- IPreferenceStore preferenceStore = editor.getEditorPreferenceStore();
- if (declarationScanner == null) {
- declarationScanner = new JETJavaDeclarationScanner(tokenStyleManager, preferenceStore);
- }
- return declarationScanner;
- }
-
- protected ITokenScanner getDirectiveScanner() {
- JETTokenStyleManager tokenStyleManager = editor.getTokenStyleManager();
- IPreferenceStore preferenceStore = editor.getEditorPreferenceStore();
- if (directiveScanner == null) {
- directiveScanner = new JETDirectiveScanner(tokenStyleManager, preferenceStore);
- }
- return directiveScanner;
- }
-
- public ITokenScanner getTokenScanner(String contentType) {
- if (tokenScanners == null)
- initTokenScanners();
- ITokenScanner scanner = (ITokenScanner) tokenScanners.get(contentType);
- return scanner;
- }
-
- private DefaultDamagerRepairer createDefaultDamagerRepairer(String contentType) {
- ITokenScanner tokenScanner = getTokenScanner(contentType);
- return tokenScanner == null ? null : new DefaultDamagerRepairer(tokenScanner);
- }
-
- public IPresentationDamager getDamager(String contentType) {
- if (damagerRepairers == null)
- initDamagerRepairers();
- IPresentationDamager damager = (IPresentationDamager) damagerRepairers.get(contentType);
- if (damager == null) {
- if (damagersOnly == null)
- initDamagersOnly();
- damager = (IPresentationDamager) damagersOnly.get(contentType);
- }
- return damager;
- }
-
- public IPresentationRepairer getRepairer(String contentType) {
- if (damagerRepairers == null)
- initDamagerRepairers();
- IPresentationRepairer repairer = (IPresentationRepairer) damagerRepairers.get(contentType);
- if (repairer == null) {
- if (repairersOnly == null)
- initRepairersOnly();
- repairer = (IPresentationRepairer) repairersOnly.get(contentType);
- }
- return repairer;
- }
-
- public IContentAssistProcessor getCompletionProcessor(String contentType, ContentAssistant assistant) {
- if (completionProcessors == null)
- initCompletionProcessors(assistant);
- IContentAssistProcessor processor = (IContentAssistProcessor) completionProcessors.get(contentType);
- return processor;
- }
-
- public IFormattingStrategy getFormattingStrategy(String contentType) {
- if (formattingStrategies == null)
- initFormattingStrategies();
- IFormattingStrategy formatter = (IFormattingStrategy) formattingStrategies.get(contentType);
- return formatter;
- }
-
-}
diff --git a/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/rules/JETBracketRule.java b/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/rules/JETBracketRule.java
deleted file mode 100644
index 0ccaf0f..0000000
--- a/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/rules/JETBracketRule.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 - 2006 Joel Cheuoua & others.
- * 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:
- * Joel Cheuoua - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jet.editor.rules;
-
-import org.eclipse.jface.text.rules.ICharacterScanner;
-import org.eclipse.jface.text.rules.IToken;
-import org.eclipse.jface.text.rules.MultiLineRule;
-import org.eclipse.jface.text.rules.Token;
-
-/**
- * @author jcheuoua
- * @version $Revision: 1.1 $
- */
-public class JETBracketRule extends MultiLineRule {
- protected IToken token;
-
- /**
- * Constructor for JETBracketRule.
- *
- * @param token
- * IToken
- */
- public JETBracketRule(IToken token) {
- super("<%", "%>", token);
- this.token = token;
- }
-
- /**
- * Method evaluate.
- *
- * @param scanner
- * ICharacterScanner
- * @return IToken
- * @see org.eclipse.jface.text.rules.IRule#evaluate(ICharacterScanner)
- */
- public IToken evaluate(ICharacterScanner scanner) {
- char c = (char) scanner.read();
- if (c == '%') { // we're reaching the end of the token zone
- c = (char) scanner.read();
- if (c == '>') {
- return token;
- } else {
- scanner.unread();
- scanner.unread();
- return Token.UNDEFINED;
- }
- }
- if (c == '<') { // we're at the beginning of the token zone
- c = (char) scanner.read();
- if (c == '%') {
- c = (char) scanner.read();
- if (c == '!' || c == '@' || c == '=' || c == '-') {
- return token;
- } else {
- scanner.unread();
- return token;
- }
- } else {
- scanner.unread();
- scanner.unread();
- return Token.UNDEFINED;
- }
- } else {
- scanner.unread();
- return Token.UNDEFINED;
- }
- }
-}
diff --git a/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/rules/JETCommentRule.java b/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/rules/JETCommentRule.java
deleted file mode 100644
index 6133aad..0000000
--- a/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/rules/JETCommentRule.java
+++ /dev/null
@@ -1,10 +0,0 @@
-package org.eclipse.jet.editor.rules;
-
-import org.eclipse.jface.text.rules.*;
-
-public class JETCommentRule extends MultiLineRule {
-
- public JETCommentRule(IToken token) {
- super("<%--", "--%>", token, '\\');
- }
-}
diff --git a/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/rules/JETCustomTagRule.java b/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/rules/JETCustomTagRule.java
deleted file mode 100644
index c926667..0000000
--- a/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/rules/JETCustomTagRule.java
+++ /dev/null
@@ -1,78 +0,0 @@
-package org.eclipse.jet.editor.rules;
-
-import java.util.HashSet;
-import java.util.Set;
-
-import org.eclipse.jet.taglib.TagLibrary;
-import org.eclipse.jet.taglib.TagLibraryManager;
-import org.eclipse.jface.text.rules.*;
-
-public class JETCustomTagRule extends MultiLineRule {
- private Set tagElementNames;
- public JETCustomTagRule(IToken token) {
- super("<", ">", token, '\\');
- String[] tagLibIds = TagLibraryManager.getInstance().getKnownLibraryIds();
- tagElementNames = new HashSet();
- for (int i = 0; i < tagLibIds.length; i++) {
- String id = tagLibIds[i];
- TagLibrary tagLib = TagLibraryManager.getInstance().getTagLibrary(id, true);
- String[] names = tagLib.getTagNames();
- for (int j = 0; j < names.length; j++) {
- String name = names[j];
- tagElementNames.add(tagLib.getDefaultPrefix() + ":" + name);
- }
- }
- }
-
- public IToken evaluate(ICharacterScanner scanner, boolean resume) {
- // TODO Auto-generated method stub
- return super.evaluate(scanner, resume);
- }
-
- protected boolean sequenceDetected(ICharacterScanner scanner, char[] sequence, boolean eofAllowed) {
- int c = scanner.read();
- int readCount = 1;
- if (sequence[0] == '<') {
- // Cut through obvious cases
- if ((char)c == '%') {
- // processing jet instruction - abort
- scanner.unread();
- return false;
- }
- if ((char)c == '?') {
- // processing instruction - abort
- scanner.unread();
- return false;
- }
- if ((char)c == '!') {
- scanner.unread();
- // comment - abort
- return false;
- }
- StringBuffer name = new StringBuffer();
- while ((char)c == ' ') {
- c = scanner.read();
- readCount++;
- }
- if (c == ICharacterScanner.EOF) {
- for (int i = 0; i < readCount; i++) scanner.unread();
- return false;
- }
- while ((char)c != ' ' && c != ICharacterScanner.EOF && (char)c != '>') {
- name.append((char)c);
- c = scanner.read();
- readCount++;
- }
- if (tagElementNames.contains(name.toString())) {
- scanner.unread();
- return true;
- } else {
- for (int i = 0; i < readCount; i++) scanner.unread();
- return false;
- }
- } else if (sequence[0] == '>') {
- scanner.unread();
- }
- return super.sequenceDetected(scanner, sequence, eofAllowed);
- }
-}
diff --git a/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/rules/JETDirectiveRule.java b/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/rules/JETDirectiveRule.java
deleted file mode 100644
index b9e184b..0000000
--- a/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/rules/JETDirectiveRule.java
+++ /dev/null
@@ -1,10 +0,0 @@
-package org.eclipse.jet.editor.rules;
-
-import org.eclipse.jface.text.rules.*;
-
-public class JETDirectiveRule extends MultiLineRule {
-
- public JETDirectiveRule(IToken token) {
- super("<%@", "%>", token, '\\');
- }
-}
diff --git a/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/rules/JETJavaDeclarationRule.java b/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/rules/JETJavaDeclarationRule.java
deleted file mode 100644
index 3c53b13..0000000
--- a/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/rules/JETJavaDeclarationRule.java
+++ /dev/null
@@ -1,10 +0,0 @@
-package org.eclipse.jet.editor.rules;
-
-import org.eclipse.jface.text.rules.*;
-
-public class JETJavaDeclarationRule extends MultiLineRule {
-
- public JETJavaDeclarationRule(IToken token) {
- super("<%!", "%>", token, '\\');
- }
-}
diff --git a/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/rules/JETJavaExpressionRule.java b/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/rules/JETJavaExpressionRule.java
deleted file mode 100644
index b0c83af..0000000
--- a/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/rules/JETJavaExpressionRule.java
+++ /dev/null
@@ -1,10 +0,0 @@
-package org.eclipse.jet.editor.rules;
-
-import org.eclipse.jface.text.rules.*;
-
-public class JETJavaExpressionRule extends MultiLineRule {
-
- public JETJavaExpressionRule(IToken token) {
- super("<%=", "%>", token, '\\');
- }
-}
diff --git a/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/rules/JETJavaScriptletRule.java b/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/rules/JETJavaScriptletRule.java
deleted file mode 100644
index 0ca798e..0000000
--- a/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/rules/JETJavaScriptletRule.java
+++ /dev/null
@@ -1,10 +0,0 @@
-package org.eclipse.jet.editor.rules;
-
-import org.eclipse.jface.text.rules.*;
-
-public class JETJavaScriptletRule extends MultiLineRule {
-
- public JETJavaScriptletRule(IToken token) {
- super("<%", "%>", token, '\\');
- }
-}
diff --git a/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/rules/WordListDetectorRule.java b/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/rules/WordListDetectorRule.java
deleted file mode 100644
index cb00e5d..0000000
--- a/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/rules/WordListDetectorRule.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/**
- *
- */
-package org.eclipse.jet.editor.rules;
-
-import java.util.Collection;
-
-import org.eclipse.jface.text.rules.ICharacterScanner;
-import org.eclipse.jface.text.rules.IRule;
-import org.eclipse.jface.text.rules.IToken;
-import org.eclipse.jface.text.rules.Token;
-
-public class WordListDetectorRule implements IRule {
- private IToken success;
- private String[] words;
- public WordListDetectorRule(IToken token, String[] words) {
- this.success = token;
- this.words = words;
- }
- public WordListDetectorRule(IToken token, Collection words) {
- this.success = token;
- this.words = new String[words.size()];
- this.words = (String[]) words.toArray(this.words);
- }
- public IToken evaluate(ICharacterScanner scanner) {
- char c = (char) scanner.read();
- char initialChar = c;
- for (int i = 0; i < words.length; i++) {
- String keyword = words[i];
- int index = 0;
- while (keyword.length() > index && c == keyword.charAt(index)) {
- c = (char) scanner.read();
- index++;
- }
- if (index == keyword.length()) {// success for this keyword ... we'read until the end
- scanner.unread(); // there is one read in excess at the end
- return success;
- }
- // otherwise, unread and proceed to the next word
- for (int j = 0; j < index; j++) {
- scanner.unread();
- }
- c = initialChar;
- }
- scanner.unread();
- return Token.UNDEFINED;
- }
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/scanners/JETCommentScanner.java b/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/scanners/JETCommentScanner.java
deleted file mode 100644
index 8cf75c9..0000000
--- a/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/scanners/JETCommentScanner.java
+++ /dev/null
@@ -1,19 +0,0 @@
-package org.eclipse.jet.editor.scanners;
-
-import org.eclipse.jet.editor.configuration.JETEditorPreferenceConstants;
-import org.eclipse.jet.editor.configuration.JETTokenStyleManager;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.text.rules.RuleBasedScanner;
-
-public class JETCommentScanner extends RuleBasedScanner {
-
- public JETCommentScanner(JETTokenStyleManager manager, IPreferenceStore preferenceStore) {
- setDefaultReturnToken(manager.requestToken("__jet_comment",
- JETEditorPreferenceConstants.JET_COMMENT_FG_COLOR,
- JETEditorPreferenceConstants.JET_DEFAULT_BG_COLOR,
- JETEditorPreferenceConstants.JET_COMMENT_BOLD,
- JETEditorPreferenceConstants.JET_COMMENT_ITALIC,
- null,
- null));
- }
-}
diff --git a/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/scanners/JETCustomTagScanner.java b/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/scanners/JETCustomTagScanner.java
deleted file mode 100644
index 468c0ce..0000000
--- a/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/scanners/JETCustomTagScanner.java
+++ /dev/null
@@ -1,69 +0,0 @@
-package org.eclipse.jet.editor.scanners;
-
-import java.util.ArrayList;
-import java.util.Collection;
-
-import org.eclipse.jdt.ui.PreferenceConstants;
-import org.eclipse.jet.editor.configuration.JETEditorPreferenceConstants;
-import org.eclipse.jet.editor.configuration.JETTokenStyleManager;
-import org.eclipse.jet.editor.rules.WordListDetectorRule;
-import org.eclipse.jet.taglib.TagLibrary;
-import org.eclipse.jet.taglib.TagLibraryManager;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.text.rules.IRule;
-import org.eclipse.jface.text.rules.IToken;
-import org.eclipse.jface.text.rules.RuleBasedScanner;
-import org.eclipse.jface.text.rules.SingleLineRule;
-
-public class JETCustomTagScanner extends RuleBasedScanner {
-
- public JETCustomTagScanner(JETTokenStyleManager manager, IPreferenceStore preferenceStore) {
- IToken tagElementName = manager.requestToken("__jet_custom_tag_elementName",
- JETEditorPreferenceConstants.JET_CUSTOM_TAG_FG_COLOR,
- JETEditorPreferenceConstants.JET_DEFAULT_BG_COLOR,
- JETEditorPreferenceConstants.JET_CUSTOM_TAG_BOLD,
- JETEditorPreferenceConstants.JET_CUSTOM_TAG_ITALIC,
- null,
- JETEditorPreferenceConstants.JET_CUSTOM_TAG_UNDERLINE);
-
- IToken string = manager.requestToken("__jet_custom_tag_string",
- PreferenceConstants.EDITOR_STRING_COLOR,
- JETEditorPreferenceConstants.JET_DEFAULT_BG_COLOR,
- PreferenceConstants.EDITOR_STRING_BOLD,
- PreferenceConstants.EDITOR_STRING_ITALIC,
- null,
- PreferenceConstants.EDITOR_STRING_UNDERLINE);
-
- Collection tagNames = new ArrayList();
- String[] tagLibIds = TagLibraryManager.getInstance().getKnownLibraryIds();
- for (int i = 0; i < tagLibIds.length; i++) {
- String id = tagLibIds[i];
- TagLibrary tagLib = TagLibraryManager.getInstance().getTagLibrary(id, true);
- String[] names = tagLib.getTagNames();
- for (int j = 0; j < names.length; j++) {
- String name = names[j];
- tagNames.add(tagLib.getDefaultPrefix() + ":" + name);
- }
- }
-
- IRule[] rules = new IRule[3];
-
- // Add rule for double quotes
- rules[0] = new SingleLineRule("\"", "\"", string, '\\');
- // Add a rule for single quotes
- rules[1] = new SingleLineRule("'", "'", string, '\\');
- // Add a rule for the custom tag identifier
- rules[2] = new WordListDetectorRule(tagElementName, tagNames);
-
- setRules(rules);
-
- IToken defaultReturnToken = manager.requestToken("__jet_custom_tag",
- JETEditorPreferenceConstants.JET_CUSTOM_TAG_FG_COLOR,
- JETEditorPreferenceConstants.JET_DEFAULT_BG_COLOR,
- null,
- null,
- null,
- null);
- setDefaultReturnToken(defaultReturnToken);
- }
-}
diff --git a/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/scanners/JETDefaultContentScanner.java b/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/scanners/JETDefaultContentScanner.java
deleted file mode 100644
index c46b9df..0000000
--- a/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/scanners/JETDefaultContentScanner.java
+++ /dev/null
@@ -1,12 +0,0 @@
-package org.eclipse.jet.editor.scanners;
-
-import org.eclipse.jet.editor.configuration.JETTokenStyleManager;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.text.rules.RuleBasedScanner;
-
-public class JETDefaultContentScanner extends RuleBasedScanner {
-
- public JETDefaultContentScanner(JETTokenStyleManager manager, IPreferenceStore preferenceStore) {
- setDefaultReturnToken(manager.requestDefaultToken());
- }
-}
diff --git a/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/scanners/JETDirectiveScanner.java b/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/scanners/JETDirectiveScanner.java
deleted file mode 100644
index a962126..0000000
--- a/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/scanners/JETDirectiveScanner.java
+++ /dev/null
@@ -1,61 +0,0 @@
-package org.eclipse.jet.editor.scanners;
-
-import org.eclipse.jdt.ui.PreferenceConstants;
-import org.eclipse.jet.editor.configuration.JETEditorPreferenceConstants;
-import org.eclipse.jet.editor.configuration.JETTokenStyleManager;
-import org.eclipse.jet.editor.rules.JETBracketRule;
-import org.eclipse.jet.editor.rules.WordListDetectorRule;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.text.rules.IRule;
-import org.eclipse.jface.text.rules.IToken;
-import org.eclipse.jface.text.rules.RuleBasedScanner;
-import org.eclipse.jface.text.rules.SingleLineRule;
-
-public class JETDirectiveScanner extends RuleBasedScanner {
-
- public JETDirectiveScanner(JETTokenStyleManager manager, IPreferenceStore preferenceStore) {
- IToken keyword = manager.requestToken("__jet_directive_keyword",
- JETEditorPreferenceConstants.JET_DIRECTIVE_FG_COLOR,
- JETEditorPreferenceConstants.JET_DEFAULT_BG_COLOR,
- JETEditorPreferenceConstants.JET_DIRECTIVE_KEYWORD_BOLD,
- JETEditorPreferenceConstants.JET_DIRECTIVE_ITALIC,
- null,
- JETEditorPreferenceConstants.JET_DIRECTIVE_UNDERLINE);
- IToken string = manager.requestToken("__jet_directive_string",
- PreferenceConstants.EDITOR_STRING_COLOR,
- JETEditorPreferenceConstants.JET_DEFAULT_BG_COLOR,
- PreferenceConstants.EDITOR_STRING_BOLD,
- PreferenceConstants.EDITOR_STRING_ITALIC,
- null,
- PreferenceConstants.EDITOR_STRING_UNDERLINE);
- IToken bracket = manager.requestToken("__jet_bracket",
- PreferenceConstants.EDITOR_JAVA_KEYWORD_COLOR,
- JETEditorPreferenceConstants.JET_DEFAULT_BG_COLOR,
- PreferenceConstants.EDITOR_JAVA_KEYWORD_BOLD,
- PreferenceConstants.EDITOR_JAVA_KEYWORD_ITALIC,
- null,
- PreferenceConstants.EDITOR_JAVA_KEYWORD_UNDERLINE);
-
- IRule[] rules = new IRule[4];
-
- // Add rule for brackets
- rules[0] = new JETBracketRule(bracket);
- // Add rule for double quotes
- rules[1] = new SingleLineRule("\"", "\"", string, '\\');
- // Add a rule for single quotes
- rules[2] = new SingleLineRule("'", "'", string, '\\');
- // Add word rule for reserved jet directive words
- rules[3] = new WordListDetectorRule(keyword, new String[] {"jet", "taglib", "include", "start", "end"});
-
- setRules(rules);
-
- IToken defaultReturnToken = manager.requestToken("__jet_directive",
- JETEditorPreferenceConstants.JET_DIRECTIVE_FG_COLOR,
- JETEditorPreferenceConstants.JET_DEFAULT_BG_COLOR,
- JETEditorPreferenceConstants.JET_DIRECTIVE_BOLD,
- JETEditorPreferenceConstants.JET_DIRECTIVE_ITALIC,
- null,
- JETEditorPreferenceConstants.JET_DIRECTIVE_UNDERLINE);
- setDefaultReturnToken(defaultReturnToken);
- }
-}
diff --git a/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/scanners/JETJavaCodeScanner.java b/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/scanners/JETJavaCodeScanner.java
deleted file mode 100644
index 8c205fd..0000000
--- a/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/scanners/JETJavaCodeScanner.java
+++ /dev/null
@@ -1,241 +0,0 @@
-package org.eclipse.jet.editor.scanners;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jdt.ui.PreferenceConstants;
-import org.eclipse.jet.editor.configuration.JETTokenStyleManager;
-import org.eclipse.jface.text.rules.BufferedRuleBasedScanner;
-import org.eclipse.jface.text.rules.ICharacterScanner;
-import org.eclipse.jface.text.rules.IRule;
-import org.eclipse.jface.text.rules.IToken;
-import org.eclipse.jface.text.rules.IWordDetector;
-import org.eclipse.jface.text.rules.MultiLineRule;
-import org.eclipse.jface.text.rules.SingleLineRule;
-import org.eclipse.jface.text.rules.Token;
-import org.eclipse.jface.text.rules.WordRule;
-
-
-/**
- * A Java code scanner for JET-java sections.
- */
-public class JETJavaCodeScanner extends BufferedRuleBasedScanner {
-
- /**
- * Rule to detect java operators.
- */
- private class OperatorRule implements IRule {
- private char[] JAVA_OPERATORS= { ';', '.', '=', '/', '\\', '+', '-', '*', '<', '>', ':', '?', '!', ',', '|', '&', '^', '%', '~'};
- private IToken fToken;
-
- public OperatorRule(IToken token) {
- fToken= token;
- }
-
- public boolean isOperator(char character) {
- for (int index= 0; index < JAVA_OPERATORS.length; index++) {
- if (JAVA_OPERATORS[index] == character)
- return true;
- }
- return false;
- }
-
- /*
- * @see org.eclipse.jface.text.rules.IRule#evaluate(org.eclipse.jface.text.rules.ICharacterScanner)
- */
- public IToken evaluate(ICharacterScanner scanner) {
- int character= scanner.read();
- if (isOperator((char) character)) {
- do {
- character= scanner.read();
- } while (isOperator((char) character));
- scanner.unread();
- return fToken;
- } else {
- scanner.unread();
- return Token.UNDEFINED;
- }
- }
- }
-
- /**
- * Rule to detect java brackets.
- */
- private class BracketRule implements IRule {
-
- private char[] JAVA_BRACKETS= { '(', ')', '{', '}', '[', ']' };
- private final IToken success;
-
- public BracketRule(IToken token) {
- success= token;
- }
-
- public boolean isBracket(char character) {
- for (int index= 0; index < JAVA_BRACKETS.length; index++) {
- if (JAVA_BRACKETS[index] == character)
- return true;
- }
- return false;
- }
-
- /*
- * @see org.eclipse.jface.text.rules.IRule#evaluate(org.eclipse.jface.text.rules.ICharacterScanner)
- */
- public IToken evaluate(ICharacterScanner scanner) {
- int character= scanner.read();
- if (isBracket((char) character)) {
- do {
- character= scanner.read();
- } while (isBracket((char) character));
- scanner.unread();
- return success;
- } else {
- scanner.unread();
- return Token.UNDEFINED;
- }
- }
- }
-
- private class JavaWordDetector implements IWordDetector {
- /*
- * @see IWordDetector#isWordStart
- */
- public boolean isWordStart(char c) {
- return Character.isJavaIdentifierStart(c);
- }
-
- /*
- * @see IWordDetector#isWordPart
- */
- public boolean isWordPart(char c) {
- return Character.isJavaIdentifierPart(c);
- }
- }
-
- private String[] javaKeywords= {
- "abstract", //$NON-NLS-1$
- "break", //$NON-NLS-1$
- "case", "catch", "class", "const", "continue", //$NON-NLS-5$ //$NON-NLS-4$ //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$
- "default", "do", //$NON-NLS-2$ //$NON-NLS-1$
- "else", "extends", //$NON-NLS-2$ //$NON-NLS-1$
- "final", "finally", "for", //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$
- "goto", //$NON-NLS-1$
- "if", "implements", "import", "instanceof", "interface", //$NON-NLS-5$ //$NON-NLS-4$ //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$
- "native", "new", //$NON-NLS-2$ //$NON-NLS-1$
- "package", "private", "protected", "public", //$NON-NLS-4$ //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$
- "static", "super", "switch", "synchronized", //$NON-NLS-4$ //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$
- "this", "throw", "throws", "transient", "try", //$NON-NLS-5$ //$NON-NLS-4$ //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$
- "volatile", //$NON-NLS-1$
- "while", //$NON-NLS-1$
- "assert", //$NON-NLS-1$
- "enum", //$NON-NLS-1$
- "return" //$NON-NLS-1$
- };
-
- private String[] javaTypes= { "class", "interface", "void", "boolean", "char", "byte", "short", "strictfp", "int", "long", "float", "double" }; //$NON-NLS-1$ //$NON-NLS-5$ //$NON-NLS-7$ //$NON-NLS-6$ //$NON-NLS-8$ //$NON-NLS-9$ //$NON-NLS-10$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-2$
-
- private String[] javaConstants= { "false", "null", "true" }; //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$
-
- private String defaultBg;
- /**
- * Creates a Java code scanner
- *
- * @param manager the color manager
- * @param store the preference store
- */
- public JETJavaCodeScanner(JETTokenStyleManager manager, String defaultBg) {
- this.defaultBg = defaultBg;
- List rules = createRules(manager);
- IRule[] result= new IRule[rules.size()];
- rules.toArray(result);
- setRules(result);
- }
-
-
- protected List createRules(JETTokenStyleManager manager) {
- List rules= new ArrayList();
-
- // Add rule for character constants.
- IToken token= manager.requestToken("__jet_java_string_" + defaultBg,
- PreferenceConstants.EDITOR_STRING_COLOR,
- defaultBg,
- PreferenceConstants.EDITOR_STRING_BOLD,
- PreferenceConstants.EDITOR_STRING_ITALIC,
- PreferenceConstants.EDITOR_STRING_STRIKETHROUGH,
- PreferenceConstants.EDITOR_STRING_UNDERLINE);
- rules.add(new SingleLineRule("'", "'", token, '\\')); //$NON-NLS-2$ //$NON-NLS-1$
-
-
- // Add generic whitespace rule.
- //rules.add(new WhitespaceRule(new JETWhitespaceDetector()));
-
- // Add rule for multiline comments
- token= manager.requestToken("__jet_java_multi_line_comment_" + defaultBg,
- PreferenceConstants.EDITOR_MULTI_LINE_COMMENT_COLOR,
- defaultBg,
- PreferenceConstants.EDITOR_MULTI_LINE_COMMENT_BOLD,
- PreferenceConstants.EDITOR_MULTI_LINE_COMMENT_ITALIC,
- PreferenceConstants.EDITOR_MULTI_LINE_COMMENT_STRIKETHROUGH,
- PreferenceConstants.EDITOR_MULTI_LINE_COMMENT_UNDERLINE);
- MultiLineRule multiLineCommentsRule = new MultiLineRule("/*", "*/", token, '\\');
- rules.add(multiLineCommentsRule);
-
- // Add rule for single line comments
- token= manager.requestToken("__jet_java_single_line_comment_" + defaultBg,
- PreferenceConstants.EDITOR_SINGLE_LINE_COMMENT_COLOR,
- defaultBg,
- PreferenceConstants.EDITOR_SINGLE_LINE_COMMENT_BOLD,
- PreferenceConstants.EDITOR_SINGLE_LINE_COMMENT_ITALIC,
- PreferenceConstants.EDITOR_SINGLE_LINE_COMMENT_STRIKETHROUGH,
- PreferenceConstants.EDITOR_SINGLE_LINE_COMMENT_UNDERLINE);
- SingleLineRule singleLineCommentsRule = new SingleLineRule("//", null, token);
- rules.add(singleLineCommentsRule);
-
- // Add word rule for keywords,types and constants
- JavaWordDetector wordDetector= new JavaWordDetector();
- token= manager.requestToken("__jet_java_default_" + defaultBg,
- PreferenceConstants.EDITOR_JAVA_DEFAULT_COLOR,
- defaultBg,
- PreferenceConstants.EDITOR_JAVA_DEFAULT_BOLD,
- PreferenceConstants.EDITOR_JAVA_DEFAULT_ITALIC,
- PreferenceConstants.EDITOR_JAVA_DEFAULT_STRIKETHROUGH,
- PreferenceConstants.EDITOR_JAVA_DEFAULT_UNDERLINE);
- WordRule wordRule= new WordRule(wordDetector, token);
-
- token = manager.requestToken("__jet_java_keyword_" + defaultBg,
- PreferenceConstants.EDITOR_JAVA_KEYWORD_COLOR,
- defaultBg,
- PreferenceConstants.EDITOR_JAVA_KEYWORD_BOLD,
- PreferenceConstants.EDITOR_JAVA_KEYWORD_ITALIC,
- PreferenceConstants.EDITOR_JAVA_KEYWORD_STRIKETHROUGH,
- PreferenceConstants.EDITOR_JAVA_KEYWORD_UNDERLINE);
- for (int i=0; i<javaKeywords.length; i++)
- wordRule.addWord(javaKeywords[i], token);
- for (int i=0; i<javaTypes.length; i++)
- wordRule.addWord(javaTypes[i], token);
- for (int i=0; i<javaConstants.length; i++)
- wordRule.addWord(javaConstants[i], token);
- rules.add(wordRule);
-
- // Add rule for operators
- token = manager.requestToken("__jet_java_operator_" + defaultBg,
- PreferenceConstants.EDITOR_JAVA_OPERATOR_COLOR,
- defaultBg,
- PreferenceConstants.EDITOR_JAVA_OPERATOR_BOLD,
- PreferenceConstants.EDITOR_JAVA_OPERATOR_ITALIC,
- PreferenceConstants.EDITOR_JAVA_OPERATOR_STRIKETHROUGH,
- PreferenceConstants.EDITOR_JAVA_OPERATOR_UNDERLINE);;
- rules.add(new OperatorRule(token));
-
- // Add rule for brackets
- token = manager.requestToken("__jet_java_bracket_" + defaultBg,
- PreferenceConstants.EDITOR_JAVA_BRACKET_COLOR,
- defaultBg,
- PreferenceConstants.EDITOR_JAVA_BRACKET_BOLD,
- PreferenceConstants.EDITOR_JAVA_BRACKET_ITALIC,
- PreferenceConstants.EDITOR_JAVA_BRACKET_STRIKETHROUGH,
- PreferenceConstants.EDITOR_JAVA_BRACKET_UNDERLINE);;
- rules.add(new BracketRule(token));
- return rules;
- }
-}
diff --git a/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/scanners/JETJavaDeclarationScanner.java b/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/scanners/JETJavaDeclarationScanner.java
deleted file mode 100644
index 2c3f408..0000000
--- a/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/scanners/JETJavaDeclarationScanner.java
+++ /dev/null
@@ -1,34 +0,0 @@
-package org.eclipse.jet.editor.scanners;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jdt.ui.PreferenceConstants;
-import org.eclipse.jet.editor.configuration.JETEditorPreferenceConstants;
-import org.eclipse.jet.editor.configuration.JETTokenStyleManager;
-import org.eclipse.jet.editor.rules.JETBracketRule;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.text.rules.IToken;
-
-public class JETJavaDeclarationScanner extends JETJavaCodeScanner {
- public JETJavaDeclarationScanner(JETTokenStyleManager manager, IPreferenceStore preferenceStore) {
- super(manager, JETEditorPreferenceConstants.JET_DEFAULT_BG_COLOR);
- setDefaultReturnToken(manager.requestDefaultToken());
- }
-
- protected List createRules(JETTokenStyleManager manager) {
- List rules = new ArrayList();
- List parentRules = super.createRules(manager);
- IToken bracket = manager.requestToken("__jet_bracket",
- PreferenceConstants.EDITOR_JAVA_KEYWORD_COLOR,
- JETEditorPreferenceConstants.JET_DEFAULT_BG_COLOR,
- PreferenceConstants.EDITOR_JAVA_KEYWORD_BOLD,
- PreferenceConstants.EDITOR_JAVA_KEYWORD_ITALIC,
- null,
- PreferenceConstants.EDITOR_JAVA_KEYWORD_UNDERLINE);
- // Add rule for brackets
- rules.add(new JETBracketRule(bracket));
- rules.addAll(parentRules);
- return rules;
- }
-}
diff --git a/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/scanners/JETJavaExpressionScanner.java b/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/scanners/JETJavaExpressionScanner.java
deleted file mode 100644
index 440838d..0000000
--- a/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/scanners/JETJavaExpressionScanner.java
+++ /dev/null
@@ -1,41 +0,0 @@
-package org.eclipse.jet.editor.scanners;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jdt.ui.PreferenceConstants;
-import org.eclipse.jet.editor.configuration.JETEditorPreferenceConstants;
-import org.eclipse.jet.editor.configuration.JETTokenStyleManager;
-import org.eclipse.jet.editor.rules.JETBracketRule;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.text.rules.IToken;
-
-public class JETJavaExpressionScanner extends JETJavaCodeScanner {
-
- public JETJavaExpressionScanner(JETTokenStyleManager manager, IPreferenceStore preferenceStore) {
- super(manager, JETEditorPreferenceConstants.JET_EXPRESSION_BG_COLOR);
- setDefaultReturnToken(manager.requestToken("__jet_expression_default",
- PreferenceConstants.EDITOR_JAVA_KEYWORD_COLOR,
- JETEditorPreferenceConstants.JET_EXPRESSION_BG_COLOR,
- null,
- null,
- null,
- null));
- }
-
- protected List createRules(JETTokenStyleManager manager) {
- List rules = new ArrayList();
- List parentRules = super.createRules(manager);
- IToken bracket = manager.requestToken("__jet_expression_bracket",
- PreferenceConstants.EDITOR_JAVA_KEYWORD_COLOR,
- JETEditorPreferenceConstants.JET_EXPRESSION_BG_COLOR,
- PreferenceConstants.EDITOR_JAVA_KEYWORD_BOLD,
- PreferenceConstants.EDITOR_JAVA_KEYWORD_ITALIC,
- null,
- PreferenceConstants.EDITOR_JAVA_KEYWORD_UNDERLINE);
- // Add rule for brackets
- rules.add(new JETBracketRule(bracket));
- rules.addAll(parentRules);
- return rules;
- }
-}
diff --git a/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/scanners/JETJavaScriptletScanner.java b/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/scanners/JETJavaScriptletScanner.java
deleted file mode 100644
index fcec5eb..0000000
--- a/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/editor/scanners/JETJavaScriptletScanner.java
+++ /dev/null
@@ -1,35 +0,0 @@
-package org.eclipse.jet.editor.scanners;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jdt.ui.PreferenceConstants;
-import org.eclipse.jet.editor.configuration.JETEditorPreferenceConstants;
-import org.eclipse.jet.editor.configuration.JETTokenStyleManager;
-import org.eclipse.jet.editor.rules.JETBracketRule;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.text.rules.IToken;
-
-public class JETJavaScriptletScanner extends JETJavaCodeScanner {
-
- public JETJavaScriptletScanner(JETTokenStyleManager manager, IPreferenceStore preferenceStore) {
- super(manager, JETEditorPreferenceConstants.JET_DEFAULT_BG_COLOR);
- setDefaultReturnToken(manager.requestDefaultToken());
- }
-
- protected List createRules(JETTokenStyleManager manager) {
- List rules = new ArrayList();
- List parentRules = super.createRules(manager);
- IToken bracket = manager.requestToken("__jet_bracket",
- PreferenceConstants.EDITOR_JAVA_KEYWORD_COLOR,
- JETEditorPreferenceConstants.JET_DEFAULT_BG_COLOR,
- PreferenceConstants.EDITOR_JAVA_KEYWORD_BOLD,
- PreferenceConstants.EDITOR_JAVA_KEYWORD_ITALIC,
- null,
- PreferenceConstants.EDITOR_JAVA_KEYWORD_UNDERLINE);
- // Add rule for brackets
- rules.add(new JETBracketRule(bracket));
- rules.addAll(parentRules);
- return rules;
- }
-}
diff --git a/transforms/org.eclipse.jet.transforms.newproject/.classpath b/transforms/org.eclipse.jet.transforms.newproject/.classpath
deleted file mode 100644
index d4a97a3..0000000
--- a/transforms/org.eclipse.jet.transforms.newproject/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="jet2java"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/transforms/org.eclipse.jet.transforms.newproject/.cvsignore b/transforms/org.eclipse.jet.transforms.newproject/.cvsignore
deleted file mode 100644
index d3fa7b5..0000000
--- a/transforms/org.eclipse.jet.transforms.newproject/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-bin
-jet2java
diff --git a/transforms/org.eclipse.jet.transforms.newproject/.project b/transforms/org.eclipse.jet.transforms.newproject/.project
deleted file mode 100644
index b7ca7d7..0000000
--- a/transforms/org.eclipse.jet.transforms.newproject/.project
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jet.transforms.newproject</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jet.builder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.eclipse.jet.jet2Nature</nature>
- </natures>
-</projectDescription>
diff --git a/transforms/org.eclipse.jet.transforms.newproject/META-INF/MANIFEST.MF b/transforms/org.eclipse.jet.transforms.newproject/META-INF/MANIFEST.MF
deleted file mode 100644
index 90c1a69..0000000
--- a/transforms/org.eclipse.jet.transforms.newproject/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,10 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: New JET Project Transform
-Bundle-SymbolicName: org.eclipse.jet.transforms.newproject;singleton:=true
-Bundle-Version: 1.0.0
-Bundle-Localization: plugin
-Bundle-Vendor:
-JET2-TransformClass: org.eclipse.jet.compiled._jet_transformation
-Require-Bundle: org.eclipse.jet
-Bundle-ClassPath: .,bin/
diff --git a/transforms/org.eclipse.jet.transforms.newproject/about.html b/transforms/org.eclipse.jet.transforms.newproject/about.html
deleted file mode 100644
index 12a49f1..0000000
--- a/transforms/org.eclipse.jet.transforms.newproject/about.html
+++ /dev/null
@@ -1,28 +0,0 @@
-<!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>May 2, 2006</p>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
-indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
-at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, &quot;Program&quot; 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 (&quot;Redistributor&quot;) 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</a>.</p>
-
-</body>
-</html>
diff --git a/transforms/org.eclipse.jet.transforms.newproject/build.properties b/transforms/org.eclipse.jet.transforms.newproject/build.properties
deleted file mode 100644
index 291dcc1..0000000
--- a/transforms/org.eclipse.jet.transforms.newproject/build.properties
+++ /dev/null
@@ -1,13 +0,0 @@
-source.. = jet2java/
-output.. = bin/
-bin.includes = META-INF/,\
- .,\
- sample.xml,\
- templates/,\
- plugin.xml,\
- about.html,\
- newproject.xsd
-src.includes = .project,\
- build.properties,\
- .classpath,\
- about.html
diff --git a/transforms/org.eclipse.jet.transforms.newproject/newproject.xsd b/transforms/org.eclipse.jet.transforms.newproject/newproject.xsd
deleted file mode 100644
index 55c11d1..0000000
--- a/transforms/org.eclipse.jet.transforms.newproject/newproject.xsd
+++ /dev/null
@@ -1,81 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="org.eclipse.jet.transforms.newproject" xmlns="org.eclipse.jet.transforms.newproject">
-
- <xsd:element name="newProjectModel" type="newProjectModel"></xsd:element>
-
- <xsd:complexType name="newProjectModel">
- <xsd:sequence minOccurs="1">
- <xsd:element name="project" type="project" minOccurs="1"
- maxOccurs="1">
- </xsd:element>
- <xsd:any namespace="##other" minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- </xsd:complexType>
-
- <xsd:complexType name="project">
- <xsd:attribute name="name" type="xsd:string" use="required"></xsd:attribute>
- <xsd:attribute name="bundleName" type="xsd:string" use="optional">
- <xsd:annotation>
- <xsd:documentation>
- The display name of the resulting JET project. If
- not specified, this defaults to the value specified
- in the 'name' parameter.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:attribute>
- <xsd:attribute name="bundleSymbolicName" type="xsd:string" use="optional">
- <xsd:annotation>
- <xsd:documentation>
- The id of the JET project. If not specified, this
- defaults to the name of the project.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:attribute>
- <xsd:attribute name="bundleVersion" type="xsd:string" use="optional">
- <xsd:annotation>
- <xsd:documentation>
- The initial version number of the project. If not
- specified, this defaults to 1.0.0.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:attribute>
- <xsd:attribute name="bundleVendor" type="xsd:string" use="optional">
- <xsd:annotation>
- <xsd:documentation>
- The Vendor of the JET Project. If not specified,
- this defaults to the empty string.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:attribute>
- <xsd:attribute name="binDir" type="xsd:string" use="optional">
- <xsd:annotation>
- <xsd:documentation>
- The directory which will contain binary (compiled)
- Java classes. If not specified, the default is
- 'bin'.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:attribute>
- <xsd:attribute name="jet2javaDir" type="xsd:string" use="optional">
- <xsd:annotation>
- <xsd:documentation>The directory into which Java source files corresponding to JET templates will be written. The default is 'jet2java'.</xsd:documentation>
- </xsd:annotation>
- </xsd:attribute>
- <xsd:attribute name="templatesDir" type="xsd:string" use="optional">
- <xsd:annotation>
- <xsd:documentation>The directory to which initial tempates will be written. The default if 'templates'.</xsd:documentation>
- </xsd:annotation>
- </xsd:attribute>
- <xsd:attribute name="templateLoader" type="xsd:string" use="optional">
- <xsd:annotation>
- <xsd:documentation>The fully qualified Java Class name of the template loader class. The default is 'org.eclipse.jet.compiled._jet_transformation'.</xsd:documentation>
- </xsd:annotation>
- </xsd:attribute>
- <xsd:attribute name="startTemplate" type="xsd:string" use="optional">
- <xsd:annotation>
- <xsd:documentation>The path of the start template. This path is relative the the tempates directory specified by templatesDir. The default is 'main.jet'.</xsd:documentation>
- </xsd:annotation>
- </xsd:attribute>
- <xsd:anyAttribute namespace="##other"></xsd:anyAttribute>
- </xsd:complexType>
-</xsd:schema> \ No newline at end of file
diff --git a/transforms/org.eclipse.jet.transforms.newproject/plugin.xml b/transforms/org.eclipse.jet.transforms.newproject/plugin.xml
deleted file mode 100644
index b8c13be..0000000
--- a/transforms/org.eclipse.jet.transforms.newproject/plugin.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-<plugin>
- <extension
- point="org.eclipse.jet.transform">
- <transform
- private="true"
- startTemplate="templates/control.jet"
- templateLoaderClass="org.eclipse.jet.compiled._jet_transformation">
- <description>
- Generate a new JET2 project from a simple XML description.
- </description>
- <tagLibraries>
- <importLibrary
- autoImport="true"
- id="org.eclipse.jet.controlTags"
- usePrefix="c"/>
- <importLibrary
- autoImport="false"
- id="org.eclipse.jet.workspaceTags"
- usePrefix="ws"/>
- <importLibrary
- autoImport="true"
- id="org.eclipse.jet.formatTags"
- usePrefix="f"/>
- </tagLibraries>
- <enablement>
- <test
- property="extension"
- value="xml"/>
- </enablement>
- </transform>
- </extension>
-
-</plugin>
diff --git a/transforms/org.eclipse.jet.transforms.newproject/sample.xml b/transforms/org.eclipse.jet.transforms.newproject/sample.xml
deleted file mode 100644
index e17f4dd..0000000
--- a/transforms/org.eclipse.jet.transforms.newproject/sample.xml
+++ /dev/null
@@ -1,3 +0,0 @@
-<newProjectModel>
- <project name="foo.bar" bundleName="Foo Bar Project" bundleSymbolicName="foo.bar.id"/>
-</newProjectModel> \ No newline at end of file
diff --git a/transforms/org.eclipse.jet.transforms.newproject/templates/control.jet b/transforms/org.eclipse.jet.transforms.newproject/templates/control.jet
deleted file mode 100644
index 3f8ca12..0000000
--- a/transforms/org.eclipse.jet.transforms.newproject/templates/control.jet
+++ /dev/null
@@ -1,9 +0,0 @@
-<%@taglib prefix="c" id="org.eclipse.jet.controlTags" %>
-*** Control template for newproject.txm
-
-
- --- Define additional attributes for the current root element
- <c:include template="templates/createBasicProject.jet"/>
-
- <c:include template="templates/createExtendedProject.jet"/>
- \ No newline at end of file
diff --git a/transforms/org.eclipse.jet.transforms.newproject/templates/createBasicProject.jet b/transforms/org.eclipse.jet.transforms.newproject/templates/createBasicProject.jet
deleted file mode 100644
index 2ee663d..0000000
--- a/transforms/org.eclipse.jet.transforms.newproject/templates/createBasicProject.jet
+++ /dev/null
@@ -1,45 +0,0 @@
-<%@taglib prefix="c" id="org.eclipse.jet.controlTags" %>
-<%@taglib prefix="ws" id="org.eclipse.jet.workspaceTags" %>
-*** Control template for newproject.txm
-
-
- --- Define additional attributes for the current root element
- <c:setVariable select="/*[local-name() = 'newProjectModel']/project" var="project"/>
-
- --- Iterate over each nested project element
- --- Define additional attributes for the current project element
- <c:if test="not($project/@binDir)"><c:set select="$project" name="binDir">bin</c:set></c:if>
- <c:if test="not($project/@jet2javaDir)"><c:set select="$project" name="jet2javaDir">jet2java</c:set></c:if>
- <c:if test="not($project/@templatesDir)"><c:set select="$project" name="templatesDir">templates</c:set></c:if>
- <c:if test="not($project/@templateLoader)"><c:set select="$project" name="templateLoader">org.eclipse.jet.compiled._jet_transformation</c:set></c:if>
- <c:if test="not($project/@startTemplate)"><c:set select="$project" name="startTemplate">main.jet</c:set></c:if>
- <c:if test="not($project/@bundleName)"><c:set select="$project" name="bundleName"><c:get select="$project/@name"/></c:set></c:if>
- <c:if test="not($project/@bundleSymbolicName)"><c:set select="$project" name="bundleSymbolicName"><c:get select="$project/@name"/></c:set></c:if>
- <c:if test="not($project/@bundleVersion)"><c:set select="$project" name="bundleVersion">1.0.0</c:set></c:if>
- <c:if test="not($project/@bundleVendor)"><c:set select="$project" name="bundleVendor"></c:set></c:if>
-
-*** Traverse the model and generate artifacts
- --- Generate artifacts for the current root element
-
- --- Iterate over each nested project element
- --- Generate artifacts for the current project element
- <c:if test="$project/@location">
- <ws:project name="{$project/@name}" location="{$project/@location}"/>
- </c:if>
- <ws:project name="{$project/@name}">
- <ws:folder path="META-INF">
- <ws:file template="templates/project/manifest.mf.jet" path="MANIFEST.MF"/>
- </ws:folder>
- <ws:file template="templates/project/classpath.jet" path=".classpath" />
- <ws:file template="templates/project/project.jet" path=".project" />
- <ws:file template="templates/project/build.properties.jet" path="build.properties" />
- <ws:file template="templates/project/plugin.xml.jet" path="plugin.xml" />
-
- <ws:folder path="{$project/@binDir}"/>
- <ws:folder path="{$project/@jet2javaDir}"/>
- <ws:folder path="{$project/@templatesDir}">
- <ws:file template="templates/project/control.jet.jet" path="{$project/@startTemplate}" />
- <ws:file template="templates/project/dump.jet.jet" path="dump.jet" />
- </ws:folder>
- <ws:file template="templates/project/sample.xml.jet" path="sample.xml" />
- </ws:project>
diff --git a/transforms/org.eclipse.jet.transforms.newproject/templates/createExtendedProject.jet b/transforms/org.eclipse.jet.transforms.newproject/templates/createExtendedProject.jet
deleted file mode 100644
index e69de29..0000000
--- a/transforms/org.eclipse.jet.transforms.newproject/templates/createExtendedProject.jet
+++ /dev/null
diff --git a/transforms/org.eclipse.jet.transforms.newproject/templates/dump.jet b/transforms/org.eclipse.jet.transforms.newproject/templates/dump.jet
deleted file mode 100644
index a8b699e..0000000
--- a/transforms/org.eclipse.jet.transforms.newproject/templates/dump.jet
+++ /dev/null
@@ -1,2 +0,0 @@
-<?xml version="1.0" encoding="windows-1252"?>
-<dump node="/*" format="true" entities="true"/>
diff --git a/transforms/org.eclipse.jet.transforms.newproject/templates/project/build.properties.jet b/transforms/org.eclipse.jet.transforms.newproject/templates/project/build.properties.jet
deleted file mode 100644
index 060f51c..0000000
--- a/transforms/org.eclipse.jet.transforms.newproject/templates/project/build.properties.jet
+++ /dev/null
@@ -1,10 +0,0 @@
-<%@taglib prefix="c" id="org.eclipse.jet.controlTags" %>
-source.. = <c:get select="$project/@jet2javaDir" />/
-output.. = <c:get select="$project/@binDir" />/
-bin.includes = .,\
- plugin.xml,\
- META-INF/,\
- <c:get select="$project/@templatesDir" />/
-src.includes = .project,\
- build.properties,\
- .classpath
diff --git a/transforms/org.eclipse.jet.transforms.newproject/templates/project/classpath.jet b/transforms/org.eclipse.jet.transforms.newproject/templates/project/classpath.jet
deleted file mode 100644
index a973d74..0000000
--- a/transforms/org.eclipse.jet.transforms.newproject/templates/project/classpath.jet
+++ /dev/null
@@ -1,8 +0,0 @@
-<%@taglib prefix="c" id="org.eclipse.jet.controlTags"%>
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="<c:get select="$project/@jet2javaDir" default="jet2java" />"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="output" path="<c:get select="$project/@binDir" />"/>
-</classpath>
diff --git a/transforms/org.eclipse.jet.transforms.newproject/templates/project/control.jet.jet b/transforms/org.eclipse.jet.transforms.newproject/templates/project/control.jet.jet
deleted file mode 100644
index aef59b5..0000000
--- a/transforms/org.eclipse.jet.transforms.newproject/templates/project/control.jet.jet
+++ /dev/null
@@ -1,24 +0,0 @@
-<%@taglib prefix="cc" id="org.eclipse.jet.controlTags" %>
-<\%@taglib prefix="ws" id="org.eclipse.jet.workspaceTags" %>
-<\%-- Main entry point for <cc:get select="$project/@bundleSymbolicName"/> --%>
-
-<\%--
-TODO: traverse input model, performing calculations and storing
-the results as model annotations via c:set tag
---%>
-
-
-<\%--
-TODO: traverse annotated model, performing text generation actions
-such as ws:file, ws:folder and ws:project
---%>
-
-
-<\%-- For debug purposes, dump the annotated input model in
- the root of the project containing the original input model.
-
- Note that model formatting may not be identical, and that in
- the case of non-XML input models, the dump may look quite different.
---%>
-
-<ws:file template="templates/dump.jet" path="{$org.eclipse.jet.resource.project.name}/dump.xml"/>
diff --git a/transforms/org.eclipse.jet.transforms.newproject/templates/project/dump.jet.jet b/transforms/org.eclipse.jet.transforms.newproject/templates/project/dump.jet.jet
deleted file mode 100644
index 7c7996e..0000000
--- a/transforms/org.eclipse.jet.transforms.newproject/templates/project/dump.jet.jet
+++ /dev/null
@@ -1,3 +0,0 @@
-<%@taglib prefix="cc" id="org.eclipse.jet.controlTags" %>
-<?xml version="1.0" encoding="utf-8"?>
-<c:dump select="/*" format="true" entities="true"/>
diff --git a/transforms/org.eclipse.jet.transforms.newproject/templates/project/manifest.mf.jet b/transforms/org.eclipse.jet.transforms.newproject/templates/project/manifest.mf.jet
deleted file mode 100644
index f235531..0000000
--- a/transforms/org.eclipse.jet.transforms.newproject/templates/project/manifest.mf.jet
+++ /dev/null
@@ -1,9 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: <c:get select="$project/@bundleName" />
-Bundle-SymbolicName: <c:get select="$project/@bundleSymbolicName" />;singleton:=true
-Bundle-Version: <c:get select="$project/@bundleVersion"/>
-Bundle-Localization: plugin
-Bundle-Vendor:
-Require-Bundle: org.eclipse.jet
-Bundle-ClassPath: .,<c:get select="$project/@binDir"/>/
diff --git a/transforms/org.eclipse.jet.transforms.newproject/templates/project/plugin.xml.jet b/transforms/org.eclipse.jet.transforms.newproject/templates/project/plugin.xml.jet
deleted file mode 100644
index 45cf3bf..0000000
--- a/transforms/org.eclipse.jet.transforms.newproject/templates/project/plugin.xml.jet
+++ /dev/null
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-<%@taglib id="org.eclipse.jet.controlTags" prefix="c"%>
-<plugin>
- <extension
- id=""
- name=""
- point="org.eclipse.jet.transform">
- <transform
- startTemplate="<c:get select="$project/@templatesDir" />/<c:get select="$project/@startTemplate" />"
- templateLoaderClass="<c:get select="$project/@templateLoader" />" >
- <description></description>
- <tagLibraries>
- <importLibrary id="org.eclipse.jet.controlTags" usePrefix="c" autoImport="true"/>
- <importLibrary id="org.eclipse.jet.javaTags" usePrefix="java" autoImport="true"/>
- <importLibrary id="org.eclipse.jet.formatTags" usePrefix="f" autoImport="true"/>
- <importLibrary id="org.eclipse.jet.workspaceTags" usePrefix="ws" autoImport="false"/>
- </tagLibraries>
- </transform>
- </extension>
-</plugin> \ No newline at end of file
diff --git a/transforms/org.eclipse.jet.transforms.newproject/templates/project/project.jet b/transforms/org.eclipse.jet.transforms.newproject/templates/project/project.jet
deleted file mode 100644
index 13f31e6..0000000
--- a/transforms/org.eclipse.jet.transforms.newproject/templates/project/project.jet
+++ /dev/null
@@ -1,30 +0,0 @@
-<%@taglib prefix="c" id="org.eclipse.jet.controlTags"%>
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name><c:get select="$project/@name" /></name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jet.builder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.eclipse.jet.jet2Nature</nature>
- </natures>
-</projectDescription>
diff --git a/transforms/org.eclipse.jet.transforms.newproject/templates/project/sample.xml.jet b/transforms/org.eclipse.jet.transforms.newproject/templates/project/sample.xml.jet
deleted file mode 100644
index 84ff56b..0000000
--- a/transforms/org.eclipse.jet.transforms.newproject/templates/project/sample.xml.jet
+++ /dev/null
@@ -1,3 +0,0 @@
-<root>
-
-</root> \ No newline at end of file
diff --git a/transforms/org.eclipse.jet.transforms.taglibdoc/.classpath b/transforms/org.eclipse.jet.transforms.taglibdoc/.classpath
deleted file mode 100644
index d4a97a3..0000000
--- a/transforms/org.eclipse.jet.transforms.taglibdoc/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="jet2java"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/transforms/org.eclipse.jet.transforms.taglibdoc/.cvsignore b/transforms/org.eclipse.jet.transforms.taglibdoc/.cvsignore
deleted file mode 100644
index d3fa7b5..0000000
--- a/transforms/org.eclipse.jet.transforms.taglibdoc/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-bin
-jet2java
diff --git a/transforms/org.eclipse.jet.transforms.taglibdoc/.project b/transforms/org.eclipse.jet.transforms.taglibdoc/.project
deleted file mode 100644
index 5fe0077..0000000
--- a/transforms/org.eclipse.jet.transforms.taglibdoc/.project
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jet.transforms.taglibdoc</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jet.builder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.eclipse.jet.jet2Nature</nature>
- </natures>
-</projectDescription>
diff --git a/transforms/org.eclipse.jet.transforms.taglibdoc/META-INF/MANIFEST.MF b/transforms/org.eclipse.jet.transforms.taglibdoc/META-INF/MANIFEST.MF
deleted file mode 100644
index 3108d6d..0000000
--- a/transforms/org.eclipse.jet.transforms.taglibdoc/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,10 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: Generate JET Taglib Documentation
-Bundle-SymbolicName: org.eclipse.jet.transforms.taglibdoc;singleton:=true
-Bundle-Version: 1.0.0
-Bundle-Localization: plugin
-Bundle-Vendor:
-JET2-TransformClass: org.eclipse.jet.compiled._jet_transformation
-Require-Bundle: org.eclipse.jet
-Bundle-ClassPath: .,bin/
diff --git a/transforms/org.eclipse.jet.transforms.taglibdoc/about.html b/transforms/org.eclipse.jet.transforms.taglibdoc/about.html
deleted file mode 100644
index 12a49f1..0000000
--- a/transforms/org.eclipse.jet.transforms.taglibdoc/about.html
+++ /dev/null
@@ -1,28 +0,0 @@
-<!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>May 2, 2006</p>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
-indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
-at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, &quot;Program&quot; 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 (&quot;Redistributor&quot;) 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</a>.</p>
-
-</body>
-</html>
diff --git a/transforms/org.eclipse.jet.transforms.taglibdoc/build.properties b/transforms/org.eclipse.jet.transforms.taglibdoc/build.properties
deleted file mode 100644
index 2b0eb30..0000000
--- a/transforms/org.eclipse.jet.transforms.taglibdoc/build.properties
+++ /dev/null
@@ -1,12 +0,0 @@
-source.. = jet2java/
-output.. = bin/
-bin.includes = META-INF/,\
- .,\
- sample.xml,\
- templates/,\
- plugin.xml,\
- about.html
-src.includes = .project,\
- build.properties,\
- .classpath,\
- about.html
diff --git a/transforms/org.eclipse.jet.transforms.taglibdoc/plugin.xml b/transforms/org.eclipse.jet.transforms.taglibdoc/plugin.xml
deleted file mode 100644
index 42f51ed..0000000
--- a/transforms/org.eclipse.jet.transforms.taglibdoc/plugin.xml
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-<plugin>
- <extension
- point="org.eclipse.jet.transform">
- <transform
- startTemplate="templates/control.jet"
- templateLoaderClass="org.eclipse.jet.compiled._jet_transformation">
- <description>
- Generate HTML Documentation from a plugin.xml containing a org.eclipse.jet.tagLibraries extension point.
- </description>
- <tagLibraries>
- <importLibrary
- autoImport="true"
- id="org.eclipse.jet.controlTags"
- usePrefix="c"/>
- <importLibrary
- autoImport="false"
- id="org.eclipse.jet.workspaceTags"
- usePrefix="ws"/>
- <importLibrary
- autoImport="true"
- id="org.eclipse.jet.formatTags"
- usePrefix="f"/>
- </tagLibraries>
- <enablement>
- <test
- property="matchesName"
- value="plugin.xml"/>
- </enablement>
- </transform>
- </extension>
-
-</plugin>
diff --git a/transforms/org.eclipse.jet.transforms.taglibdoc/sample.xml b/transforms/org.eclipse.jet.transforms.taglibdoc/sample.xml
deleted file mode 100644
index 84ff56b..0000000
--- a/transforms/org.eclipse.jet.transforms.taglibdoc/sample.xml
+++ /dev/null
@@ -1,3 +0,0 @@
-<root>
-
-</root> \ No newline at end of file
diff --git a/transforms/org.eclipse.jet.transforms.taglibdoc/templates/allTags/tag.html.jet b/transforms/org.eclipse.jet.transforms.taglibdoc/templates/allTags/tag.html.jet
deleted file mode 100644
index b2757a2..0000000
--- a/transforms/org.eclipse.jet.transforms.taglibdoc/templates/allTags/tag.html.jet
+++ /dev/null
@@ -1,165 +0,0 @@
-<%@taglib prefix="c" id="org.eclipse.jet.controlTags"%>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<HTML>
-<HEAD>
-<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
-<META name="GENERATOR" content="IBM Software Development Platform">
-<link rel="STYLESHEET" href="../../../book.css" charset="ISO-8859-1" type="text/css"/>
-<TITLE>&lt;<c:get select="$tag/@tagQName" />&gt; - <c:get select="$tagLibrary/@name" /></TITLE>
-</HEAD>
-<BODY>
-<TABLE border="0" cellpadding="0" cellspacing="1" width="100%">
- <TBODY>
- <TR>
- <TH align="left">
- <P>&lt;<c:get select="$tag/@tagQName" />&gt;</P></TH>
- <TH align="right"><A href="overview.html"><c:get select="$tagLibrary/@name" /></A></TH>
- </TR>
- </TBODY>
-</TABLE>
-<HR>
-<P><B><c:get select="$tag/@name" /></B></P>
-<P><c:get select="$tag/@description"/></P>
-<HR>
-<TABLE border="1" width="100%">
- <TBODY>
- <TR>
- <TH colspan="2" align="left">Tag Summary</TH></TR>
- <TR>
- <TD width="10%">required</TD>
- <TD><SPAN style="font-family: monospace">
-<c:choose>
-<c:when test="local-name($tag) = 'iteratingTag'">
- &lt;<c:get select="$tag/@requiredTagInnards"/>&gt;<br>
- &nbsp;&nbsp;&nbsp;&nbsp;<I>content to be repeated for each iteration</I><BR>
- &lt;/<c:get select="$tag/@tagQName" />&gt;
-</c:when>
-<c:when test="local-name($tag) = 'emptyTag'">
- &lt;<c:get select="$tag/@requiredTagInnards"/>/&gt;<br>
-</c:when>
-<c:when test="local-name($tag) = 'conditionalTag'">
- &lt;<c:get select="$tag/@requiredTagInnards"/>&gt;<br>
- &nbsp;&nbsp;&nbsp;&nbsp;<I>content to process if tag condition is
- satisfied</I><BR>
- &lt;/<c:get select="$tag/@tagQName" />&gt;
-</c:when>
-<c:when test="local-name($tag) = 'containerTag'">
- &lt;<c:get select="$tag/@requiredTagInnards"/>&gt;<br>
- &nbsp;&nbsp;&nbsp;&nbsp;<I>content to be written</I><BR>
- &lt;/<c:get select="$tag/@tagQName" />&gt;
-</c:when>
-<c:when test="local-name($tag) = 'functionTag'">
- &lt;<c:get select="$tag/@requiredTagInnards"/>&gt;<br>
- &nbsp;&nbsp;&nbsp;&nbsp;<I>content consumed by tag evaluation</I><BR>
- &lt;/<c:get select="$tag/@tagQName" />&gt;
-</c:when>
-</c:choose>
- </SPAN></TD>
- </TR>
- <TR>
- <TD width="10%">full tag</TD>
- <TD><SPAN style="font-family: monospace">
-<c:choose>
-<c:when test="local-name($tag) = 'iteratingTag'">
- &lt;<c:get select="$tag/@allTagInnards"/>&gt;<br>
- &nbsp;&nbsp;&nbsp;&nbsp;<I>content to be repeated for each iteration</I><BR>
- &lt;/<c:get select="$tag/@tagQName" />&gt;
-</c:when>
-<c:when test="local-name($tag) = 'emptyTag'">
- &lt;<c:get select="$tag/@allTagInnards"/>/&gt;<br>
-</c:when>
-<c:when test="local-name($tag) = 'conditionalTag'">
- &lt;<c:get select="$tag/@allTagInnards"/>&gt;<br>
- &nbsp;&nbsp;&nbsp;&nbsp;<I>content to process if tag condition is
- satisfied</I><BR>
- &lt;/<c:get select="$tag/@tagQName" />&gt;
-</c:when>
-<c:when test="local-name($tag) = 'containerTag'">
- &lt;<c:get select="$tag/@allTagInnards"/>&gt;<br>
- &nbsp;&nbsp;&nbsp;&nbsp;<I>content to be written</I><BR>
- &lt;/<c:get select="$tag/@tagQName" />&gt;
-</c:when>
-<c:when test="local-name($tag) = 'functionTag'">
- &lt;<c:get select="$tag/@allTagInnards"/>&gt;<br>
- &nbsp;&nbsp;&nbsp;&nbsp;<I>content consumed by tag evaluation</I><BR>
- &lt;/<c:get select="$tag/@tagQName" />&gt;
-</c:when>
-</c:choose>
- </SPAN></TD>
- </TR>
- </TBODY>
-</TABLE>
-<c:if test="$tag/attribute[@use='required' or not(@use)]">
-<HR>
-<TABLE border="1" width="100%">
- <TBODY>
- <TR>
- <TH colspan="2" align="left">Required Attributes</TH></TR>
-<c:iterate select="$tag/attribute[@use='required']" var="attribute" >
- <TR>
- <TD width="10%"><c:get select="$attribute/@name" /></TD>
- <TD><c:get select="$attribute/@description"/></TD>
- </TR>
-</c:iterate>
- </TBODY>
-</TABLE>
-</c:if>
-<c:if test="$tag/attribute[@use!='required']">
-<HR>
-<TABLE border="1" width="100%">
- <TBODY>
- <TR>
- <TH colspan="2" align="left">Optional Attributes</TH></TR>
- <TR>
-<c:iterate select="$tag/attribute[@use!='required']" var="attribute" >
- <TR>
- <TD width="10%"><c:get select="$attribute/@name" /></TD>
- <TD><c:get select="$attribute/@description"/></TD>
- </TR>
-</c:iterate>
- </TBODY>
-</TABLE>
-</c:if>
-<HR>
-<TABLE border="1" width="100%">
- <TBODY>
- <TR>
- <TH colspan="2" align="left">Example</TH></TR>
- <TR>
- <TD width="10%"></TD>
- <TD><SPAN style="font-family: monospace">
-<c:userRegion><!-- Begin <c:get select="$tag/@name" /> example -->
-<c:initialCode>
-<c:choose>
-<c:when test="local-name($tag) = 'iteratingTag'">
- &lt;<c:get select="$tag/@requiredTagInnards"/>&gt;<br>
- &nbsp;&nbsp;&nbsp;&nbsp;<I>content to be repeated for each iteration</I><BR>
- &lt;/<c:get select="$tag/@tagQName" />&gt;
-</c:when>
-<c:when test="local-name($tag) = 'emptyTag'">
- &lt;<c:get select="$tag/@requiredTagInnards"/>/&gt;<br>
-</c:when>
-<c:when test="local-name($tag) = 'conditionalTag'">
- &lt;<c:get select="$tag/@requiredTagInnards"/>&gt;<br>
- &nbsp;&nbsp;&nbsp;&nbsp;<I>content to process if tag condition is
- satisfied</I><BR>
- &lt;/<c:get select="$tag/@tagQName" />&gt;
-</c:when>
-<c:when test="local-name($tag) = 'containerTag'">
- &lt;<c:get select="$tag/@requiredTagInnards"/>&gt;<br>
- &nbsp;&nbsp;&nbsp;&nbsp;<I>content to be written</I><BR>
- &lt;/<c:get select="$tag/@tagQName" />&gt;
-</c:when>
-<c:when test="local-name($tag) = 'functionTag'">
- &lt;<c:get select="$tag/@requiredTagInnards"/>&gt;<br>
- &nbsp;&nbsp;&nbsp;&nbsp;<I>content consumed by tag evaluation</I><BR>
- &lt;/<c:get select="$tag/@tagQName" />&gt;
-</c:when>
-</c:choose>
-</c:initialCode><!-- End <c:get select="$tag/@name" /> example --></c:userRegion>
-</SPAN></TD>
- </TR>
- </TBODY>
-</TABLE>
-<P></P></BODY>
-</HTML>
diff --git a/transforms/org.eclipse.jet.transforms.taglibdoc/templates/control.jet b/transforms/org.eclipse.jet.transforms.taglibdoc/templates/control.jet
deleted file mode 100644
index c6c4ef5..0000000
--- a/transforms/org.eclipse.jet.transforms.taglibdoc/templates/control.jet
+++ /dev/null
@@ -1,90 +0,0 @@
-<%@taglib prefix="c" id="org.eclipse.jet.controlTags" %>
-<%@taglib prefix="f" id="org.eclipse.jet.formatTags" %>
-<%@taglib prefix="ws" id="org.eclipse.jet.workspaceTags" %>
-
-*** Control template for Generate JET2 Tag Documentation
-
-<%-- Define variables for standard items --%>
-<c:setVariable var="jetPluginNS" select="'org.eclipse.jet'"/>
-<c:setVariable var="tagLibrariesXP" select="concat($jetPluginNS, '.tagLibraries')"/>
-<%-- XXX Hack. This should be picked up from the plug-in itself. To do this we need
- 1) the ability to readn Manifest.MF files with JET
- 2) the ability to discover the project containing the input (plugin.xml)
- We're not there yet.
---%>
-<c:setVariable var="pluginNS" select="$org.eclipse.jet.resource.project.name"/>
-<c:setVariable var="docPlugin" select="concat($org.eclipse.jet.resource.project.name, '.doc')"/>
-
- --- Define additional attributes for the current plugin element
-
- --- Iterate over each nested extension element
- <c:iterate select="/plugin/extension[@point = $tagLibrariesXP]" var="extension">
- --- Define additional attributes for the current extension element
-
- --- Iterate over each nested tagLibrary element
- <c:iterate select="$extension/tagLibrary" var="tagLibrary">
- --- Define additional attributes for the current tagLibrary element
- <c:set select="$tagLibrary" name="htmlDir">references/taglibs/<c:get select="$tagLibrary/@id"/><%-- TODO format=QC --%></c:set>
- <c:set select="$tagLibrary" name="tocXmlFile">toc<c:get select="$tagLibrary/@id"/><%-- TODO format="QC" --%>.xml</c:set>
- <c:set select="$tagLibrary" name="tocXmlDir"></c:set>
- <c:set select="$tagLibrary" name="tagPrefix"></c:set>
- <c:if test="$tagLibrary/@standardPrefix">
- <c:set select="$tagLibrary" name="tagPrefix"><c:get select="$tagLibrary/@standardPrefix"/>:</c:set>
- </c:if>
- <c:set select="$tagLibrary" name="description">TODO Define description of <c:get select="$tagLibrary/@name"/></c:set>
- <c:if test="$tagLibrary/description">
- <c:set select="$tagLibrary" name="description"><f:replaceAll value="\r?\n" replacement="<P>" regex="true"><c:get select="$tagLibrary/description"/></f:replaceAll></c:set>
- </c:if>
-
- --- Iterate over each nested conditionalTag element
- <c:iterate select="$tagLibrary/*[local-name() != 'description']" var="tag">
- --- Define additional attributes for the current conditionalTag element
- <c:set select="$tag" name="tagHtmlFile"><c:get select="$tag/@name" />Tag.html</c:set>
- <c:set select="$tag" name="tagQName"><c:get select="$tagLibrary/@tagPrefix"/><c:get select="$tag/@name" /></c:set>
- <c:set select="$tag" name="requiredAttrs"><c:iterate select="$tag/attribute[@use='required']" var="attribute"> <c:get select="$attribute/@name" />=&quot;<I>value</I>&quot;</c:iterate></c:set>
- <c:set select="$tag" name="optionalAttrs"><c:iterate select="$tag/attribute[@use!='required']" var="attribute"> <c:get select="$attribute/@name" />=&quot;<I>value</I>&quot;</c:iterate></c:set>
- <c:set select="$tag" name="requiredTagInnards"><c:get select="$tag/@tagQName" /><c:get select="$tag/@requiredAttrs"/></c:set>
- <c:set select="$tag" name="allTagInnards"><c:get select="$tag/@tagQName" /><c:get select="$tag/@requiredAttrs"/><c:get select="$tag/@optionalAttrs"/></c:set>
- <c:set select="$tag" name="description">TODO Define description of <c:get select="$tag/@name"/></c:set>
- <c:if test="$tag/description">
- <c:set select="$tag" name="description"><f:replaceAll value="\r?\n" replacement="<P>" regex="true"><c:get select="$tag/description"/></f:replaceAll></c:set>
- </c:if>
- --- Iterate over each nested attribute element
- <c:iterate select="$tag/attribute" var="attribute">
- --- Define additional attributes for the current attribute element
- <c:set select="$attribute" name="description">TODO Define description of <c:get select="$attribute/@name"/></c:set>
- <c:if test="$attribute/description">
- <c:set select="$attribute" name="description"><f:replaceAll value="\r?\n" replacement="<BR>" regex="true"><c:get select="$attribute/description"/></f:replaceAll></c:set>
- </c:if>
- </c:iterate>
- </c:iterate>
-
- </c:iterate>
- </c:iterate>
-
-*** Traverse the model and generate artifacts
- --- Generate artifacts for the current plugin element
-
- --- Iterate over each nested extension element
- <c:iterate select="/plugin/extension[@point = $tagLibrariesXP]" var="extension">
- --- Generate artifacts for the current extension element
-
- --- Iterate over each nested tagLibrary element
- <c:iterate select="$extension/tagLibrary" var="tagLibrary">
- --- Generate artifacts for the current tagLibrary element
- <ws:file template="templates/tagLibrary/overview.html.jet" path="{$docPlugin}/{$tagLibrary/@htmlDir}/overview.html" />
- <ws:file template="templates/tagLibrary/toc.xml.jet" path="{$docPlugin}/{$tagLibrary/@tocXmlDir}/{$tagLibrary/@tocXmlFile}" />
-
- --- Iterate over each nested conditionalTag element
- <c:iterate select="$tagLibrary/*[local-name() != 'description']" var="tag">
- --- Generate artifacts for the current conditionalTag element
- <ws:file template="templates/allTags/tag.html.jet" path="{$docPlugin}/{$tagLibrary/@htmlDir}/{$tag/@tagHtmlFile}"/>
-
- </c:iterate>
- </c:iterate>
- </c:iterate>
-
-*** Dump the transformed model for testing and debug purposes
-
-
-
diff --git a/transforms/org.eclipse.jet.transforms.taglibdoc/templates/dump.jet b/transforms/org.eclipse.jet.transforms.taglibdoc/templates/dump.jet
deleted file mode 100644
index a8b699e..0000000
--- a/transforms/org.eclipse.jet.transforms.taglibdoc/templates/dump.jet
+++ /dev/null
@@ -1,2 +0,0 @@
-<?xml version="1.0" encoding="windows-1252"?>
-<dump node="/*" format="true" entities="true"/>
diff --git a/transforms/org.eclipse.jet.transforms.taglibdoc/templates/tagLibrary/overview.html.jet b/transforms/org.eclipse.jet.transforms.taglibdoc/templates/tagLibrary/overview.html.jet
deleted file mode 100644
index 3e65fd2..0000000
--- a/transforms/org.eclipse.jet.transforms.taglibdoc/templates/tagLibrary/overview.html.jet
+++ /dev/null
@@ -1,53 +0,0 @@
-<%@taglib prefix="c" id="org.eclipse.jet.controlTags"%>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<HTML>
-<HEAD>
-<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
-<link rel="STYLESHEET" href="../../../book.css" charset="ISO-8859-1" type="text/css"/>
-<TITLE>overview.html</TITLE>
-</HEAD>
-<BODY>
-<TABLE border="0" cellpadding="0" cellspacing="1" width="100%">
-
- <TBODY>
- <TR>
- <TH align="left">
- <P>Overview</P>
- </TH>
- <TH align="right"><c:get select="$tagLibrary/@name" /></TH>
- </TR>
- </TBODY>
-</TABLE>
-<P><c:get select="$tagLibrary/@id" /></P>
-<P><c:get select="$tagLibrary/@description"/></P>
-<HR>
-<TABLE border="1" width="100%">
- <TBODY>
- <TR>
- <TH colspan="2" align="left">Tag Summary</TH></TR>
-<c:iterate select="$tagLibrary/*[local-name() != 'description']" var="tag" >
- <TR>
- <TD width="10%"><A href="<c:get select="$tag/@tagHtmlFile" />">&lt;<c:get select="$tag/@tagQName" />&gt;</A></TD>
- <TD><%--<roundtrip>--%><!-- Begin <c:get select="$tag/@name" /> description -->
- <%--<initialCode>--%><c:choose><c:when test="contains($tag/@description, '.')"><c:get select="substring-before($tag/@description,'.')"/></c:when><c:otherwise><c:get select="$tag/@description"/></c:otherwise></c:choose><%--</initialCode>--%>
- <!-- End <c:get select="$tag/@name" /> description -->
- <%--</roundtrip>--%></TD>
- </TR>
-</c:iterate>
- </TBODY>
-</TABLE>
-<HR>
-<TABLE border="1" width="100%">
- <TBODY>
- <TR>
- <TH colspan="2" align="left">Example Directive</TH></TR>
- <TR>
- <TD width="10%"></TD>
- <TD><SPAN style="font-family: sans-serif"><SPAN
- style="font-family: monospace">&lt;%@taglib prefix=&quot;<c:get select="$tagLibrary/@standardPrefix"/>&quot;
- id=&quot;<c:get select="$pluginNS"/>.<c:get select="$tagLibrary/@id" />&quot;%&gt;</SPAN></SPAN></TD>
- </TR>
- </TBODY>
-</TABLE>
-</BODY>
-</HTML>
diff --git a/transforms/org.eclipse.jet.transforms.taglibdoc/templates/tagLibrary/toc.xml.jet b/transforms/org.eclipse.jet.transforms.taglibdoc/templates/tagLibrary/toc.xml.jet
deleted file mode 100644
index 5558359..0000000
--- a/transforms/org.eclipse.jet.transforms.taglibdoc/templates/tagLibrary/toc.xml.jet
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?NLS TYPE="org.eclipse.help.toc"?>
-<%@taglib prefix="c" id="org.eclipse.jet.controlTags"%>
-
-<toc label="<c:get select="$tagLibrary/@name" />" link_to="toc.xml#tagReference">
- <topic label="<c:get select="$tagLibrary/@name" />" href="<c:get select="$tagLibrary/@htmlDir" />/overview.html" >
-<c:iterate select="$tagLibrary/*[local-name()!='description']" var="tag">
- <topic label="<c:get select="$tag/@tagQName" />" href="<c:get select="$tagLibrary/@htmlDir" />/<c:get select="$tag/@tagHtmlFile" />"/>
-</c:iterate>
- </topic>
-</toc>

Back to the top