Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpelder2010-02-23 16:20:51 -0500
committerpelder2010-02-23 16:20:51 -0500
commit364d51e31c1b26fadac7cf0e822de151cc81b29a (patch)
treecbbbf782949144f0b2c077ff75fdd1d6861e37cb
parentdf29b673e8b388672247d439704962d7e873e1a2 (diff)
downloadorg.eclipse.jet-364d51e31c1b26fadac7cf0e822de151cc81b29a.tar.gz
org.eclipse.jet-364d51e31c1b26fadac7cf0e822de151cc81b29a.tar.xz
org.eclipse.jet-364d51e31c1b26fadac7cf0e822de151cc81b29a.zip
[295809] Restore "skeleton" or add an "extends" configuration
-rw-r--r--doc/org.eclipse.jet.doc-feature/feature.xml2
-rw-r--r--doc/org.eclipse.jet.doc/META-INF/MANIFEST.MF2
-rw-r--r--plugins/org.eclipse.jet.core/META-INF/MANIFEST.MF2
-rw-r--r--plugins/org.eclipse.jet.core/src/org/eclipse/jet/core/parser/ast/JETCompilationUnit.java23
-rw-r--r--plugins/org.eclipse.jet.core/src/org/eclipse/jet/internal/core/parser/InternalJET1Parser.java7
-rw-r--r--plugins/org.eclipse.jet.core/src/org/eclipse/jet/internal/core/parser/InternalJET2Parser.java8
-rw-r--r--plugins/org.eclipse.jet.editor-feature/feature.xml2
-rw-r--r--plugins/org.eclipse.jet.editor/META-INF/MANIFEST.MF2
-rw-r--r--plugins/org.eclipse.jet.editor/src/org/eclipse/jet/internal/editor/contentassist/JETDirectiveAssistProcessor.java2
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/templates/v1/JET1JavaGenerator.java7
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/templates/v2/JET2JavaGeneratorNew.java7
-rw-r--r--plugins/org.eclipse.jet/templates/v1/jet2java.jet5
-rw-r--r--plugins/org.eclipse.jet/templates/v2/jet2java.jet5
13 files changed, 63 insertions, 11 deletions
diff --git a/doc/org.eclipse.jet.doc-feature/feature.xml b/doc/org.eclipse.jet.doc-feature/feature.xml
index 0e8f48e..c541720 100644
--- a/doc/org.eclipse.jet.doc-feature/feature.xml
+++ b/doc/org.eclipse.jet.doc-feature/feature.xml
@@ -2,7 +2,7 @@
<feature
id="org.eclipse.jet.doc"
label="%featureName"
- version="1.0.1.qualifier"
+ version="1.1.0.qualifier"
provider-name="%providerName">
<description>
diff --git a/doc/org.eclipse.jet.doc/META-INF/MANIFEST.MF b/doc/org.eclipse.jet.doc/META-INF/MANIFEST.MF
index f930c16..134ddce 100644
--- a/doc/org.eclipse.jet.doc/META-INF/MANIFEST.MF
+++ b/doc/org.eclipse.jet.doc/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %Plugin.name
Bundle-SymbolicName: org.eclipse.jet.doc; singleton:=true
-Bundle-Version: 1.0.1.qualifier
+Bundle-Version: 1.1.0.qualifier
Bundle-Vendor: %Provider.name
Bundle-Localization: plugin
Require-Bundle: org.eclipse.help;bundle-version="[3.2.0,4.0.0)"
diff --git a/plugins/org.eclipse.jet.core/META-INF/MANIFEST.MF b/plugins/org.eclipse.jet.core/META-INF/MANIFEST.MF
index e64e61b..ae5c90e 100644
--- a/plugins/org.eclipse.jet.core/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.jet.core/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.jet.core
-Bundle-Version: 1.1.101.qualifier
+Bundle-Version: 1.2.0.qualifier
Bundle-Localization: plugin
Eclipse-LazyStart: true
Export-Package: org.eclipse.jet,
diff --git a/plugins/org.eclipse.jet.core/src/org/eclipse/jet/core/parser/ast/JETCompilationUnit.java b/plugins/org.eclipse.jet.core/src/org/eclipse/jet/core/parser/ast/JETCompilationUnit.java
index 31b5b6a..f43d8a4 100644
--- a/plugins/org.eclipse.jet.core/src/org/eclipse/jet/core/parser/ast/JETCompilationUnit.java
+++ b/plugins/org.eclipse.jet.core/src/org/eclipse/jet/core/parser/ast/JETCompilationUnit.java
@@ -10,7 +10,7 @@
*
* </copyright>
*
- * $Id: JETCompilationUnit.java,v 1.5 2007/06/01 20:26:19 pelder Exp $
+ * $Id: JETCompilationUnit.java,v 1.6 2010/02/23 21:20:50 pelder Exp $
* /
*******************************************************************************/
@@ -57,6 +57,11 @@ public final class JETCompilationUnit extends JETASTElement {
private final String encoding;
/**
+ * Optional generated template class name extension. May be <code>null</code>
+ */
+ private String extend = null;
+
+ /**
* Create a JET2Compilation Unit
*
* @param ast
@@ -257,6 +262,22 @@ public final class JETCompilationUnit extends JETASTElement {
}
/**
+ * Set/override generated template class name extension.
+ * @param extend generated template class name extension. May be <code>null</code>
+ */
+ public void setExtend(final String extend) {
+ this.extend = extend;
+ }
+
+ /**
+ * Return generated template class name extension. May be <code>null</code>
+ * @return generated template class name extension. May be <code>null</code>
+ */
+ public String getExtend() {
+ return extend;
+ }
+
+ /**
* Set the tag libraries referenced by this template
*
* @param tagLibraryReferences
diff --git a/plugins/org.eclipse.jet.core/src/org/eclipse/jet/internal/core/parser/InternalJET1Parser.java b/plugins/org.eclipse.jet.core/src/org/eclipse/jet/internal/core/parser/InternalJET1Parser.java
index 481cafb..9a7b023 100644
--- a/plugins/org.eclipse.jet.core/src/org/eclipse/jet/internal/core/parser/InternalJET1Parser.java
+++ b/plugins/org.eclipse.jet.core/src/org/eclipse/jet/internal/core/parser/InternalJET1Parser.java
@@ -10,7 +10,7 @@
*
* </copyright>
*
- * $Id: InternalJET1Parser.java,v 1.4 2009/04/06 17:55:06 pelder Exp $
+ * $Id: InternalJET1Parser.java,v 1.5 2010/02/23 21:20:50 pelder Exp $
* /
*******************************************************************************/
@@ -311,6 +311,7 @@ public class InternalJET1Parser implements JETParseEventListener2, IJETParser, I
"startTag", //$NON-NLS-1$
"endTag", //$NON-NLS-1$
"version", //$NON-NLS-1$
+ "extends", //$NON-NLS-1$
}));
private static Set deprecatedJETAttributes = new LinkedHashSet(Arrays
@@ -344,6 +345,7 @@ public class InternalJET1Parser implements JETParseEventListener2, IJETParser, I
String importStr = (String) attributes.get("imports"); //$NON-NLS-1$
String startTag = (String) attributes.get("startTag"); //$NON-NLS-1$
String endTag = (String) attributes.get("endTag"); //$NON-NLS-1$
+ String extend = (String) attributes.get("extends"); //$NON-NLS-1$
if (pkg != null) {
compilationUnit.setOutputJavaPackage(pkg);
@@ -355,6 +357,9 @@ public class InternalJET1Parser implements JETParseEventListener2, IJETParser, I
String[] imports = importStr.split("\\s+"); //$NON-NLS-1$
compilationUnit.addImports(Arrays.asList(imports));
}
+ if (extend != null) {
+ compilationUnit.setExtend(extend);
+ }
if (startTag != null) {
parser.setStartTag(startTag);
diff --git a/plugins/org.eclipse.jet.core/src/org/eclipse/jet/internal/core/parser/InternalJET2Parser.java b/plugins/org.eclipse.jet.core/src/org/eclipse/jet/internal/core/parser/InternalJET2Parser.java
index bbdb455..3c6d38b 100644
--- a/plugins/org.eclipse.jet.core/src/org/eclipse/jet/internal/core/parser/InternalJET2Parser.java
+++ b/plugins/org.eclipse.jet.core/src/org/eclipse/jet/internal/core/parser/InternalJET2Parser.java
@@ -10,7 +10,7 @@
*
* </copyright>
*
- * $Id: InternalJET2Parser.java,v 1.4 2009/08/20 13:43:13 pelder Exp $
+ * $Id: InternalJET2Parser.java,v 1.5 2010/02/23 21:20:50 pelder Exp $
* /
*******************************************************************************/
@@ -142,6 +142,7 @@ public class InternalJET2Parser implements JETParseEventListener2, IJETParser
"startTag", //$NON-NLS-1$
"endTag", //$NON-NLS-1$
"version", //$NON-NLS-1$
+ "extends", //$NON-NLS-1$
}));
private static Set deprecatedJETAttributes =
new LinkedHashSet(Arrays.asList(new String[] {
@@ -174,6 +175,7 @@ public class InternalJET2Parser implements JETParseEventListener2, IJETParser
String importStr = (String)attributes.get("imports"); //$NON-NLS-1$
String startTag = (String)attributes.get("startTag"); //$NON-NLS-1$
String endTag = (String)attributes.get("endTag"); //$NON-NLS-1$
+ String extend = (String)attributes.get("extends"); //$NON-NLS-1$
if(pkg != null)
{
@@ -197,6 +199,10 @@ public class InternalJET2Parser implements JETParseEventListener2, IJETParser
{
parser.setEndTag(endTag);
}
+ if(extend != null)
+ {
+ compilationUnit.setExtend(extend);
+ }
}
/**
diff --git a/plugins/org.eclipse.jet.editor-feature/feature.xml b/plugins/org.eclipse.jet.editor-feature/feature.xml
index 9275d01..d70c2dc 100644
--- a/plugins/org.eclipse.jet.editor-feature/feature.xml
+++ b/plugins/org.eclipse.jet.editor-feature/feature.xml
@@ -2,7 +2,7 @@
<feature
id="org.eclipse.jet.editor"
label="%featureName"
- version="1.0.0.qualifier"
+ version="1.1.0.qualifier"
provider-name="%providerName">
<description>
diff --git a/plugins/org.eclipse.jet.editor/META-INF/MANIFEST.MF b/plugins/org.eclipse.jet.editor/META-INF/MANIFEST.MF
index 5e8a0ce..dcdea06 100644
--- a/plugins/org.eclipse.jet.editor/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.jet.editor/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.jet.editor; singleton:=true
-Bundle-Version: 1.0.0.qualifier
+Bundle-Version: 1.1.0.qualifier
Bundle-Activator: org.eclipse.jet.internal.editor.Activator
Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.2.0,4.0.0)",
org.eclipse.core.resources;bundle-version="[3.2.0,4.0.0)",
diff --git a/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/internal/editor/contentassist/JETDirectiveAssistProcessor.java b/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/internal/editor/contentassist/JETDirectiveAssistProcessor.java
index 3b48a71..8986751 100644
--- a/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/internal/editor/contentassist/JETDirectiveAssistProcessor.java
+++ b/plugins/org.eclipse.jet.editor/src/org/eclipse/jet/internal/editor/contentassist/JETDirectiveAssistProcessor.java
@@ -17,7 +17,7 @@ import org.eclipse.jface.text.contentassist.IContextInformationValidator;
public class JETDirectiveAssistProcessor extends AbstractXMLTagsBasedAssistProcessor {
private static String rootTags[] = { "jet", "taglib", "include", "start", "end" };
- private static String tagAttributes[][] = { { "jet", "package", "class", "imports", "startTag", "endTag" },
+ private static String tagAttributes[][] = { { "jet", "package", "class", "imports", "startTag", "endTag" , "extends" },
{ "taglib", "id", "prefix" }, { "include", "file" }, { "start", "id" }, { "end", "id" } };
public JETDirectiveAssistProcessor(JETTextEditor editor) {
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/templates/v1/JET1JavaGenerator.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/templates/v1/JET1JavaGenerator.java
index 83eb51a..04d61b2 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/templates/v1/JET1JavaGenerator.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/templates/v1/JET1JavaGenerator.java
@@ -36,6 +36,13 @@ public class JET1JavaGenerator implements JET2Template {
out.write(NL);
out.write("public class "); //$NON-NLS-1$
out.write( cu.getOutputJavaClassName() );
+
+ if (cu.getExtend() != null) {
+
+ out.write(" extends "); //$NON-NLS-1$
+ out.write( cu.getExtend() );
+
+ }
out.write(NL);
out.write("{"); //$NON-NLS-1$
out.write(NL);
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/templates/v2/JET2JavaGeneratorNew.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/templates/v2/JET2JavaGeneratorNew.java
index 596415a..5c5189a 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/templates/v2/JET2JavaGeneratorNew.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/templates/v2/JET2JavaGeneratorNew.java
@@ -95,6 +95,13 @@ cu.accept(new V2CodeGenVisitor(context,out, "") { //$NON-NLS-1$
out.write("public class "); //$NON-NLS-1$
out.write( cu.getOutputJavaClassName() );
+
+ if (cu.getExtend() != null) {
+
+ out.write(" extends "); //$NON-NLS-1$
+ out.write( cu.getExtend() );
+
+ }
out.write(" implements JET2Template {"); //$NON-NLS-1$
out.write(NL);
for(int i = 0; i < tlrefs.length; i++ ) {
diff --git a/plugins/org.eclipse.jet/templates/v1/jet2java.jet b/plugins/org.eclipse.jet/templates/v1/jet2java.jet
index 7ab35d5..38a5e41 100644
--- a/plugins/org.eclipse.jet/templates/v1/jet2java.jet
+++ b/plugins/org.eclipse.jet/templates/v1/jet2java.jet
@@ -15,7 +15,10 @@ package <%= cu.getOutputJavaPackage() %>;
import <%=importName%>;
<% } %>
-public class <%= cu.getOutputJavaClassName() %>
+public class <%= cu.getOutputJavaClassName() %><%
+ if (cu.getExtend() != null) {
+ %> extends <%= cu.getExtend() %><%
+ }%>
{
<% cu.accept(new SafeJETASTVisitor(context,out) {
public boolean visit(JavaDeclaration decl) {
diff --git a/plugins/org.eclipse.jet/templates/v2/jet2java.jet b/plugins/org.eclipse.jet/templates/v2/jet2java.jet
index 4d75955..d176461 100644
--- a/plugins/org.eclipse.jet/templates/v2/jet2java.jet
+++ b/plugins/org.eclipse.jet/templates/v2/jet2java.jet
@@ -65,7 +65,10 @@ import <%= (String)i.next() %>;
}
});
%>
-public class <%= cu.getOutputJavaClassName() %> implements JET2Template {
+public class <%= cu.getOutputJavaClassName() %><%
+ if (cu.getExtend() != null) {
+ %> extends <%= cu.getExtend() %><%
+ }%> implements JET2Template {
<% for(int i = 0; i < tlrefs.length; i++ ) { %>
private static final String _jetns_<%= tlrefs[i].getPrefix() %> = "<%= tlrefs[i].getTagLibraryId() %>"; //$NON-NLS-1$
<% } %>

Back to the top