Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plugins/org.eclipse.jet.ui/NewJETProject.p2.wzPage.xml1
-rw-r--r--plugins/org.eclipse.jet.ui/src/org/eclipse/jet/ui/newproject/Messages.java35
-rw-r--r--plugins/org.eclipse.jet.ui/src/org/eclipse/jet/ui/newproject/NewJETProjectPage2.java33
-rw-r--r--plugins/org.eclipse.jet.ui/src/org/eclipse/jet/ui/newproject/NewJETProjectPage2Controls.java46
-rw-r--r--plugins/org.eclipse.jet.ui/src/org/eclipse/jet/ui/newproject/NewProjectWizard.java12
-rw-r--r--plugins/org.eclipse.jet.ui/src/org/eclipse/jet/ui/newproject/messages.properties2
6 files changed, 89 insertions, 40 deletions
diff --git a/plugins/org.eclipse.jet.ui/NewJETProject.p2.wzPage.xml b/plugins/org.eclipse.jet.ui/NewJETProject.p2.wzPage.xml
index 33897a5..11c7b0f 100644
--- a/plugins/org.eclipse.jet.ui/NewJETProject.p2.wzPage.xml
+++ b/plugins/org.eclipse.jet.ui/NewJETProject.p2.wzPage.xml
@@ -49,6 +49,7 @@
<!-- Extensions -->
<control parentID="top" id="grpExtensions">
+ <var name="grpExtensions"/>
<type><group text="Extensions" shadow="NONE"><gridLayout numColumns="2"/></group></type>
<gridData><hAlign value="FILL"/><hGrabExcessSpace/></gridData>
</control>
diff --git a/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/ui/newproject/Messages.java b/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/ui/newproject/Messages.java
index 2049f1b..3d39729 100644
--- a/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/ui/newproject/Messages.java
+++ b/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/ui/newproject/Messages.java
@@ -1,4 +1,15 @@
-
+/*******************************************************************************
+ * Copyright (c) 2008 IBM Corporation and 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:
+ * IBM - Initial API and implementation
+ *
+ * /
+ *******************************************************************************/
package org.eclipse.jet.ui.newproject;
import org.eclipse.osgi.util.NLS;
@@ -8,23 +19,19 @@ public class Messages extends NLS {
public static String NewJETProjectPage2_description;
public static String NewJETProjectPage2_title;
public static String NewJETProjectPage2Controls__groupgrpTransProps_text;
- public static String NewJETProjectPage2Controls__labellblID_text;
- public static String NewJETProjectPage2Controls__labellblName_text;
- public static String NewJETProjectPage2Controls__labellblDescription_text;
- public static String NewJETProjectPage2Controls__labellblTemplateLoader_text;
- public static String NewJETProjectPage2Controls__groupgrpExtensions_text;
- public static String NewJETProjectPage2Controls_cbxExtends_text;
- public static String NewJETProjectPage2Controls_lblBaseTx_text;
- public static String NewJETProjectPage2Controls__labellblBaseTx_text;
- public static String NewJETProjectPage1Controls__groupgProjSet_text;
- public static String NewJETProjectPage1Controls__groupgProjectSettings_text;
- public static String NewJETProjectPage1Controls__labellblJETVersion_text;
+ public static String NewJETProjectPage2Controls__labellblID_text;
+ public static String NewJETProjectPage2Controls__labellblName_text;
+ public static String NewJETProjectPage2Controls__labellblDescription_text;
+ public static String NewJETProjectPage2Controls__labellblTemplateLoader_text;
+ public static String NewJETProjectPage2Controls_grpExtensions_text;
+ public static String NewJETProjectPage2Controls_cbxExtends_text;
+ public static String NewJETProjectPage2Controls_lblBaseTx_text;
+ public static String NewJETProjectPage1Controls__groupgProjSet_text;
public static String NewJETProjectPage1Controls__labellblTemplateFolder_text;
public static String NewJETProjectPage1Controls__labellblJETOutput_text;
public static String NewJETProjectPage1Controls__labellblJavaOutput_text;
public static String NewJETProjectPage1Controls__labellblDefJavaPackage_text;
- public static String NewJETProjectPage1Controls__labellblJabaCompliance_text;
- static {
+ static {
// initialize resource bundle
NLS.initializeMessages(BUNDLE_NAME, Messages.class);
}
diff --git a/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/ui/newproject/NewJETProjectPage2.java b/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/ui/newproject/NewJETProjectPage2.java
index 168fa80..a59b550 100644
--- a/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/ui/newproject/NewJETProjectPage2.java
+++ b/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/ui/newproject/NewJETProjectPage2.java
@@ -1,15 +1,27 @@
+/*******************************************************************************
+ * Copyright (c) 2008 IBM Corporation and 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:
+ * IBM - Initial API and implementation
+ *
+ * /
+ *******************************************************************************/
package org.eclipse.jet.ui.newproject;
import org.eclipse.jet.JET2Platform;
-import org.eclipse.jface.wizard.IWizardPage;
-import org.eclipse.swt.events.*;
+import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.widgets.Composite;
public class NewJETProjectPage2 extends NewJETProjectPage2Controls {
private NewJETProjectPage1 page1;
+ private boolean showExtensionsGroup;
public NewJETProjectPage2(String pageName) {
@@ -29,6 +41,14 @@ public class NewJETProjectPage2 extends NewJETProjectPage2Controls {
for (int i = 0; i < allIDs.length; i++) {
ddlBaseTx.add(allIDs[i]);
}
+
+ if(!showExtensionsGroup) {
+ final boolean visible = !showExtensionsGroup;
+ grpExtensions.setVisible(visible);
+ ddlBaseTx.setVisible(visible);
+ cbxExtends.setVisible(visible);
+ lblBaseTx.setVisible(visible);
+ }
}
private void setExtends(boolean setExtends) {
@@ -64,6 +84,7 @@ public class NewJETProjectPage2 extends NewJETProjectPage2Controls {
txtTemplateLoader.setText(page1.getDefJavaPackage() + "._jet_transformation"); //$NON-NLS-1$
txtID.setText(page1.getBaseID());
txtName.setText(page1.getBaseID());
+ txtID.setFocus();
}
}
@@ -91,11 +112,7 @@ public class NewJETProjectPage2 extends NewJETProjectPage2Controls {
return ddlBaseTx.getText().trim();
}
- public IWizardPage getNextPage() {
- if(getWizard() != null && isExtension()) {
- return super.getNextPage();
- } else {
- return null;
- }
+ void showExtensionsGroup(boolean show) {
+ this.showExtensionsGroup = show;
}
}
diff --git a/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/ui/newproject/NewJETProjectPage2Controls.java b/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/ui/newproject/NewJETProjectPage2Controls.java
index a9446eb..0b7e8d8 100644
--- a/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/ui/newproject/NewJETProjectPage2Controls.java
+++ b/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/ui/newproject/NewJETProjectPage2Controls.java
@@ -1,3 +1,15 @@
+/*******************************************************************************
+ * Copyright (c) 2008 IBM Corporation and 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:
+ * IBM - Initial API and implementation
+ *
+ * /
+ *******************************************************************************/
package org.eclipse.jet.ui.newproject;
import org.eclipse.jface.wizard.WizardPage;
@@ -13,6 +25,7 @@ public abstract class NewJETProjectPage2Controls
protected Text txtName;
protected Text txtDescription;
protected Text txtTemplateLoader;
+ protected Group grpExtensions;
protected Button cbxExtends;
protected Label lblBaseTx;
protected Combo ddlBaseTx;
@@ -137,30 +150,29 @@ public abstract class NewJETProjectPage2Controls
_gd.grabExcessHorizontalSpace = true;
txtTemplateLoader.setLayoutData(_gd);
- Group _groupgrpExtensions;
- _groupgrpExtensions = new Group(_compositetop, SWT.NONE);
- _groupgrpExtensions.setText(Messages.NewJETProjectPage2Controls__groupgrpExtensions_text);
- _groupgrpExtensions.setFont(_compositetop.getFont());
+ grpExtensions = new Group(_compositetop, SWT.NONE);
+ grpExtensions.setText(Messages.NewJETProjectPage2Controls_grpExtensions_text);
+ grpExtensions.setFont(_compositetop.getFont());
- // layout _groupgrpExtensions within _compositetop
+ // layout grpExtensions within _compositetop
_gd = new GridData();
_gd.horizontalAlignment = GridData.FILL;
_gd.grabExcessHorizontalSpace = true;
- _groupgrpExtensions.setLayoutData(_gd);
+ grpExtensions.setLayoutData(_gd);
- // Initialize _groupgrpExtensions layout
+ // Initialize grpExtensions layout
_gl = new GridLayout();
_gl.numColumns = 2;
- _groupgrpExtensions.setLayout(_gl);
+ grpExtensions.setLayout(_gl);
- cbxExtends = new Button(_groupgrpExtensions, SWT.CHECK | SWT.RIGHT);
+ cbxExtends = new Button(grpExtensions, SWT.CHECK | SWT.RIGHT);
cbxExtends.setText(Messages.NewJETProjectPage2Controls_cbxExtends_text);
- cbxExtends.setFont(_groupgrpExtensions.getFont());
+ cbxExtends.setFont(grpExtensions.getFont());
- // layout cbxExtends within _groupgrpExtensions
+ // layout cbxExtends within grpExtensions
_gd = new GridData();
_gd.horizontalSpan = 2;
cbxExtends.setLayoutData(_gd);
@@ -171,24 +183,24 @@ public abstract class NewJETProjectPage2Controls
}
});
- lblBaseTx = new Label(_groupgrpExtensions, SWT.NONE);
+ lblBaseTx = new Label(grpExtensions, SWT.NONE);
lblBaseTx.setText(Messages.NewJETProjectPage2Controls_lblBaseTx_text);
- lblBaseTx.setFont(_groupgrpExtensions.getFont());
+ lblBaseTx.setFont(grpExtensions.getFont());
- // layout lblBaseTx within _groupgrpExtensions
+ // layout lblBaseTx within grpExtensions
_gd = new GridData();
_gd.horizontalIndent = convertWidthInCharsToPixels(4);
lblBaseTx.setLayoutData(_gd);
- ddlBaseTx = new Combo(_groupgrpExtensions, SWT.RIGHT
+ ddlBaseTx = new Combo(grpExtensions, SWT.RIGHT
| SWT.DROP_DOWN
| SWT.READ_ONLY
);
- ddlBaseTx.setFont(_groupgrpExtensions.getFont());
+ ddlBaseTx.setFont(grpExtensions.getFont());
- // layout ddlBaseTx within _groupgrpExtensions
+ // layout ddlBaseTx within grpExtensions
_gd = new GridData();
_gd.horizontalAlignment = GridData.FILL;
_gd.grabExcessHorizontalSpace = true;
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 dbcec51..ab120b6 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
@@ -148,9 +148,21 @@ public class NewProjectWizard extends Wizard implements INewWizard {
projectPropertiesPage = new NewJETProjectPage2(Messages.NewProjectWizard_MainPageTabText);
projectPropertiesPage.setJETProjectPage1(projectPage);
+ projectPropertiesPage.showExtensionsGroup(allowExtensionSpecification());
addPage(projectPropertiesPage);
}
+
+
+ /**
+ * Indicates whether the wizard will allow specification of JET transformation extensions.
+ * Clients may override this method. Default implementation returns <code>true</code>.
+ * @return <code>true</code> if extension transformations will be allowed.
+ */
+ protected boolean allowExtensionSpecification() {
+ return true;
+ }
+
public boolean canFinish() {
final IWizardPage currentPage = getContainer().getCurrentPage();
return super.canFinish() && currentPage != projectPage;
diff --git a/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/ui/newproject/messages.properties b/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/ui/newproject/messages.properties
index 7cd7486..319d003 100644
--- a/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/ui/newproject/messages.properties
+++ b/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/ui/newproject/messages.properties
@@ -10,7 +10,7 @@ NewJETProjectPage2Controls__labellblID_text=Transformation &ID:
NewJETProjectPage2Controls__labellblName_text=Transformation na&me:
NewJETProjectPage2Controls__labellblDescription_text=Transformation &description:
NewJETProjectPage2Controls__labellblTemplateLoader_text=Template &loader:
-NewJETProjectPage2Controls__groupgrpExtensions_text=Extensions
+NewJETProjectPage2Controls_grpExtensions_text=Extensions
NewJETProjectPage2Controls_cbxExtends_text=E&xtend an existing JET Transformation
NewJETProjectPage2Controls_lblBaseTx_text=Base &transformation:

Back to the top