Author: akazakov
Date: 2007-10-31 14:10:04 -0400 (Wed, 31 Oct 2007)
New Revision: 4602
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/SeamInstallWizardPage.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/SeamRuntimeListFieldEditor.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-1130 Since that user cannot create seam runtime
with "wrong" version within new seam project wizard.
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/SeamInstallWizardPage.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/SeamInstallWizardPage.java 2007-10-31
18:05:01 UTC (rev 4601)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/SeamInstallWizardPage.java 2007-10-31
18:10:04 UTC (rev 4602)
@@ -658,16 +658,18 @@
public void run() {
List<SeamRuntime> added = new ArrayList<SeamRuntime>();
+ String seamVersion =
model.getProperty(IFacetDataModelProperties.FACET_VERSION_STR).toString();
+ List<SeamVersion> versians = new ArrayList<SeamVersion>(1);
+ versians.add(SeamVersion.parseFromString(seamVersion));
Wizard wiz = new SeamRuntimeNewWizard((List<SeamRuntime>)
new
ArrayList<SeamRuntime>(Arrays.asList(SeamRuntimeManager.getInstance().getRuntimes()))
- ,added);
+ , added, versians);
WizardDialog dialog = new WizardDialog(Display.getCurrent().getActiveShell(), wiz);
dialog.open();
if (added.size()>0) {
SeamRuntimeManager.getInstance().addRuntime(added.get(0));
- String seamVersion =
model.getProperty(IFacetDataModelProperties.FACET_VERSION_STR).toString();
List<String> runtimes = getRuntimeNames(seamVersion);
SeamRuntime newRuntime = added.get(0);
if(seamVersion.equals(newRuntime.getVersion().toString())) {
@@ -677,7 +679,7 @@
}
}
}
-
+
public class ConnectionProfileChangeListener implements IProfileListener {
/* (non-Javadoc)
* @see
org.eclipse.datatools.connectivity.IProfileListener#profileAdded(org.eclipse.datatools.connectivity.IConnectionProfile)
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/SeamRuntimeListFieldEditor.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/SeamRuntimeListFieldEditor.java 2007-10-31
18:05:01 UTC (rev 4601)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/SeamRuntimeListFieldEditor.java 2007-10-31
18:10:04 UTC (rev 4602)
@@ -322,10 +322,7 @@
IFieldEditor name = IFieldEditorFactory.INSTANCE.createTextEditor(
"name", SeamUIMessages.SEAM_RUNTIME_LIST_FIELD_EDITOR_NAME2, "");
//$NON-NLS-1$ //$NON-NLS-2$
- IFieldEditor version = IFieldEditorFactory.INSTANCE.createComboEditor(
- "version", SeamUIMessages.SEAM_RUNTIME_LIST_FIELD_EDITOR_VERSION2,
Arrays.asList( //$NON-NLS-1$
- new String[]{SeamVersion.SEAM_1_2.toString(), SeamVersion.SEAM_2_0.toString()}),
- SeamVersion.SEAM_1_2.toString(), false);
+ IFieldEditor version = null;
IFieldEditor homeDir = IFieldEditorFactory.INSTANCE.createBrowseFolderEditor(
"homeDir", SeamUIMessages.SEAM_RUNTIME_LIST_FIELD_EDITOR_HOME_FOLDER,
""); //$NON-NLS-1$ //$NON-NLS-2$
@@ -338,13 +335,33 @@
* @param style
*/
public SeamRuntimeWizardPage(List<SeamRuntime> editedList) {
+ this(editedList, null);
+ }
+
+ /**
+ * @param parent
+ * @param style
+ */
+ public SeamRuntimeWizardPage(List<SeamRuntime> editedList,
List<SeamVersion> validSeamVersions) {
super(SeamUIMessages.SEAM_RUNTIME_LIST_FIELD_EDITOR_NEW_SEAM_RUNTIME);
+ if(validSeamVersions==null) {
+ this.version = IFieldEditorFactory.INSTANCE.createComboEditor(
+ "version", SeamUIMessages.SEAM_RUNTIME_LIST_FIELD_EDITOR_VERSION2,
Arrays.asList( //$NON-NLS-1$
+ new String[]{SeamVersion.SEAM_1_2.toString(), SeamVersion.SEAM_2_0.toString()}),
+ SeamVersion.SEAM_1_2.toString(), false);
+ } else {
+ this.version = IFieldEditorFactory.INSTANCE.createComboEditor(
+ "version", SeamUIMessages.SEAM_RUNTIME_LIST_FIELD_EDITOR_VERSION2,
validSeamVersions,
+ SeamVersion.SEAM_1_2.toString(), false);
+ }
+
setMessage(SeamUIMessages.SEAM_RUNTIME_LIST_FIELD_EDITOR_CREATE_A_SEAM_RUNTIME);
setTitle(SeamUIMessages.SEAM_RUNTIME_LIST_FIELD_EDITOR_SEAM_RUNTIME);
setImageDescriptor(ImageDescriptor.createFromFile(
SeamFormWizard.class, "SeamWebProjectWizBan.png")); //$NON-NLS-1$
value = editedList;
}
+
/**
*
*/
@@ -478,14 +495,19 @@
SeamRuntimeWizardPage page1 = null;
List<SeamRuntime> added = null;
List<SeamRuntime> value = null;
- public SeamRuntimeNewWizard(List<SeamRuntime> value, List<SeamRuntime>
added) {
+
+ public SeamRuntimeNewWizard(List<SeamRuntime> value, List<SeamRuntime>
added, List<SeamVersion> validSeamVersions) {
super();
setWindowTitle(SeamUIMessages.SEAM_RUNTIME_LIST_FIELD_EDITOR_NEW_SEAM_RUNTIME);
- page1 = new SeamRuntimeWizardPage(value);
+ page1 = new SeamRuntimeWizardPage(value, validSeamVersions);
addPage(page1);
this.value = value;
this.added = added;
}
+
+ public SeamRuntimeNewWizard(List<SeamRuntime> value, List<SeamRuntime>
added) {
+ this(value, added, null);
+ }
@Override
public boolean performFinish() {