Author: dgolovin
Date: 2008-10-27 12:19:02 -0400 (Mon, 27 Oct 2008)
New Revision: 11211
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetPreferenceInitializer.java
Log:
https://jira.jboss.org/jira/browse/JBDS-460 is fixed.
Seam FP runtime initialization is added.
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetPreferenceInitializer.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetPreferenceInitializer.java 2008-10-27
16:10:13 UTC (rev 11210)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetPreferenceInitializer.java 2008-10-27
16:19:02 UTC (rev 11211)
@@ -38,6 +38,9 @@
public static String RUNTIME_CONFIG_FORMAT_VERSION = "1.0"; //$NON-NLS-1$
+ public static final String SEAM_1_2_HOME = "../../../../jboss-eap/seam";
//$NON-NLS-1$
+ public static final String SEAM_2_0_HOME = "../../../../jboss-eap/seamfp";
//$NON-NLS-1$
+
/**
*
*/
@@ -52,27 +55,48 @@
.node(SeamCorePlugin.PLUGIN_ID);
node.put(SeamProjectPreferences.RUNTIME_CONFIG_FORMAT_VERSION,
RUNTIME_CONFIG_FORMAT_VERSION);
-// node.put(SeamProjectPreferences.SEAM_DEFAULT_CONNECTION_PROFILE,
"DefaultDS"); //$NON-NLS-1$
node.put(SeamProjectPreferences.JBOSS_AS_DEFAULT_DEPLOY_AS, "war");
//$NON-NLS-1$
node.put(SeamProjectPreferences.HIBERNATE_DEFAULT_DB_TYPE, "HSQL");
//$NON-NLS-1$
- initializeDefault(node,getSeamGenBuildPath());
+ Map<String, SeamRuntime> map = new HashMap<String,SeamRuntime>();
+
+ // Initialize Seam 1.2 Runtime from JBoss EAP
+ String seamGenBuildPath = getSeamGenBuildPath(SEAM_1_2_HOME);
+ File seamFolder = new File(seamGenBuildPath);
+ if(seamFolder.exists() && seamFolder.isDirectory()) {
+ SeamRuntime rt = new SeamRuntime();
+ rt.setHomeDir(seamGenBuildPath);
+ rt.setName("Seam " + SeamVersion.SEAM_1_2 + ".AP"); //$NON-NLS-1$
//$NON-NLS-2$
+ rt.setDefault(true);
+ rt.setVersion(SeamVersion.SEAM_1_2);
+ map.put(rt.getName(), rt);
+ }
+ // Initialize Seam 2.0 Runtime from JBoss EAP
+ seamGenBuildPath = getSeamGenBuildPath(SEAM_2_0_HOME);
+ seamFolder = new File(seamGenBuildPath);
+ if(seamFolder.exists() && seamFolder.isDirectory()) {
+ SeamRuntime rt = new SeamRuntime();
+ rt.setHomeDir(seamGenBuildPath);
+ rt.setName("Seam " + SeamVersion.SEAM_2_0 + ".FP"); //$NON-NLS-1$
//$NON-NLS-2$
+ rt.setDefault(true);
+ rt.setVersion(SeamVersion.SEAM_2_0);
+ map.put(rt.getName(), rt);
+ }
+ node.put(SeamProjectPreferences.RUNTIME_LIST, new
SeamRuntimeListConverter().getString(map));
try {
node.flush();
} catch (BackingStoreException e) {
SeamCorePlugin.getPluginLog().logError(e);
}
}
-
- public static final String SEAM_GEN_HOME = "../../../../jboss-eap/seam";
//$NON-NLS-1$
- public String getSeamGenBuildPath() {
+ private String getSeamGenBuildPath(String seamHomePath) {
String pluginLocation=null;
try {
pluginLocation =
FileLocator.resolve(SeamCorePlugin.getDefault().getBundle().getEntry("/")).getFile();
//$NON-NLS-1$
} catch (IOException e) {
SeamCorePlugin.getPluginLog().logError(e);
};
- File seamGenDir = new File(pluginLocation, SEAM_GEN_HOME);
+ File seamGenDir = new File(pluginLocation, seamHomePath);
Path p = new Path(seamGenDir.getPath());
p.makeAbsolute();
if(p.toFile().exists()) {
@@ -81,23 +105,4 @@
return ""; //$NON-NLS-1$
}
}
-
- /**
- * @param node
- * @param seamGenBuildPath
- * @return
- */
- public void initializeDefault(IEclipsePreferences node, String seamGenBuildPath) {
- Map<String, SeamRuntime> map = new HashMap<String,SeamRuntime>();
- File seamFolder = new File(seamGenBuildPath);
- if(seamFolder.exists() && seamFolder.isDirectory()) {
- SeamRuntime rt = new SeamRuntime();
- rt.setHomeDir(seamGenBuildPath);
- rt.setName("Seam " + SeamVersion.SEAM_1_2 + ".AP"); //$NON-NLS-1$
//$NON-NLS-2$
- rt.setDefault(true);
- rt.setVersion(SeamVersion.SEAM_1_2);
- map.put(rt.getName(), rt);
- }
- node.put(SeamProjectPreferences.RUNTIME_LIST, new
SeamRuntimeListConverter().getString(map));
- }
}