Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpelder2008-03-17 10:56:03 -0400
committerpelder2008-03-17 10:56:03 -0400
commit4b93939df2dd54d9f2026076472be96c7e48c276 (patch)
tree12bcad18637a3318061fce7237e195e79f29e925
parent5db9702221359e1f9715354a4a6ee07cf6ee96ab (diff)
downloadorg.eclipse.jet-4b93939df2dd54d9f2026076472be96c7e48c276.tar.gz
org.eclipse.jet-4b93939df2dd54d9f2026076472be96c7e48c276.tar.xz
org.eclipse.jet-4b93939df2dd54d9f2026076472be96c7e48c276.zip
[222952] New JET projects that override another do not have a correct main.jet template
-rw-r--r--plugins/org.eclipse.jet.ui/src/org/eclipse/jet/ui/newproject/NewProjectWizard.java5
-rw-r--r--plugins/org.eclipse.jet/transforms/plugins/org.eclipse.jet.transforms.newproject_1.0.0.jarbin49443 -> 35550 bytes
-rw-r--r--transforms/org.eclipse.jet.transforms.newproject/.settings/org.eclipse.jet.prefs3
-rw-r--r--transforms/org.eclipse.jet.transforms.newproject/templates/createBasicProject.jet3
-rw-r--r--transforms/org.eclipse.jet.transforms.newproject/templates/project/control.jet.jet11
5 files changed, 20 insertions, 2 deletions
diff --git a/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/ui/newproject/NewProjectWizard.java b/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/ui/newproject/NewProjectWizard.java
index 09e8718..f7da1ce 100644
--- a/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/ui/newproject/NewProjectWizard.java
+++ b/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/ui/newproject/NewProjectWizard.java
@@ -23,6 +23,7 @@ import org.eclipse.core.runtime.IStatus;
import org.eclipse.jet.JET2Platform;
import org.eclipse.jet.internal.InternalJET2Platform;
import org.eclipse.jet.internal.ui.l10n.Messages;
+import org.eclipse.jet.transform.IJETBundleDescriptor;
import org.eclipse.jet.ui.Activator;
import org.eclipse.jface.dialogs.ErrorDialog;
import org.eclipse.jface.operation.IRunnableWithProgress;
@@ -93,6 +94,10 @@ public class NewProjectWizard extends Wizard implements INewWizard {
newProjectInfo.setProjectAttribute("templateLoader", projectPropertiesPage.getTemplateLoader());
if(projectPropertiesPage.isExtension()) {
newProjectInfo.setProjectAttribute("baseID", projectPropertiesPage.getBaseTransformID());
+ final IJETBundleDescriptor descriptor = JET2Platform.getJETBundleManager().getDescriptor(projectPropertiesPage.getBaseTransformID());
+ if(descriptor != null) {
+ newProjectInfo.setProjectAttribute("baseStartTemplate", descriptor.getMainTemplate());
+ }
}
return newProjectInfo.toXmlString();
diff --git a/plugins/org.eclipse.jet/transforms/plugins/org.eclipse.jet.transforms.newproject_1.0.0.jar b/plugins/org.eclipse.jet/transforms/plugins/org.eclipse.jet.transforms.newproject_1.0.0.jar
index 7ca1d80..2dc13be 100644
--- a/plugins/org.eclipse.jet/transforms/plugins/org.eclipse.jet.transforms.newproject_1.0.0.jar
+++ b/plugins/org.eclipse.jet/transforms/plugins/org.eclipse.jet.transforms.newproject_1.0.0.jar
Binary files differ
diff --git a/transforms/org.eclipse.jet.transforms.newproject/.settings/org.eclipse.jet.prefs b/transforms/org.eclipse.jet.transforms.newproject/.settings/org.eclipse.jet.prefs
new file mode 100644
index 0000000..7b9dea9
--- /dev/null
+++ b/transforms/org.eclipse.jet.transforms.newproject/.settings/org.eclipse.jet.prefs
@@ -0,0 +1,3 @@
+#Mon Feb 25 12:09:41 EST 2008
+eclipse.preferences.version=1
+org.eclipse.jet.useJava5=false
diff --git a/transforms/org.eclipse.jet.transforms.newproject/templates/createBasicProject.jet b/transforms/org.eclipse.jet.transforms.newproject/templates/createBasicProject.jet
index fed661f..449f205 100644
--- a/transforms/org.eclipse.jet.transforms.newproject/templates/createBasicProject.jet
+++ b/transforms/org.eclipse.jet.transforms.newproject/templates/createBasicProject.jet
@@ -1,4 +1,4 @@
-<%@taglib prefix="c" id="org.eclipse.jet.controlTags" %>
+g<%@taglib prefix="c" id="org.eclipse.jet.controlTags" %>
<%@taglib prefix="ws" id="org.eclipse.jet.workspaceTags" %>
*** Control template for newproject.txm
@@ -18,6 +18,7 @@
<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>
<c:if test="not($project/@dfltJavaPackage)"><c:set select="$project" name="dfltJavaPackage">org.eclipse.jet.compiled</c:set></c:if>
+ <c:if test="$project/@baseID and not($project/@baseStartTemplate)"><c:set select="$project" name="baseStartTemplate">templates/main.jet</c:set></c:if>
*** Traverse the model and generate artifacts
--- Generate artifacts for the current root element
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
index aef59b5..2f675e1 100644
--- a/transforms/org.eclipse.jet.transforms.newproject/templates/project/control.jet.jet
+++ b/transforms/org.eclipse.jet.transforms.newproject/templates/project/control.jet.jet
@@ -1,7 +1,14 @@
<%@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"/> --%>
-
+<cc:choose>
+<cc:when test="$project/@baseID">
+<\%--
+NOTE: This template delegates to the template '<cc:get select="$project/@baseStartTemplate"/>' in transformation '<cc:get select="$project/@baseID"/>'.
+--%>
+<c:include template="<cc:get select="$project/@baseStartTemplate"/>" super="true"/>
+</cc:when>
+<cc:otherwise>
<\%--
TODO: traverse input model, performing calculations and storing
the results as model annotations via c:set tag
@@ -22,3 +29,5 @@ such as ws:file, ws:folder and ws:project
--%>
<ws:file template="templates/dump.jet" path="{$org.eclipse.jet.resource.project.name}/dump.xml"/>
+</cc:otherwise>
+</cc:choose>

Back to the top