summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpelder2006-11-16 09:27:50 (EST)
committer pelder2006-11-16 09:27:50 (EST)
commit4dc438510247e076502822b6ad3b1617c4fd2f37 (patch)
tree78f76e0d6a582dec02df8fac64bf711b036ba358
parent61affb2549c23f814150bd2a42df1b8fc8ac8091 (diff)
downloadorg.eclipse.jet-4dc438510247e076502822b6ad3b1617c4fd2f37.zip
org.eclipse.jet-4dc438510247e076502822b6ad3b1617c4fd2f37.tar.gz
org.eclipse.jet-4dc438510247e076502822b6ad3b1617c4fd2f37.tar.bz2
[164158] Replace project location specified in new project wizard.
-rw-r--r--plugins/org.eclipse.jet.ui/src/org/eclipse/jet/ui/newproject/NewProjectInfo.java19
-rw-r--r--plugins/org.eclipse.jet.ui/src/org/eclipse/jet/ui/newproject/NewProjectWizard.java3
-rw-r--r--plugins/org.eclipse.jet/transforms/plugins/org.eclipse.jet.transforms.newproject_1.0.0.jarbin28154 -> 28419 bytes
-rw-r--r--transforms/org.eclipse.jet.transforms.newproject/templates/createBasicProject.jet3
4 files changed, 24 insertions, 1 deletions
diff --git a/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/ui/newproject/NewProjectInfo.java b/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/ui/newproject/NewProjectInfo.java
index e87f3ae..6c95a44 100644
--- a/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/ui/newproject/NewProjectInfo.java
+++ b/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/ui/newproject/NewProjectInfo.java
@@ -31,6 +31,7 @@ public class NewProjectInfo {
private Map otherInfo = null;
private static final String NL = System.getProperty("line.separator"); //$NON-NLS-1$
private static final String INDENT = " "; //$NON-NLS-1$
+ private String location = null;
public NewProjectInfo() {
// nothing to do
@@ -57,7 +58,10 @@ public class NewProjectInfo {
}
StringBuffer xml = new StringBuffer();
xml.append("<newProjectModel>").append(NL); //$NON-NLS-1$
- xml.append(INDENT).append("<project name=\"" + projectName + "\"/>").append(NL); //$NON-NLS-1$ //$NON-NLS-2$
+ xml.append(INDENT).append("<project"); //$NON-NLS-1$
+ addAttribute(xml, "name", projectName); //$NON-NLS-1$
+ addAttribute(xml, "location", location); //$NON-NLS-1$
+ xml.append("/>").append(NL); //$NON-NLS-1$
if(otherInfo != null) {
for (Iterator i = otherInfo.values().iterator(); i.hasNext();) {
String otherElement = (String) i.next();
@@ -67,6 +71,16 @@ public class NewProjectInfo {
xml.append("</newProjectModel>").append(NL); //$NON-NLS-1$
return xml.toString();
}
+ /**
+ * @param xml
+ * @param name
+ * @param value
+ */
+ private void addAttribute(StringBuffer xml, String name, final String value) {
+ if(value != null) {
+ xml.append(' ').append(name).append("=\"").append(value).append("\""); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ }
public void setOtherInfo(String key, String xmlContent) {
@@ -80,4 +94,7 @@ public class NewProjectInfo {
}
}
+ public void setLocation(String location) {
+ this.location = location;
+ }
}
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 6fa34de..9792d6c 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
@@ -80,6 +80,9 @@ public class NewProjectWizard extends Wizard implements INewWizard {
protected final String getBuildModel() {
newProjectInfo.setProjectName(projectPage.getProjectName());
+ if(!projectPage.useDefaults()) {
+ newProjectInfo.setLocation(projectPage.getLocationPath().toString());
+ }
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 1954350..9f89e42 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/templates/createBasicProject.jet b/transforms/org.eclipse.jet.transforms.newproject/templates/createBasicProject.jet
index b2d7103..2ee663d 100644
--- a/transforms/org.eclipse.jet.transforms.newproject/templates/createBasicProject.jet
+++ b/transforms/org.eclipse.jet.transforms.newproject/templates/createBasicProject.jet
@@ -23,6 +23,9 @@
--- 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"/>