Author: akazakov
Date: 2012-05-14 16:20:29 -0400 (Mon, 14 May 2012)
New Revision: 41008
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamProjectWizard.java
Log:
https://issues.jboss.org/browse/JBIDE-11815 Default for Configuration on New Seam Project
wizard should be Seam 2.3 when JBoss AS 7 is selected as Target runtime
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamProjectWizard.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamProjectWizard.java 2012-05-14
20:00:20 UTC (rev 41007)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamProjectWizard.java 2012-05-14
20:20:29 UTC (rev 41008)
@@ -141,11 +141,11 @@
return firstPage;
}
- private static final String templateJstSeam1 = "template.jst.seam";
//$NON-NLS-1$
- private static final String templateJstSeam2 = "template.jst.seam2";
//$NON-NLS-1$
- private static final String templateJstSeam21 = "template.jst.seam21";
//$NON-NLS-1$
- private static final String templateJstSeam22 = "template.jst.seam22";
//$NON-NLS-1$
- private static final String templateJstSeam23 = "template.jst.seam23";
//$NON-NLS-1$
+ static final String templateJstSeam1 = "template.jst.seam"; //$NON-NLS-1$
+ static final String templateJstSeam2 = "template.jst.seam2"; //$NON-NLS-1$
+ static final String templateJstSeam21 = "template.jst.seam21"; //$NON-NLS-1$
+ static final String templateJstSeam22 = "template.jst.seam22"; //$NON-NLS-1$
+ static final String templateJstSeam23 = "template.jst.seam23"; //$NON-NLS-1$
private static final Map<String, String> templates = new HashMap<String,
String>();
static {
@@ -577,7 +577,7 @@
return launchNewServerWizard(shell, model, null);
}
- private boolean setWebModuleVersion() {
+ public boolean isAs7Selected() {
String runtimeName = serverRuntimeTargetCombo.getText();
if(RuntimeManager.isRuntimeDefined(runtimeName)) {
IRuntime targetRuntime = RuntimeManager.getRuntime(runtimeName);
@@ -586,12 +586,7 @@
for (IRuntimeComponent component : components) {
String typeId = component.getProperty("type-id");
if(typeId!=null &&
typeId.startsWith("org.jboss.ide.eclipse.as.runtime.7")) {
- if(primaryVersionCombo.getItemCount()>0) {
-// System.out.println(primaryVersionCombo.getItem(primaryVersionCombo.getItemCount()-1));
- primaryVersionCombo.select(primaryVersionCombo.getItemCount()-1);
- return true;
- }
- break;
+ return true;
}
}
}
@@ -599,6 +594,21 @@
return false;
}
+ public boolean setWebModuleVersion() {
+ if(isAs7Selected() && primaryVersionCombo.getItemCount()>0) {
+ primaryVersionCombo.select(primaryVersionCombo.getItemCount()-1);
+ seamConfigTemplate = templateJstSeam23;
+ SeamProjectWizard.this.template =
ProjectFacetsManager.getTemplate(seamConfigTemplate);
+ getFacetedProjectWorkingCopy().setFixedProjectFacets(SeamProjectWizard.this.template.getFixedProjectFacets());
+
+ final IPreset preset = SeamProjectWizard.this.template.getInitialPreset();
+ getFacetedProjectWorkingCopy().setSelectedPreset(preset.getId());
+
+ return true;
+ }
+ return false;
+ }
+
@Override
public IProjectFacetVersion getPrimaryFacetVersion() {
return super.getPrimaryFacetVersion();