Author: akazakov
Date: 2012-01-19 18:16:38 -0500 (Thu, 19 Jan 2012)
New Revision: 37978
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/plugin.xml
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/project/facet/SeamRuntimeManager.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/project/facet/SeamVersion.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/Seam2ProjectCreator.java
trunk/seam/plugins/org.jboss.tools.seam.ui/plugin.xml
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/wizard/SeamGenerateEntitiesWizard.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamProjectWizard.java
trunk/seam/tests/org.jboss.tools.seam.base.test/src/org/jboss/tools/seam/core/test/project/facet/AbstractSeamFacetTest.java
Log:
https://issues.jboss.org/browse/JBIDE-10679 Seam facet version 2.3
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/plugin.xml
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/plugin.xml 2012-01-19 23:16:27 UTC (rev
37977)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/plugin.xml 2012-01-19 23:16:38 UTC (rev
37978)
@@ -165,6 +165,36 @@
</or>
</constraint>
</project-facet-version>
+ <project-facet-version
+ facet="jst.seam"
+ version="2.3">
+ <constraint>
+ <or>
+ <requires
+ facet="jst.ear"
+ version="[5.0">
+ </requires>
+ <requires
+ facet="jst.ejb"
+ version="[3.0">
+ </requires>
+ <and>
+ <requires
+ facet="jst.web"
+ version="[2.5">
+ </requires>
+ <requires
+ facet="jst.jsf"
+ version="[1.2">
+ </requires>
+ <requires
+ facet="jst.java"
+ version="[5.0">
+ </requires>
+ </and>
+ </or>
+ </constraint>
+ </project-facet-version>
<action
facet="jst.seam"
id="jst.seam.1.2.install"
@@ -215,6 +245,18 @@
</action>
<action
facet="jst.seam"
+ id="jst.seam.2.3.install"
+ type="install"
+ version="2.3">
+ <delegate
+
class="org.jboss.tools.seam.internal.core.project.facet.Seam2FacetInstallDelegate">
+ </delegate>
+ <config-factory
+
class="org.jboss.tools.seam.internal.core.project.facet.SeamFacetInstallDataModelProvider">
+ </config-factory>
+ </action>
+ <action
+ facet="jst.seam"
id="jst.seam.1.2.uninstall"
type="uninstall"
version="1.2">
@@ -286,6 +328,20 @@
id="jst.seam22.preset">
</preset>
</template>
+
+ <template
+ id="template.jst.seam23">
+ <label>
+ Seam 2.3 Web Project
+ </label>
+ <fixed
+ facet="jst.java"/>
+ <fixed
+ facet="jst.web"/>
+ <preset
+ id="jst.seam23.preset">
+ </preset>
+ </template>
</extension>
<extension
@@ -334,6 +390,17 @@
Configures a Dynamic Web application to use Seam v2.2
</description>
</static-preset>
+ <static-preset
+ id="jst.seam23.preset">
+ <label>Dynamic Web Project with Seam 2.3 (Technical Preview)</label>
+ <facet id="jst.java" version="5.0"/>
+ <facet id="jst.web" version="2.5"/>
+ <facet id="jst.jsf" version="1.2"/>
+ <facet id="jst.seam" version="2.3"/>
+ <description>
+ Configures a Dynamic Web application to use Seam v2.3 (Technical Preview)
+ </description>
+ </static-preset>
</extension>
<extension
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/project/facet/SeamRuntimeManager.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/project/facet/SeamRuntimeManager.java 2012-01-19
23:16:27 UTC (rev 37977)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/project/facet/SeamRuntimeManager.java 2012-01-19
23:16:38 UTC (rev 37978)
@@ -116,7 +116,7 @@
* then the default one will be returned.
*/
public SeamRuntime getLatestSeamRuntime() {
- SeamVersion latestVersion = SeamVersion.SEAM_1_2;
+ SeamVersion latestVersion = SeamVersion.getLatestDefaultVersion();
for (SeamRuntime runtime : runtimes.values()) {
if(runtime.getVersion().compareTo(latestVersion)>=0) {
latestVersion = runtime.getVersion();
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/project/facet/SeamVersion.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/project/facet/SeamVersion.java 2012-01-19
23:16:27 UTC (rev 37977)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/project/facet/SeamVersion.java 2012-01-19
23:16:38 UTC (rev 37978)
@@ -18,7 +18,6 @@
*
* @author eskimo
*/
-
public enum SeamVersion {
/**
* Seam versions 1.2.X
@@ -34,11 +33,17 @@
* Seam versions 2.1.X
*/
SEAM_2_1("2.1"), //$NON-NLS-1$
+
/**
* Seam versions 2.2.X
*/
- SEAM_2_2("2.2"); //$NON-NLS-1$
-
+ SEAM_2_2("2.2"), //$NON-NLS-1$
+
+ /**
+ * Seam versions 2.3.X
+ */
+ SEAM_2_3("2.3"); //$NON-NLS-1$
+
String version = ""; //$NON-NLS-1$
SeamVersion(String version) {
@@ -55,7 +60,7 @@
return version;
}
- public static SeamVersion[] ALL_VERSIONS = new SeamVersion[]{SEAM_1_2, SEAM_2_0,
SEAM_2_1, SEAM_2_2};
+ public static SeamVersion[] ALL_VERSIONS = new SeamVersion[]{SEAM_1_2, SEAM_2_0,
SEAM_2_1, SEAM_2_2, SEAM_2_3};
/**
* Get enumeration by string
@@ -75,11 +80,18 @@
return SEAM_2_1;
} else if (SEAM_2_2.toString().equals(version)) {
return SEAM_2_2;
+ } else if (SEAM_2_3.toString().equals(version)) {
+ return SEAM_2_3;
}
+
throw new IllegalArgumentException(NLS.bind(
"Seam version ''{0}'' is not supported", version));
//$NON-NLS-1$ //$NON-NLS-2$
}
+ public static SeamVersion getLatestDefaultVersion() {
+ return SEAM_2_2;
+ }
+
/**
* Get enumeration by string
* If can't find any version then return null.
@@ -98,6 +110,8 @@
return SEAM_2_1;
} else if (SEAM_2_2.toString().equals(version)) {
return SEAM_2_2;
+ } else if (SEAM_2_3.toString().equals(version)) {
+ return SEAM_2_3;
}
return null;
}
@@ -123,6 +137,9 @@
if(SeamUtil.areSeamVersionsMatched(SeamVersion.SEAM_2_2.toString(), vs)) {
return SeamVersion.SEAM_2_2;
}
+ if(SeamUtil.areSeamVersionsMatched(SeamVersion.SEAM_2_3.toString(), vs)) {
+ return SeamVersion.SEAM_2_3;
+ }
return null;
}
}
\ No newline at end of file
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/Seam2ProjectCreator.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/Seam2ProjectCreator.java 2012-01-19
23:16:27 UTC (rev 37977)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/Seam2ProjectCreator.java 2012-01-19
23:16:38 UTC (rev 37978)
@@ -200,9 +200,9 @@
testSrcDir, //$NON-NLS-1$
new FilterSetCollection(filterSet), true);
- // Add "org.jboss.seam.core.init.debug=false" for Seam 2.1/2.2
+ // Add "org.jboss.seam.core.init.debug=false" for Seam 2.1/2.2/2.3
// to seam.properties file to avoid
https://jira.jboss.org/jira/browse/JBIDE-3623
- if(getVersion() == SeamVersion.SEAM_2_1 || getVersion() == SeamVersion.SEAM_2_2) {
+ if(getVersion() == SeamVersion.SEAM_2_1 || getVersion() == SeamVersion.SEAM_2_2 ||
getVersion() == SeamVersion.SEAM_2_3) {
Properties seamProperties = new Properties();
File testSeamPropertiesFile = new File(testSrcDir, "seam.properties");
FileInputStream inStream = null;
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/plugin.xml
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/plugin.xml 2012-01-19 23:16:27 UTC (rev
37977)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/plugin.xml 2012-01-19 23:16:38 UTC (rev
37978)
@@ -112,6 +112,9 @@
<wizard-pages action="jst.seam.2.2.install">
<page
class="org.jboss.tools.seam.ui.internal.project.facet.SeamInstallWizardPage"/>
</wizard-pages>
+ <wizard-pages action="jst.seam.2.3.install">
+ <page
class="org.jboss.tools.seam.ui.internal.project.facet.SeamInstallWizardPage"/>
+ </wizard-pages>
</extension>
<extension
point="org.eclipse.ui.views">
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 2012-01-19
23:16:27 UTC (rev 37977)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/SeamRuntimeListFieldEditor.java 2012-01-19
23:16:38 UTC (rev 37978)
@@ -504,13 +504,15 @@
SeamVersion.SEAM_1_2.toString(),
SeamVersion.SEAM_2_0.toString(),
SeamVersion.SEAM_2_1.toString(),
- SeamVersion.SEAM_2_2.toString()}),
+ SeamVersion.SEAM_2_2.toString(),
+ SeamVersion.SEAM_2_3.toString()}),
SeamVersion.SEAM_1_2.toString(), false);
this.validSeamVersions = new ArrayList<SeamVersion>();
this.validSeamVersions.add(SeamVersion.SEAM_1_2);
this.validSeamVersions.add(SeamVersion.SEAM_2_0);
this.validSeamVersions.add(SeamVersion.SEAM_2_1);
this.validSeamVersions.add(SeamVersion.SEAM_2_2);
+ this.validSeamVersions.add(SeamVersion.SEAM_2_3);
} else {
this.version = IFieldEditorFactory.INSTANCE.createComboEditor(
SRT_VERSION,
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamGenerateEntitiesWizard.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamGenerateEntitiesWizard.java 2012-01-19
23:16:27 UTC (rev 37977)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamGenerateEntitiesWizard.java 2012-01-19
23:16:38 UTC (rev 37978)
@@ -125,7 +125,8 @@
wc.setAttribute(HibernateLaunchConstants.ATTR_AUTOMATIC_VERSIONING, true);
boolean seam21 =
seamProject.getRuntime().getVersion().compareTo(SeamVersion.SEAM_2_1) >= 0 ||
- seamProject.getRuntime().getVersion().compareTo(SeamVersion.SEAM_2_2) >= 0;
+ seamProject.getRuntime().getVersion().compareTo(SeamVersion.SEAM_2_2) >= 0 ||
+ seamProject.getRuntime().getVersion().compareTo(SeamVersion.SEAM_2_3) >= 0;
// Only Seam 2.1 does not break when generating from one-to-one
wc.setAttribute(HibernateLaunchConstants.ATTR_AUTOMATIC_ONE_TO_ONE, seam21);
}
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-01-19
23:16:27 UTC (rev 37977)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamProjectWizard.java 2012-01-19
23:16:38 UTC (rev 37978)
@@ -139,6 +139,7 @@
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$
private static final Map<String, String> templates = new HashMap<String,
String>();
static {
@@ -146,6 +147,7 @@
templates.put("jst.seam2.preset", templateJstSeam2); //$NON-NLS-1$
templates.put("jst.seam21.preset", templateJstSeam21); //$NON-NLS-1$
templates.put("jst.seam22.preset", templateJstSeam22); //$NON-NLS-1$
+ templates.put("jst.seam23.preset", templateJstSeam23); //$NON-NLS-1$
}
private void setSeamConfigTemplate(String seamConfigTemplate) {
@@ -293,6 +295,11 @@
return null;
}
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.jst.servlet.ui.project.facet.WebProjectWizard#getTemplate()
+ */
+ @Override
protected IFacetedProjectTemplate getTemplate() {
seamConfigTemplate =
SeamCorePlugin.getDefault().getPluginPreferences().getString(SeamProjectPreferences.SEAM_CONFIG_TEMPLATE);
if(seamConfigTemplate==null || seamConfigTemplate.length()==0) {
@@ -304,6 +311,8 @@
seamConfigTemplate = templateJstSeam2;
} else if(runtime.getVersion()==SeamVersion.SEAM_2_1) {
seamConfigTemplate = templateJstSeam21;
+ } else if(runtime.getVersion()==SeamVersion.SEAM_2_3) {
+ seamConfigTemplate = templateJstSeam23;
} else {
seamConfigTemplate = templateJstSeam22;
}
Modified:
trunk/seam/tests/org.jboss.tools.seam.base.test/src/org/jboss/tools/seam/core/test/project/facet/AbstractSeamFacetTest.java
===================================================================
---
trunk/seam/tests/org.jboss.tools.seam.base.test/src/org/jboss/tools/seam/core/test/project/facet/AbstractSeamFacetTest.java 2012-01-19
23:16:27 UTC (rev 37977)
+++
trunk/seam/tests/org.jboss.tools.seam.base.test/src/org/jboss/tools/seam/core/test/project/facet/AbstractSeamFacetTest.java 2012-01-19
23:16:38 UTC (rev 37978)
@@ -244,12 +244,11 @@
SeamProjectCreator creator = null;
if(seamVersion == SeamVersion.SEAM_1_2) {
creator = new SeamProjectCreator(config, proj);
- } else if(seamVersion == SeamVersion.SEAM_2_0) {
+ } else if(seamVersion == SeamVersion.SEAM_2_0 ||
+ seamVersion == SeamVersion.SEAM_2_1 ||
+ seamVersion == SeamVersion.SEAM_2_2 ||
+ seamVersion == SeamVersion.SEAM_2_3) {
creator = new Seam2ProjectCreator(config, proj);
- } else if(seamVersion == SeamVersion.SEAM_2_1) {
- creator = new Seam2ProjectCreator(config, proj);
- } else if(seamVersion == SeamVersion.SEAM_2_2) {
- creator = new Seam2ProjectCreator(config, proj);
} else {
throw new RuntimeException("Can't get seam version from seam facet
model");
}