Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/org.eclipse.jet.ui/src/org/eclipse/jet/ui/newproject')
-rw-r--r--plugins/org.eclipse.jet.ui/src/org/eclipse/jet/ui/newproject/Messages.java42
-rw-r--r--plugins/org.eclipse.jet.ui/src/org/eclipse/jet/ui/newproject/NewJETProjectPage1.java139
-rw-r--r--plugins/org.eclipse.jet.ui/src/org/eclipse/jet/ui/newproject/NewJETProjectPage1Controls.java183
-rw-r--r--plugins/org.eclipse.jet.ui/src/org/eclipse/jet/ui/newproject/NewJETProjectPage2.java169
-rw-r--r--plugins/org.eclipse.jet.ui/src/org/eclipse/jet/ui/newproject/NewJETProjectPage2Controls.java265
-rw-r--r--plugins/org.eclipse.jet.ui/src/org/eclipse/jet/ui/newproject/NewProjectInfo.java109
-rw-r--r--plugins/org.eclipse.jet.ui/src/org/eclipse/jet/ui/newproject/NewProjectWizard.java193
-rw-r--r--plugins/org.eclipse.jet.ui/src/org/eclipse/jet/ui/newproject/messages.properties19
8 files changed, 0 insertions, 1119 deletions
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
deleted file mode 100644
index 890484c..0000000
--- a/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/ui/newproject/Messages.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * 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;
-
-public class Messages extends NLS {
- private static final String BUNDLE_NAME = "org.eclipse.jet.ui.newproject.messages"; //$NON-NLS-1$
- public static String NewJETProjectPage2_description;
- public static String NewJETProjectPage2_InvalidID;
- 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_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;
- static {
- // initialize resource bundle
- NLS.initializeMessages(BUNDLE_NAME, Messages.class);
- }
-
- private Messages() {
- }
-}
diff --git a/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/ui/newproject/NewJETProjectPage1.java b/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/ui/newproject/NewJETProjectPage1.java
deleted file mode 100644
index c9aa50f..0000000
--- a/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/ui/newproject/NewJETProjectPage1.java
+++ /dev/null
@@ -1,139 +0,0 @@
-
-package org.eclipse.jet.ui.newproject;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jdt.core.JavaConventions;
-import org.eclipse.jet.core.compiler.JETCompilerOptions;
-import org.eclipse.jet.ui.Activator;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Text;
-
-public class NewJETProjectPage1 extends NewJETProjectPage1Controls {
-
-
- private String lastBaseID = null;
-
- public NewJETProjectPage1(String pageName) {
- super(pageName);
- }
-
- public void createControl(Composite parent) {
- // super.createControl guarantees all controls are created.
- super.createControl(parent);
-
- // initialize control data
- final IPreferenceStore preferenceStore = Activator.getDefault().getPreferenceStore();
-
- txtTemplateFolder.setText("templates"); //$NON-NLS-1$
- txtJETOutput.setText(preferenceStore.getDefaultString(JETCompilerOptions.OPTION_COMPILED_TEMPLATE_SRC_DIR));
- txtJavaOutput.setText(preferenceStore.getDefaultString(JETCompilerOptions.OPTION_JAVA_OUTPUT_FOLDER));
- txtDefJavaPackage.setText(preferenceStore.getDefaultString(JETCompilerOptions.OPTION_COMPILED_TEMPLATE_PACKAGE));
-
- }
-
- protected void txtTemplateFolder_modify(ModifyEvent e) {
- validatePage();
- }
-
- protected void txtJETOutput_modify(ModifyEvent e) {
- validatePage();
- }
-
- protected void txtJavaOutput_modify(ModifyEvent e) {
- validatePage();
- }
-
- protected void txtDefJavaPackage_modify(ModifyEvent e) {
- validatePage();
- }
-
- protected boolean validatePage() {
- final boolean parentValid = super.validatePage();
- if(!parentValid) {
- return false;
- }
-
- final String id = getBaseID();
- if(!id.equals(lastBaseID)) {
- lastBaseID = id;
- final String newDefPackage = id + ".compiled"; //$NON-NLS-1$
- txtDefJavaPackage.setText(newDefPackage);
- }
-
- if(!validateFolder(txtTemplateFolder)) {
- return false;
- }
- if(!validateFolder(txtJavaOutput)) {
- return false;
- }
- if(!validateFolder(txtJETOutput)) {
- return false;
- }
- final String defaultJavaPackage = getDefaultJavaPackage();
- final IStatus status = validateJavaPackage(defaultJavaPackage);
- if(!status.isOK()) {
- setErrorMessage(status.getMessage());
- return false;
- }
- return true;
- }
-
- /**
- * @param defaultJavaPackage
- * @return
- */
- private IStatus validateJavaPackage(final String defaultJavaPackage) {
- IStatus status = JavaConventions.validatePackageName(defaultJavaPackage);
- return status;
- }
-
- /**
- * @param folderField
- */
- private boolean validateFolder(final Text folderField) {
- final IWorkspace workspace = ResourcesPlugin.getWorkspace();
- final IStatus status = workspace.validatePath("/" + getProjectName() + "/" + folderField.getText().trim(), IResource.FOLDER); //$NON-NLS-1$ //$NON-NLS-2$
- if(!status.isOK()) {
- setErrorMessage(status.getMessage());
- return false;
- } else {
- return true;
- }
- }
-
- /**
- * @return
- */
- String getBaseID() {
- final String projectName = getProjectName();
-
- final String id = projectName.replaceAll("[^a-zA-Z0-9\\._]", "_"); //$NON-NLS-1$//$NON-NLS-2$
- return id;
- }
-
- public String getDefJavaPackage() {
- return txtDefJavaPackage.getText();
- }
-
- public String getTemplateFolder() {
- return txtTemplateFolder.getText().trim();
- }
-
- public String getJETOutputFolder() {
- return txtJETOutput.getText().trim();
- }
-
- public String getJavaOutputFolder() {
- return txtJavaOutput.getText().trim();
- }
-
- public String getDefaultJavaPackage() {
- return txtDefJavaPackage.getText().trim();
- }
-
-}
diff --git a/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/ui/newproject/NewJETProjectPage1Controls.java b/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/ui/newproject/NewJETProjectPage1Controls.java
deleted file mode 100644
index 95abe98..0000000
--- a/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/ui/newproject/NewJETProjectPage1Controls.java
+++ /dev/null
@@ -1,183 +0,0 @@
-package org.eclipse.jet.ui.newproject;
-
-import org.eclipse.ui.dialogs.WizardNewProjectCreationPage;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.*;
-import org.eclipse.swt.layout.*;
-import org.eclipse.swt.widgets.*;
-
-public abstract class NewJETProjectPage1Controls
- extends WizardNewProjectCreationPage {
-
- protected Text txtTemplateFolder;
- protected Text txtJETOutput;
- protected Text txtJavaOutput;
- protected Text txtDefJavaPackage;
-
-
- protected NewJETProjectPage1Controls(String pageName) {
- super(pageName);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
- */
- public void createControl(Composite parent) {
- super.createControl(parent);
- // retarget parent to the control composite established by the base class
- parent = (Composite)getControl();
- initializeDialogUnits(parent);
-
- // working variables for creating grid layout info
- GridLayout _gl;
- GridData _gd;
-
- Group _groupgProjSet;
- _groupgProjSet = new Group(parent, SWT.NONE);
- _groupgProjSet.setText(Messages.NewJETProjectPage1Controls__groupgProjSet_text);
- _groupgProjSet.setFont(parent.getFont());
- org.eclipse.ui.PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(), "org.eclipse.jet.ui.trjt0010"); //$NON-NLS-1$
-
-
- // layout _groupgProjSet within parent
- _gd = new GridData();
- _gd.horizontalAlignment = GridData.FILL;
- _gd.grabExcessHorizontalSpace = true;
- _groupgProjSet.setLayoutData(_gd);
-
- // Initialize _groupgProjSet layout
- _gl = new GridLayout();
- _gl.numColumns = 2;
- _groupgProjSet.setLayout(_gl);
-
- Label _labellblTemplateFolder;
- _labellblTemplateFolder = new Label(_groupgProjSet, SWT.NONE);
- _labellblTemplateFolder.setText(Messages.NewJETProjectPage1Controls__labellblTemplateFolder_text);
- _labellblTemplateFolder.setFont(_groupgProjSet.getFont());
-
-
-
- txtTemplateFolder = new Text(_groupgProjSet, SWT.BORDER);
- txtTemplateFolder.setFont(_groupgProjSet.getFont());
-
-
- // layout txtTemplateFolder within _groupgProjSet
- _gd = new GridData();
- _gd.horizontalAlignment = GridData.FILL;
- _gd.grabExcessHorizontalSpace = true;
- txtTemplateFolder.setLayoutData(_gd);
- // register event handlers for txtTemplateFolder
- txtTemplateFolder.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- txtTemplateFolder_modify(e);
- }});
-
- Label _labellblJETOutput;
- _labellblJETOutput = new Label(_groupgProjSet, SWT.NONE);
- _labellblJETOutput.setText(Messages.NewJETProjectPage1Controls__labellblJETOutput_text);
- _labellblJETOutput.setFont(_groupgProjSet.getFont());
-
-
-
- txtJETOutput = new Text(_groupgProjSet, SWT.BORDER);
- txtJETOutput.setFont(_groupgProjSet.getFont());
-
-
- // layout txtJETOutput within _groupgProjSet
- _gd = new GridData();
- _gd.horizontalAlignment = GridData.FILL;
- _gd.grabExcessHorizontalSpace = true;
- txtJETOutput.setLayoutData(_gd);
- // register event handlers for txtJETOutput
- txtJETOutput.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- txtJETOutput_modify(e);
- }});
-
- Label _labellblJavaOutput;
- _labellblJavaOutput = new Label(_groupgProjSet, SWT.NONE);
- _labellblJavaOutput.setText(Messages.NewJETProjectPage1Controls__labellblJavaOutput_text);
- _labellblJavaOutput.setFont(_groupgProjSet.getFont());
-
-
-
- txtJavaOutput = new Text(_groupgProjSet, SWT.BORDER);
- txtJavaOutput.setFont(_groupgProjSet.getFont());
-
-
- // layout txtJavaOutput within _groupgProjSet
- _gd = new GridData();
- _gd.horizontalAlignment = GridData.FILL;
- _gd.grabExcessHorizontalSpace = true;
- txtJavaOutput.setLayoutData(_gd);
- // register event handlers for txtJavaOutput
- txtJavaOutput.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- txtJavaOutput_modify(e);
- }});
-
- Label _labellblDefJavaPackage;
- _labellblDefJavaPackage = new Label(_groupgProjSet, SWT.NONE);
- _labellblDefJavaPackage.setText(Messages.NewJETProjectPage1Controls__labellblDefJavaPackage_text);
- _labellblDefJavaPackage.setFont(_groupgProjSet.getFont());
-
-
-
- txtDefJavaPackage = new Text(_groupgProjSet, SWT.BORDER);
- txtDefJavaPackage.setFont(_groupgProjSet.getFont());
-
-
- // layout txtDefJavaPackage within _groupgProjSet
- _gd = new GridData();
- _gd.horizontalAlignment = GridData.FILL;
- _gd.grabExcessHorizontalSpace = true;
- txtDefJavaPackage.setLayoutData(_gd);
- // register event handlers for txtDefJavaPackage
- txtDefJavaPackage.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- txtDefJavaPackage_modify(e);
- }});
-
-
- }
-
-
- /**
- * Modify event handler for {@link #txtTemplateFolder}.
- *
- * @param e the Modify Event
- * @see ModifyListener
- * @see ModifyListener#modifyText(ModifyEvent)
- */
- protected abstract void txtTemplateFolder_modify(ModifyEvent e);
-
- /**
- * Modify event handler for {@link #txtJETOutput}.
- *
- * @param e the Modify Event
- * @see ModifyListener
- * @see ModifyListener#modifyText(ModifyEvent)
- */
- protected abstract void txtJETOutput_modify(ModifyEvent e);
-
- /**
- * Modify event handler for {@link #txtJavaOutput}.
- *
- * @param e the Modify Event
- * @see ModifyListener
- * @see ModifyListener#modifyText(ModifyEvent)
- */
- protected abstract void txtJavaOutput_modify(ModifyEvent e);
-
- /**
- * Modify event handler for {@link #txtDefJavaPackage}.
- *
- * @param e the Modify Event
- * @see ModifyListener
- * @see ModifyListener#modifyText(ModifyEvent)
- */
- protected abstract void txtDefJavaPackage_modify(ModifyEvent e);
-
-
-
-}
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
deleted file mode 100644
index d44983b..0000000
--- a/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/ui/newproject/NewJETProjectPage2.java
+++ /dev/null
@@ -1,169 +0,0 @@
-/*******************************************************************************
- * 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.core.runtime.IStatus;
-import org.eclipse.jdt.core.JavaConventions;
-import org.eclipse.jet.JET2Platform;
-import org.eclipse.swt.events.ModifyEvent;
-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) {
- super(pageName);
- setTitle(Messages.NewJETProjectPage2_title);
- setDescription(Messages.NewJETProjectPage2_description);
- }
-
- public void createControl(Composite parent) {
- // super.createControl guarantees all controls are created.
- super.createControl(parent);
-
- // initialize control data
- setExtends(false);
-
- final String[] allIDs = JET2Platform.getJETBundleManager().getAllTransformIds();
- for (int i = 0; i < allIDs.length; i++) {
- ddlBaseTx.add(allIDs[i]);
- }
-
- if(!showExtensionsGroup) {
- final boolean visible = false;
- grpExtensions.setVisible(visible);
- ddlBaseTx.setVisible(visible);
- cbxExtends.setVisible(visible);
- lblBaseTx.setVisible(visible);
- }
-
- setPageComplete(validatePage());
- }
-
- private boolean validatePage() {
- if(!validateTranformID()) {
- return false;
- }
- if(!validateTemplateLoader()) {
- return false;
- }
- if(cbxExtends.getSelection() && cbxExtends.isVisible() && ddlBaseTx.getText().trim().length() == 0) {
- return false;
- }
-
- setMessage(null);
- setErrorMessage(null);
- return true;
- }
-
- private boolean validateTemplateLoader() {
- final IStatus status = JavaConventions.validateJavaTypeName(getTemplateLoader());
- if(status.getSeverity() == IStatus.ERROR) {
- setErrorMessage(status.getMessage());
- return false;
- }
- return true;
- }
-
- private boolean validateTranformID() {
- final String transformID = getTransformID();
- if(!transformID.matches("[a-zA-Z0-9\\._]*")) { //$NON-NLS-1$
- setErrorMessage(Messages.NewJETProjectPage2_InvalidID);
- return false;
- }
- return true;
- }
-
- protected void txtID_modify(ModifyEvent e) {
- setPageComplete(validatePage());
- }
-
- protected void txtTemplateLoader_modify(ModifyEvent e) {
- setPageComplete(validatePage());
- }
-
- private void setExtends(boolean setExtends) {
- if(setExtends != cbxExtends.getSelection()) {
- cbxExtends.setSelection(setExtends);
- }
- lblBaseTx.setEnabled(setExtends);
- ddlBaseTx.setEnabled(setExtends);
-
- }
-
- public void setJETProjectPage1(NewJETProjectPage1 page1) {
- this.page1 = page1;
-
- }
- /* (non-Javadoc)
- * @see org.eclipse.jet.ui.newproject.NewJETProjectPage2Controls#cbxExtends_selection(org.eclipse.swt.events.SelectionEvent)
- */
- protected void cbxExtends_selection(SelectionEvent e) {
- final boolean selected = cbxExtends.getSelection();
- setExtends(selected);
- if(selected) {
- ddlBaseTx.setFocus();
- }
- setPageComplete(validatePage());
- getContainer().updateButtons();
- }
-
-
- protected void ddlBaseTx_modify(ModifyEvent e) {
- setPageComplete(validatePage());
- }
-
- public void setVisible(boolean visible) {
- super.setVisible(visible);
- if(visible && page1 != null) {
- txtTemplateLoader.setText(page1.getDefJavaPackage() + "._jet_transformation"); //$NON-NLS-1$
- txtID.setText(page1.getBaseID());
- txtName.setText(page1.getBaseID());
- txtID.setFocus();
- }
- }
-
- public boolean isExtension() {
- return cbxExtends.getSelection();
- }
-
- public String getTransformID() {
- return txtID.getText().trim();
- }
-
- public String getTransformName() {
- return txtName.getText().trim();
- }
-
- public String getTransformDescription() {
- return txtDescription.getText().trim();
- }
-
- public String getTemplateLoader() {
- return txtTemplateLoader.getText().trim();
- }
-
- public String getBaseTransformID() {
- return ddlBaseTx.getText().trim();
- }
-
- 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
deleted file mode 100644
index 5e25d74..0000000
--- a/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/ui/newproject/NewJETProjectPage2Controls.java
+++ /dev/null
@@ -1,265 +0,0 @@
-/*******************************************************************************
- * 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;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.*;
-import org.eclipse.swt.layout.*;
-import org.eclipse.swt.widgets.*;
-
-public abstract class NewJETProjectPage2Controls
- extends WizardPage {
-
- protected Text txtID;
- protected Text txtName;
- protected Text txtDescription;
- protected Text txtTemplateLoader;
- protected Group grpExtensions;
- protected Button cbxExtends;
- protected Label lblBaseTx;
- protected Combo ddlBaseTx;
-
-
- protected NewJETProjectPage2Controls(String pageName) {
- super(pageName);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
- */
- public void createControl(Composite parent) {
- initializeDialogUnits(parent);
-
- // working variables for creating grid layout info
- GridLayout _gl;
- GridData _gd;
-
- Composite _compositetop;
- _compositetop = new Composite(parent, SWT.NULL);
- _compositetop.setFont(parent.getFont());
- setControl(_compositetop);
- org.eclipse.ui.PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(), "org.eclipse.jet.ui.trjt0020"); //$NON-NLS-1$
-
-
- // layout _compositetop within parent
- _gd = new GridData();
- _gd.horizontalAlignment = GridData.FILL;
- _gd.grabExcessHorizontalSpace = true;
- _gd.verticalAlignment = GridData.FILL;
- _gd.grabExcessVerticalSpace = true;
- _compositetop.setLayoutData(_gd);
-
- // Initialize _compositetop layout
- _gl = new GridLayout();
- _gl.numColumns = 1;
- _compositetop.setLayout(_gl);
-
- Group _groupgrpTransProps;
- _groupgrpTransProps = new Group(_compositetop, SWT.NONE);
- _groupgrpTransProps.setText(Messages.NewJETProjectPage2Controls__groupgrpTransProps_text);
- _groupgrpTransProps.setFont(_compositetop.getFont());
-
-
- // layout _groupgrpTransProps within _compositetop
- _gd = new GridData();
- _gd.horizontalAlignment = GridData.FILL;
- _gd.grabExcessHorizontalSpace = true;
- _groupgrpTransProps.setLayoutData(_gd);
-
- // Initialize _groupgrpTransProps layout
- _gl = new GridLayout();
- _gl.numColumns = 2;
- _groupgrpTransProps.setLayout(_gl);
-
- Label _labellblID;
- _labellblID = new Label(_groupgrpTransProps, SWT.NONE);
- _labellblID.setText(Messages.NewJETProjectPage2Controls__labellblID_text);
- _labellblID.setFont(_groupgrpTransProps.getFont());
-
-
-
- txtID = new Text(_groupgrpTransProps, SWT.BORDER);
- txtID.setFont(_groupgrpTransProps.getFont());
-
-
- // layout txtID within _groupgrpTransProps
- _gd = new GridData();
- _gd.horizontalAlignment = GridData.FILL;
- _gd.grabExcessHorizontalSpace = true;
- txtID.setLayoutData(_gd);
- // register event handlers for txtID
- txtID.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- txtID_modify(e);
- }});
-
- Label _labellblName;
- _labellblName = new Label(_groupgrpTransProps, SWT.NONE);
- _labellblName.setText(Messages.NewJETProjectPage2Controls__labellblName_text);
- _labellblName.setFont(_groupgrpTransProps.getFont());
-
-
-
- txtName = new Text(_groupgrpTransProps, SWT.BORDER);
- txtName.setFont(_groupgrpTransProps.getFont());
-
-
- // layout txtName within _groupgrpTransProps
- _gd = new GridData();
- _gd.horizontalAlignment = GridData.FILL;
- _gd.grabExcessHorizontalSpace = true;
- txtName.setLayoutData(_gd);
-
- Label _labellblDescription;
- _labellblDescription = new Label(_groupgrpTransProps, SWT.NONE);
- _labellblDescription.setText(Messages.NewJETProjectPage2Controls__labellblDescription_text);
- _labellblDescription.setFont(_groupgrpTransProps.getFont());
-
-
-
- txtDescription = new Text(_groupgrpTransProps, SWT.BORDER);
- txtDescription.setFont(_groupgrpTransProps.getFont());
-
-
- // layout txtDescription within _groupgrpTransProps
- _gd = new GridData();
- _gd.horizontalAlignment = GridData.FILL;
- _gd.grabExcessHorizontalSpace = true;
- txtDescription.setLayoutData(_gd);
-
- Label _labellblTemplateLoader;
- _labellblTemplateLoader = new Label(_groupgrpTransProps, SWT.NONE);
- _labellblTemplateLoader.setText(Messages.NewJETProjectPage2Controls__labellblTemplateLoader_text);
- _labellblTemplateLoader.setFont(_groupgrpTransProps.getFont());
-
-
-
- txtTemplateLoader = new Text(_groupgrpTransProps, SWT.BORDER);
- txtTemplateLoader.setFont(_groupgrpTransProps.getFont());
-
-
- // layout txtTemplateLoader within _groupgrpTransProps
- _gd = new GridData();
- _gd.horizontalAlignment = GridData.FILL;
- _gd.grabExcessHorizontalSpace = true;
- txtTemplateLoader.setLayoutData(_gd);
- // register event handlers for txtTemplateLoader
- txtTemplateLoader.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- txtTemplateLoader_modify(e);
- }});
-
- grpExtensions = new Group(_compositetop, SWT.NONE);
- grpExtensions.setText(Messages.NewJETProjectPage2Controls_grpExtensions_text);
- grpExtensions.setFont(_compositetop.getFont());
-
-
- // layout grpExtensions within _compositetop
- _gd = new GridData();
- _gd.horizontalAlignment = GridData.FILL;
- _gd.grabExcessHorizontalSpace = true;
- grpExtensions.setLayoutData(_gd);
-
- // Initialize grpExtensions layout
- _gl = new GridLayout();
- _gl.numColumns = 2;
- grpExtensions.setLayout(_gl);
-
- cbxExtends = new Button(grpExtensions, SWT.CHECK | SWT.RIGHT);
- cbxExtends.setText(Messages.NewJETProjectPage2Controls_cbxExtends_text);
-
- cbxExtends.setFont(grpExtensions.getFont());
-
-
- // layout cbxExtends within grpExtensions
- _gd = new GridData();
- _gd.horizontalSpan = 2;
- cbxExtends.setLayoutData(_gd);
- // register event handlers for cbxExtends
- cbxExtends.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- cbxExtends_selection(e);
- }
- });
-
- lblBaseTx = new Label(grpExtensions, SWT.NONE);
- lblBaseTx.setText(Messages.NewJETProjectPage2Controls_lblBaseTx_text);
- lblBaseTx.setFont(grpExtensions.getFont());
-
-
- // layout lblBaseTx within grpExtensions
- _gd = new GridData();
- _gd.horizontalIndent = convertWidthInCharsToPixels(4);
- lblBaseTx.setLayoutData(_gd);
-
- ddlBaseTx = new Combo(grpExtensions, SWT.RIGHT
- | SWT.DROP_DOWN
- | SWT.READ_ONLY
- );
- ddlBaseTx.setFont(grpExtensions.getFont());
-
-
- // layout ddlBaseTx within grpExtensions
- _gd = new GridData();
- _gd.horizontalAlignment = GridData.FILL;
- _gd.grabExcessHorizontalSpace = true;
- ddlBaseTx.setLayoutData(_gd);
- // register event handlers for ddlBaseTx
- ddlBaseTx.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- ddlBaseTx_modify(e);
- }});
-
-
- }
-
-
- /**
- * Modify event handler for {@link #txtID}.
- *
- * @param e the Modify Event
- * @see ModifyListener
- * @see ModifyListener#modifyText(ModifyEvent)
- */
- protected abstract void txtID_modify(ModifyEvent e);
-
- /**
- * Modify event handler for {@link #txtTemplateLoader}.
- *
- * @param e the Modify Event
- * @see ModifyListener
- * @see ModifyListener#modifyText(ModifyEvent)
- */
- protected abstract void txtTemplateLoader_modify(ModifyEvent e);
-
- /**
- * Selection event handler for {@link #cbxExtends}.
- * @param e an event containing information on the selection
- * @see SelectionListener
- * @see SelectionListener#widgetSelected(SelectionEvent)
- */
- protected abstract void cbxExtends_selection(SelectionEvent e);
-
- /**
- * Modify event handler for {@link #ddlBaseTx}.
- *
- * @param e the Modify Event
- * @see ModifyListener
- * @see ModifyListener#modifyText(ModifyEvent)
- */
- protected abstract void ddlBaseTx_modify(ModifyEvent e);
-
-
-
-}
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
deleted file mode 100644
index c3b28e8..0000000
--- a/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/ui/newproject/NewProjectInfo.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/**
- * <copyright>
- *
- * Copyright (c) 2006, 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
- *
- * </copyright>
- *
- * $Id$
- */
-
-package org.eclipse.jet.ui.newproject;
-
-import java.util.Iterator;
-import java.util.LinkedHashMap;
-import java.util.Map;
-
-/**
- * Represents information required to create a new JET2 Project
- *
- */
-public final class NewProjectInfo {
-
- private String projectName;
- 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 final Map projectAttributes = new LinkedHashMap();
-
- public NewProjectInfo() {
- // nothing to do
- }
- /**
- * Return the currently set project Name.
- * @return the projectName or <code>null</code>
- */
- public final String getProjectName() {
- return projectName;
- }
-
- /**
- * Set the projectName.
- * @param projectName the projectName to set
- */
- public final void setProjectName(String projectName) {
- this.projectName = projectName;
- setProjectAttribute("name", projectName); //$NON-NLS-1$
- }
-
- public String toXmlString() {
- if(projectName == null) {
- throw new IllegalStateException("projectName not set"); //$NON-NLS-1$
- }
- StringBuffer xml = new StringBuffer();
- xml.append("<newProjectModel>").append(NL); //$NON-NLS-1$
- xml.append(INDENT).append("<project"); //$NON-NLS-1$
- for (Iterator i = projectAttributes.entrySet().iterator(); i.hasNext();) {
- Map.Entry entry = (Map.Entry) i.next();
- addAttribute(xml, (String)entry.getKey(), (String)entry.getValue());
- }
-// 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();
- xml.append(INDENT).append(otherElement).append(NL);
- }
- }
- 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) {
- if(otherInfo == null) {
- otherInfo = new LinkedHashMap();
- }
- if(xmlContent != null) {
- otherInfo.put(key, xmlContent);
- } else {
- otherInfo.remove(key);
- }
-
- }
- public void setLocation(String location) {
- setProjectAttribute("location", location); //$NON-NLS-1$
- }
-
- public void setProjectAttribute(String attributeName, String value) {
- projectAttributes.put(attributeName, value);
- }
-}
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
deleted file mode 100644
index 5b83af1..0000000
--- a/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/ui/newproject/NewProjectWizard.java
+++ /dev/null
@@ -1,193 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2009 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
- *
- * </copyright>
- *
- * $Id$
- * /
- *******************************************************************************/
-
-package org.eclipse.jet.ui.newproject;
-
-import java.lang.reflect.InvocationTargetException;
-import java.util.Arrays;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jdt.launching.IVMInstall;
-import org.eclipse.jdt.launching.JavaRuntime;
-import org.eclipse.jdt.launching.environments.IExecutionEnvironment;
-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;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.wizard.IWizardPage;
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.ui.INewWizard;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.ide.IDE;
-
-/**
- * Implement New Project Wizard for JET2 transforms.
- *
- */
-public class NewProjectWizard extends Wizard implements INewWizard {
-
- private static final String NEW_PROJECT_WIZARD_TX_ID = "org.eclipse.jet.transforms.newproject"; //$NON-NLS-1$
- private NewJETProjectPage1 projectPage;
-
- protected final NewProjectInfo newProjectInfo = new NewProjectInfo();
- private NewJETProjectPage2 projectPropertiesPage;
-
- /**
- *
- */
- public NewProjectWizard() {
- super();
- setWindowTitle(Messages.NewProjectWizard_WindowTitle);
- setDefaultPageImageDescriptor(Activator.getImageDescriptor("/icons/JET2ProjectWizardBanner.gif")); //$NON-NLS-1$
- setNeedsProgressMonitor(true);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.wizard.Wizard#performFinish()
- */
- public boolean performFinish() {
- try {
- getContainer().run(false, false, new IRunnableWithProgress() {
-
- public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
- IStatus result = JET2Platform.runTransformOnString(NEW_PROJECT_WIZARD_TX_ID, getBuildModel(), "xml", monitor); //$NON-NLS-1$
- if(!result.isOK()) {
- InternalJET2Platform.log(result);
- new ErrorDialog(getShell(), NewProjectWizard.this.getWindowTitle(),
- Messages.NewProjectWizard_ErrorInJETTransform,
- result, IStatus.ERROR | IStatus.WARNING).open();
- } else {
- final IPath mainTemplatePath = new Path(projectPage
- .getProjectName()).append(
- projectPage.getTemplateFolder()).append(
- "main.jet"); //$NON-NLS-1$
- final IFile mainTemplate = ResourcesPlugin
- .getWorkspace().getRoot().getFile(
- mainTemplatePath);
- if (mainTemplate.exists()) {
- try {
- IDE.openEditor(Activator.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage(),
- mainTemplate);
- } catch (PartInitException e) {
- InternalJET2Platform.logError(Messages.NewProjectWizard_ErrorCreatingProject, e);
- }
- }
- }
- }});
- } catch (InvocationTargetException e) {
- InternalJET2Platform.logError(Messages.NewProjectWizard_ErrorCreatingProject, e);
- } catch (InterruptedException e) {
- // cancelled, nothing to do
- }
- return true;
- }
-
- protected final String getBuildModel() {
- newProjectInfo.setProjectName(projectPage.getProjectName());
- if(!projectPage.useDefaults()) {
- newProjectInfo.setLocation(projectPage.getLocationPath().toString());
- }
- newProjectInfo.setProjectAttribute("binDir", projectPage.getJavaOutputFolder()); //$NON-NLS-1$
- newProjectInfo.setProjectAttribute("jet2javaDir", projectPage.getJETOutputFolder()); //$NON-NLS-1$
- newProjectInfo.setProjectAttribute("templatesDir", projectPage.getTemplateFolder()); //$NON-NLS-1$
- newProjectInfo.setProjectAttribute("bundleName", projectPropertiesPage.getTransformName()); //$NON-NLS-1$
- newProjectInfo.setProjectAttribute("bundleSymbolicName", projectPropertiesPage.getTransformID()); //$NON-NLS-1$
- newProjectInfo.setProjectAttribute("dfltJavaPackage", projectPage.getDefaultJavaPackage()); //$NON-NLS-1$
- newProjectInfo.setProjectAttribute("description", projectPropertiesPage.getTransformDescription()); //$NON-NLS-1$
- newProjectInfo.setProjectAttribute("templateLoader", projectPropertiesPage.getTemplateLoader()); //$NON-NLS-1$
- final String defaultEE = getDefaultExecutionEnv();
- if(defaultEE != null) {
- newProjectInfo.setProjectAttribute("executionEnv", defaultEE); //$NON-NLS-1$
- newProjectInfo.setProjectAttribute("useJava5", Boolean.toString(isDefaultEEJava5Compatible())); //$NON-NLS-1$
- }
- if(projectPropertiesPage.isExtension()) {
- newProjectInfo.setProjectAttribute("baseID", projectPropertiesPage.getBaseTransformID()); //$NON-NLS-1$
- final IJETBundleDescriptor descriptor = JET2Platform.getJETBundleManager().getDescriptor(projectPropertiesPage.getBaseTransformID());
- if(descriptor != null) {
- newProjectInfo.setProjectAttribute("baseStartTemplate", descriptor.getMainTemplate()); //$NON-NLS-1$
- }
- }
-
- return newProjectInfo.toXmlString();
- }
-
- private boolean isDefaultEEJava5Compatible() {
-
- final IVMInstall defaultVMInstall = JavaRuntime.getDefaultVMInstall();
- final IExecutionEnvironment java5ee = JavaRuntime.getExecutionEnvironmentsManager().getEnvironment("J2SE-1.5"); //$NON-NLS-1$
- return Arrays.asList(java5ee.getCompatibleVMs()).contains(defaultVMInstall);
- }
-
- private String getDefaultExecutionEnv() {
- final IVMInstall defaultVMInstall = JavaRuntime.getDefaultVMInstall();
- final IExecutionEnvironment[] ee = JavaRuntime.getExecutionEnvironmentsManager().getExecutionEnvironments();
- for (int i = 0; i < ee.length; i++) {
- if(ee[i].isStrictlyCompatible(defaultVMInstall)) {
- return ee[i].getId();
- }
- }
-
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IWorkbenchWizard#init(org.eclipse.ui.IWorkbench, org.eclipse.jface.viewers.IStructuredSelection)
- */
- public void init(IWorkbench workbench, IStructuredSelection selection) {
- // nothing to do here
- }
-
- public void addPages() {
- super.addPages();
-
- projectPage= new NewJETProjectPage1(Messages.NewProjectWizard_MainPageTabText);
- projectPage.setTitle(Messages.NewProjectWizard_MainPageTitle);
- projectPage.setDescription(Messages.NewProjectWizard_MainPageDescription);
- addPage(projectPage);
-
- 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
deleted file mode 100644
index 6a49c18..0000000
--- a/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/ui/newproject/messages.properties
+++ /dev/null
@@ -1,19 +0,0 @@
-#NLS_MESSAGEFORMAT_VAR
-NewJETProjectPage1Controls__groupgProjSet_text=Project Settings
-NewJETProjectPage1Controls__labellblTemplateFolder_text=&Template folder:
-NewJETProjectPage1Controls__labellblJETOutput_text=J&ET output folder:
-NewJETProjectPage1Controls__labellblJavaOutput_text=J&ava output folder:
-NewJETProjectPage1Controls__labellblDefJavaPackage_text=Default &Java package:
-
-NewJETProjectPage2Controls__groupgrpTransProps_text=Transformation (plug-in) Properties
-NewJETProjectPage2Controls__labellblID_text=Transformation &ID:
-NewJETProjectPage2Controls__labellblName_text=Transformation na&me:
-NewJETProjectPage2Controls__labellblDescription_text=Transformation &description:
-NewJETProjectPage2Controls__labellblTemplateLoader_text=Template &loader:
-NewJETProjectPage2Controls_grpExtensions_text=Extensions
-NewJETProjectPage2Controls_cbxExtends_text=E&xtend an existing JET Transformation
-NewJETProjectPage2Controls_lblBaseTx_text=Base &transformation:
-
-NewJETProjectPage2_description=Enter the data required to generate the JET transformation
-NewJETProjectPage2_InvalidID=Invalid ID. Legal characters are A-Z a-z 0-9 . _
-NewJETProjectPage2_title=JET Transformation Properties

Back to the top