Author: dgolovin
Date: 2007-09-07 06:02:58 -0400 (Fri, 07 Sep 2007)
New Revision: 3483
Added:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/project/facet/SeamRuntime.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/project/facet/SeamRuntimeListConverter1.java
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
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/project/facet/SeamFacetPreference.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetInstallDelegete.java
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/templates/ejb/ejbModule/META-INF/MANIFEST.MF
Log:
http://jira.jboss.org/jira/browse/JBIDE-825
Seam Runtimes lis added on seam preference page
Seam runtime selection added to seam facet wizard page
JUnit tests for SeamRuntime manager
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/project/facet/SeamFacetPreference.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/project/facet/SeamFacetPreference.java 2007-09-07
10:02:48 UTC (rev 3482)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/project/facet/SeamFacetPreference.java 2007-09-07
10:02:58 UTC (rev 3483)
@@ -20,8 +20,12 @@
public class SeamFacetPreference {
public static final String SEAM_HOME_FOLDER = SeamCorePlugin.PLUGIN_ID +
".project.facet.seamhome";
public static final String SEAM_DEFAULT_CONNECTION_PROFILE = SeamCorePlugin.PLUGIN_ID +
".project.facet.default.conn.profile";
+ public static final String RUNTIME_CONFIG_FORMAT_VERSION = SeamCorePlugin.PLUGIN_ID +
".runtime.config.format.version";
+ public static final String RUNTIME_LIST =
SeamCorePlugin.PLUGIN_ID+".runtime.list";
+ public static final String RUNTIME_DEFAULT =
SeamCorePlugin.PLUGIN_ID+".runtime.default";
+
public static String getStringPreference(final String name) {
- return
SeamCorePlugin.getDefault().getPreferenceStore().getString(SeamFacetPreference.SEAM_HOME_FOLDER);
+ return SeamCorePlugin.getDefault().getPreferenceStore().getString(name);
}
}
Added:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/project/facet/SeamRuntime.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/project/facet/SeamRuntime.java
(rev 0)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/project/facet/SeamRuntime.java 2007-09-07
10:02:58 UTC (rev 3483)
@@ -0,0 +1,107 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.seam.core.project.facet;
+
+import java.io.File;
+
+/**
+ * @author eskimo
+ *
+ */
+public class SeamRuntime {
+
+ /**
+ *
+ */
+ SeamVersion version = null;
+
+ /**
+ *
+ */
+ String name = null;
+
+ /**
+ *
+ */
+ String homeDir = null;
+
+ /**
+ *
+ */
+ boolean defaultRt = false;
+
+ /**
+ *
+ */
+ public SeamRuntime() {}
+
+ /**
+ *
+ * @return
+ */
+ public SeamVersion getVersion() {
+ return version;
+ }
+
+ /**
+ *
+ * @return
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ *
+ * @return
+ */
+ public String getHomeDir() {
+ return homeDir;
+ }
+
+ /**
+ *
+ * @param version
+ */
+ public void setVersion(SeamVersion version) {
+ this.version = version;
+ }
+
+ /**
+ *
+ * @param name
+ */
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ /**
+ *
+ * @param homeDir
+ */
+ public void setHomeDir(String homeDir) {
+ this.homeDir = homeDir;
+ }
+
+ /**
+ * @param b
+ */
+ public void setDefault(boolean b) {
+ this.defaultRt = b;
+ }
+
+ /**
+ * @return
+ */
+ public boolean isDefault() {
+ return defaultRt;
+ }
+}
Property changes on:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/project/facet/SeamRuntime.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/project/facet/SeamRuntimeListConverter1.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/project/facet/SeamRuntimeListConverter1.java
(rev 0)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/project/facet/SeamRuntimeListConverter1.java 2007-09-07
10:02:58 UTC (rev 3483)
@@ -0,0 +1,70 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.seam.core.project.facet;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.StringTokenizer;
+
+/**
+ * @author eskimo
+ *
+ */
+public class SeamRuntimeListConverter1 {
+
+ public Map<String,SeamRuntime> getMap(String input) {
+
+ Map<String,SeamRuntime> result = new HashMap<String,SeamRuntime>();
+ if(input==null || "".equals(input.trim())) {
+ return result;
+ }
+
+ StringTokenizer runtimes = new StringTokenizer(input,",");
+ while (runtimes.hasMoreTokens()) {
+ String runtime = runtimes.nextToken();
+ String[] map = runtime.split("\\|");
+ SeamRuntime rt = new SeamRuntime();
+ for (int i=0;i<map.length;i+=2) {
+ String name = map[i];
+ String value = i+1<map.length?map[i+1]:"";
+ if("name".equals(name)) {
+ rt.setName(value);
+ } else if("homeDir".equals(name)) {
+ rt.setHomeDir(value);
+ } else if ("version".equals(name)) {
+ rt.setVersion(SeamVersion.parseFromString(value));
+ } else if("default".equals(name)) {
+ rt.setDefault(Boolean.parseBoolean(value));
+ }
+ }
+ result.put(rt.getName(),rt);
+ }
+
+ return result;
+ }
+
+ public String getString(Map<String,SeamRuntime> runtimeMap) {
+ StringBuffer buffer = new StringBuffer();
+ SeamRuntime[] runtimes = runtimeMap.values().toArray(new
SeamRuntime[runtimeMap.size()]);
+ for (int i=0;i<runtimes.length;i++) {
+ buffer.append("name|");
+ buffer.append(runtimes[i].getName());
+ buffer.append("|version|");
+ buffer.append(runtimes[i].getVersion().toString());
+ buffer.append("|homeDir|");
+ buffer.append(runtimes[i].getHomeDir());
+ buffer.append("|default|");
+ buffer.append(runtimes[i].isDefault());
+ if(i!=runtimes.length-1) buffer.append(",");
+ }
+ return buffer.toString();
+ }
+}
Property changes on:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/project/facet/SeamRuntimeListConverter1.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
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
(rev 0)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/project/facet/SeamRuntimeManager.java 2007-09-07
10:02:58 UTC (rev 3483)
@@ -0,0 +1,171 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.seam.core.project.facet;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.preferences.IEclipsePreferences;
+import org.jboss.tools.seam.core.SeamCorePlugin;
+import org.jboss.tools.seam.internal.core.SeamPreferenceInitializer;
+import org.jboss.tools.seam.internal.core.project.facet.SeamFacetPreferenceInitializer;
+
+/**
+ * @author eskimo
+ *
+ */
+public class SeamRuntimeManager {
+
+ private static SeamRuntimeListConverter1 converter = new SeamRuntimeListConverter1();
+
+ private Map<String, SeamRuntime> runtimes = new HashMap<String,
SeamRuntime>();
+
+ private SeamRuntime defaultRt = null;
+
+ /**
+ *
+ */
+ static class SeamRuntimeManagerHolder {
+ private static final SeamRuntimeManager INSTANCE = new SeamRuntimeManager();
+ }
+
+ /**
+ *
+ * @return
+ */
+ public static SeamRuntimeManager getInstance() {
+ return SeamRuntimeManagerHolder.INSTANCE;
+ }
+
+ /**
+ *
+ */
+ private SeamRuntimeManager() {
+ String configVersion = SeamFacetPreference.getStringPreference(
+ SeamFacetPreference.RUNTIME_CONFIG_FORMAT_VERSION);
+ String runtimeListString = SeamFacetPreference.getStringPreference(
+ SeamFacetPreference.RUNTIME_LIST);
+
+ runtimes = converter.getMap(runtimeListString);
+ }
+
+ /**
+ *
+ * @return
+ */
+ public SeamRuntime[] getRuntimes() {
+ Collection<SeamRuntime> c = runtimes.values();
+ return c.toArray(new SeamRuntime[runtimes.size()]);
+ }
+
+ /**
+ *
+ * @param version
+ * @return
+ */
+ public SeamRuntime[] getRuntimes(SeamVersion version) {
+ Collection<SeamRuntime> c = runtimes.values();
+ List<SeamRuntime> rts = new ArrayList<SeamRuntime>();
+ for (SeamRuntime seamRuntime : c) {
+ if(seamRuntime.getVersion()==version)rts.add(seamRuntime);
+ }
+ return rts.toArray(new SeamRuntime[rts.size()]);
+ }
+
+ /**
+ *
+ * @param runtime
+ */
+ public void addRuntime(SeamRuntime runtime) {
+ runtimes.put(runtime.getName(),runtime);
+ if(getDefaultRuntime()!=null && runtime.isDefault()) {
+ getDefaultRuntime().setDefault(false);
+ }
+
+ save();
+ }
+
+ /**
+ *
+ * @param name
+ * @param path
+ * @param version
+ * @param defaultRt
+ */
+ public void addRuntime(String name, String path, SeamVersion version, boolean defaultRt)
{
+ SeamRuntime seamRt = new SeamRuntime();
+ seamRt.setVersion(version);
+ seamRt.setHomeDir(path);
+ seamRt.setName(name);
+ seamRt.setDefault(defaultRt);
+ addRuntime(seamRt);
+ }
+
+ /**
+ *
+ * @param name
+ * @return
+ */
+ public SeamRuntime findRuntimeByName(String name) {
+ for (SeamRuntime seamRuntime : runtimes.values()) {
+ if(seamRuntime.getName().equals(name))return seamRuntime;
+ }
+ return null;
+ }
+
+ /**
+ *
+ * @param rt
+ */
+ public void removeRuntime(SeamRuntime rt) {
+ runtimes.remove(rt.getName());
+ }
+
+ /**
+ *
+ * @param project
+ * @return
+ */
+ public SeamRuntime getRuntimeForProject(IProject project) {
+ return null;
+ }
+
+ /**
+ *
+ */
+ public void save() {
+ SeamCorePlugin.getDefault().getPluginPreferences().setValue(
+ SeamFacetPreference.RUNTIME_LIST, converter.getString(runtimes));
+ }
+
+ /**
+ *
+ * @return
+ */
+ public SeamRuntime getDefaultRuntime() {
+ for (SeamRuntime rt : runtimes.values()) {
+ if(rt.isDefault())return rt;
+ }
+ return null;
+ }
+
+ /**
+ *
+ */
+ public String getConfigurationVersion() {
+ return SeamFacetPreferenceInitializer.RUNTIME_CONFIG_FORMAT_VERSION;
+ }
+}
Property changes on:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/project/facet/SeamRuntimeManager.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
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
(rev 0)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/project/facet/SeamVersion.java 2007-09-07
10:02:58 UTC (rev 3483)
@@ -0,0 +1,42 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.seam.core.project.facet;
+
+/**
+ * @author eskimo
+ *
+ */
+public enum SeamVersion {
+ SEAM_1_2("1.2"), SEAM_2_0("2.0");
+
+ String version = "";
+
+ public static final String V_1_2 = "1.2";
+
+ public static final String V_2_0 = "2.0";
+
+ SeamVersion(String version) {
+ this.version = version;
+ }
+
+ public String toString() {
+ return version;
+ }
+
+ static public SeamVersion parseFromString(String version) {
+ if(V_1_2.equals(version)) {
+ return SEAM_1_2;
+ } else if(V_2_0.equals(version)) {
+ return SEAM_2_0;
+ }
+ throw new IllegalArgumentException("Seam version " + version + "is not
supported");
+ }
+}
Property changes on:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/project/facet/SeamVersion.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetInstallDelegete.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetInstallDelegete.java 2007-09-07
10:02:48 UTC (rev 3482)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetInstallDelegete.java 2007-09-07
10:02:58 UTC (rev 3483)
@@ -47,6 +47,8 @@
import org.jboss.tools.common.model.util.EclipseResourceUtil;
import org.jboss.tools.seam.core.ISeamProject;
import org.jboss.tools.seam.core.SeamCorePlugin;
+import org.jboss.tools.seam.core.project.facet.SeamRuntime;
+import org.jboss.tools.seam.core.project.facet.SeamRuntimeManager;
public class SeamFacetInstallDelegete extends Object implements IDelegate {
@@ -205,9 +207,10 @@
final File webLibFolder = new File(webContentFolder,WEB_LIBRARIES_RELATED_PATH);
final File srcFolder = srcRootFolder.getUnderlyingFolder().getLocation().toFile();
final File webMetaInf = new File(webContentFolder, "META-INF");
+ final SeamRuntime selectedRuntime =
SeamRuntimeManager.getInstance().findRuntimeByName(model.getProperty(ISeamFacetDataModelProperties.JBOSS_SEAM_HOME).toString());
+
+ final String seamHomePath = selectedRuntime.getHomeDir();
- final String seamHomePath =
model.getProperty(ISeamFacetDataModelProperties.JBOSS_SEAM_HOME).toString();
-
final File seamHomeFolder = new File(seamHomePath);
final File seamLibFolder = new File(seamHomePath,SEAM_LIB_RELATED_PATH);
final File seamGenResFolder = new File(seamHomePath,"seam-gen/resources");
@@ -260,15 +263,12 @@
AntCopyUtils.copyFilesAndFolders(
seamGenResFolder,srcFolder,new AntCopyUtils.FileSetFileFilter(webInfClassesSet),
viewFilterSetCollection, true);
- FilterSetCollection hibernateDialectFilterSet = new FilterSetCollection();
+ final FilterSetCollection hibernateDialectFilterSet = new FilterSetCollection();
hibernateDialectFilterSet.addFilterSet(jdbcFilterSet);
hibernateDialectFilterSet.addFilterSet(projectFilterSet);
hibernateDialectFilterSet.addFilterSet(SeamFacetFilterSetFactory.createHibernateDialectFilterSet(model));
- AntCopyUtils.copyFileToFolder(
- hibernateConsolePropsFile,
- project.getLocation().toFile(),
- hibernateDialectFilterSet, true);
+
//
********************************************************************************************
// Handle WAR/EAR configurations
@@ -312,6 +312,11 @@
new File(project.getLocation().toFile(),project.getName()+".launch"),
new FilterSetCollection(projectFilterSet), true);
+ AntCopyUtils.copyFileToFolder(
+ hibernateConsolePropsFile,
+ project.getLocation().toFile(),
+ hibernateDialectFilterSet, true);
+
// Copy JDBC driver if there is any
if(model.getProperty(ISeamFacetDataModelProperties.JDBC_DRIVER_JAR_PATH)!=null)
AntCopyUtils.copyFiles((String[])model.getProperty(ISeamFacetDataModelProperties.JDBC_DRIVER_JAR_PATH),
webLibFolder);
@@ -391,11 +396,17 @@
protected IStatus run(IProgressMonitor monitor) {
IProject ear =
WtpUtils.createEclipseProject(model.getProperty(ISeamFacetDataModelProperties.SEAM_PROJECT_NAME)+"-ear",
monitor);
- IProject ejb =
WtpUtils.createEclipseProject(model.getProperty(ISeamFacetDataModelProperties.SEAM_PROJECT_NAME)+"-ejb",
monitor); try {
+ IProject ejb =
WtpUtils.createEclipseProject(model.getProperty(ISeamFacetDataModelProperties.SEAM_PROJECT_NAME)+"-ejb",
monitor);
+ try {
FilterSet filterSet = new FilterSet();
filterSet.addFilter("projectName", project.getName());
- filterSet.addFilter("runtimeName",
WtpUtils.getServerRuntimeName(project));
-
+ filterSet.addFilter("runtimeName",
WtpUtils.getServerRuntimeName(project));
+ if(model.getProperty(ISeamFacetDataModelProperties.JDBC_DRIVER_JAR_PATH)!=null) {
+ File driver = new
File(((String[])model.getProperty(ISeamFacetDataModelProperties.JDBC_DRIVER_JAR_PATH))[0]);
+ filterSet.addFilter("driverJar"," " + driver.getName() +
"\n");
+ } else {
+ filterSet.addFilter("driverJar","");
+ }
AntCopyUtils.FileSet excludeCvsSvn = new
AntCopyUtils.FileSet(CVS_SVN).dir(seamGenResFolder);
AntCopyUtils.copyFilesAndFolders(
@@ -434,11 +445,18 @@
new File(ejb.getLocation().toFile(),".settings"),
new FilterSetCollection(projectFilterSet), true);
+ FilterSet ejbFilterSet = new FilterSet();
+ ejbFilterSet.addFilter("projectName",ejb.getName());
+
AntCopyUtils.copyFileToFile(
hibernateConsoleLaunchFile,
new File(ejb.getLocation().toFile(),ejb.getName()+".launch"),
- new FilterSetCollection(projectFilterSet), true);
+ new FilterSetCollection(ejbFilterSet), true);
+ AntCopyUtils.copyFileToFolder(
+ hibernateConsolePropsFile,
+ ejb.getLocation().toFile(),
+ hibernateDialectFilterSet, true);
File earContentsFolder = new
File(ear.getLocation().toFile(),"EarContent");
File earContentsMetaInfFolder = new File(earContentsFolder,"META-INF");
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 2007-09-07
10:02:48 UTC (rev 3482)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetPreferenceInitializer.java 2007-09-07
10:02:58 UTC (rev 3483)
@@ -13,6 +13,8 @@
import java.io.File;
import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
import org.eclipse.core.runtime.FileLocator;
import org.eclipse.core.runtime.Path;
@@ -22,6 +24,9 @@
import org.eclipse.core.runtime.preferences.IScopeContext;
import org.jboss.tools.seam.core.SeamCorePlugin;
import org.jboss.tools.seam.core.project.facet.SeamFacetPreference;
+import org.jboss.tools.seam.core.project.facet.SeamRuntime;
+import org.jboss.tools.seam.core.project.facet.SeamRuntimeListConverter1;
+import org.jboss.tools.seam.core.project.facet.SeamVersion;
/**
* @author eskimo
@@ -30,6 +35,8 @@
public class SeamFacetPreferenceInitializer extends
AbstractPreferenceInitializer {
+ public static String RUNTIME_CONFIG_FORMAT_VERSION = "1.0";
+
/**
*
*/
@@ -39,7 +46,8 @@
public void initializeDefaultPreferences() {
IScopeContext context = new DefaultScope();
IEclipsePreferences node = context.getNode(SeamCorePlugin.PLUGIN_ID);
- node.put(SeamFacetPreference.SEAM_HOME_FOLDER, getSeamGenBuildPath());
+ node.put(SeamFacetPreference.RUNTIME_CONFIG_FORMAT_VERSION,
RUNTIME_CONFIG_FORMAT_VERSION);
+ initializeDefault(node,getSeamGenBuildPath());
}
public static final String SEAM_GEN_HOME = "../../../../jboss-eap/seam";
@@ -61,4 +69,22 @@
}
}
+ /**
+ * @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(seamFolder.getName()+"."+SeamVersion.V_1_2);
+ rt.setDefault(true);
+ rt.setVersion(SeamVersion.SEAM_1_2);
+ map.put(rt.getName(), rt);
+ }
+ node.put(SeamFacetPreference.RUNTIME_LIST, new
SeamRuntimeListConverter1().getString(map));
+ }
}
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/templates/ejb/ejbModule/META-INF/MANIFEST.MF
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/templates/ejb/ejbModule/META-INF/MANIFEST.MF 2007-09-07
10:02:48 UTC (rev 3482)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/templates/ejb/ejbModule/META-INF/MANIFEST.MF 2007-09-07
10:02:58 UTC (rev 3483)
@@ -1,3 +1,4 @@
Manifest-Version: 1.0
Class-Path: jboss-seam.jar
- testng-4.5.1-jdk15.jar
+ testng-4.5.1-jdk15.jar
+@driverJar@
\ No newline at end of file