[112729] Tomcat utility projects
diff --git a/plugins/org.eclipse.jst.server.core/plugin.properties b/plugins/org.eclipse.jst.server.core/plugin.properties
index f943fb5..b9a96a8 100644
--- a/plugins/org.eclipse.jst.server.core/plugin.properties
+++ b/plugins/org.eclipse.jst.server.core/plugin.properties
@@ -19,7 +19,7 @@
moduleTypeJ2EERARName=J2EE Connector module
moduleTypeJ2EEClientName=J2EE Application Client module
moduleTypeJ2EEEARName=J2EE Enterprise application
-moduleTypeJ2EEUtilityName=J2EE utility jar
+moduleTypeJ2EEUtilityName=J2EE utility jar
launchableJndi=JNDI Object
launchableJndiDescription=Silently start an object locatable by JNDI.
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/internal/RuntimeBridge.java b/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/internal/RuntimeBridge.java
index 62f6e84..e9771fa 100644
--- a/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/internal/RuntimeBridge.java
+++ b/plugins/org.eclipse.jst.server.core/sjavacore/org/eclipse/jst/server/core/internal/RuntimeBridge.java
@@ -84,27 +84,30 @@
Map properties = new HashMap();
properties.put("location", runtime.getLocation().toPortableString());
properties.put("name", name);
+ properties.put("type", runtime.getRuntimeType().getName());
properties.put("id", runtime.getId());
components.add(RuntimeManager.createRuntimeComponent(mapped, properties));
// define JRE component
- IJavaRuntime gr = (IJavaRuntime) runtime.loadAdapter(IJavaRuntime.class, null);
- IVMInstall vmInstall = gr.getVMInstall();
- IVMInstall2 vmInstall2 = (IVMInstall2) vmInstall;
-
- String jvmver = vmInstall2.getJavaVersion();
- IRuntimeComponentVersion rcv;
-
- if (jvmver.startsWith("1.4")) {
- rcv = RuntimeManager.getRuntimeComponentType("standard.jre").getVersion("1.4");
- } else if (jvmver.startsWith("1.5")) {
- rcv = RuntimeManager.getRuntimeComponentType("standard.jre").getVersion("5.0");
- } else
- continue;
-
- properties = new HashMap();
- properties.put("name", vmInstall.getName());
- components.add(RuntimeManager.createRuntimeComponent(rcv, properties));
+ IJavaRuntime javaRuntime = (IJavaRuntime) runtime.loadAdapter(IJavaRuntime.class, null);
+ if (javaRuntime != null) {
+ IVMInstall vmInstall = javaRuntime.getVMInstall();
+ IVMInstall2 vmInstall2 = (IVMInstall2) vmInstall;
+
+ String jvmver = vmInstall2.getJavaVersion();
+ IRuntimeComponentVersion rcv;
+
+ if (jvmver.startsWith("1.4")) {
+ rcv = RuntimeManager.getRuntimeComponentType("standard.jre").getVersion("1.4");
+ } else if (jvmver.startsWith("1.5")) {
+ rcv = RuntimeManager.getRuntimeComponentType("standard.jre").getVersion("5.0");
+ } else
+ continue;
+
+ properties = new HashMap();
+ properties.put("name", vmInstall.getName());
+ components.add(RuntimeManager.createRuntimeComponent(rcv, properties));
+ }
// define facet runtime
properties = new HashMap();
diff --git a/plugins/org.eclipse.jst.server.tomcat.core/plugin.xml b/plugins/org.eclipse.jst.server.tomcat.core/plugin.xml
index 943e946..d305ef8 100644
--- a/plugins/org.eclipse.jst.server.tomcat.core/plugin.xml
+++ b/plugins/org.eclipse.jst.server.tomcat.core/plugin.xml
@@ -13,6 +13,9 @@
<moduleType
types="jst.web"
versions="2.2"/>
+ <moduleType
+ types="jst.utility"
+ versions="1.0"/>
</runtimeType>
<runtimeType
@@ -25,6 +28,9 @@
<moduleType
types="jst.web"
versions="2.2, 2.3"/>
+ <moduleType
+ types="jst.utility"
+ versions="1.0"/>
</runtimeType>
<runtimeType
@@ -37,6 +43,9 @@
<moduleType
types="jst.web"
versions="2.2, 2.3"/>
+ <moduleType
+ types="jst.utility"
+ versions="1.0"/>
</runtimeType>
<runtimeType
@@ -49,6 +58,9 @@
<moduleType
types="jst.web"
versions="2.2, 2.3, 2.4"/>
+ <moduleType
+ types="jst.utility"
+ versions="1.0"/>
</runtimeType>
<runtimeType
@@ -61,6 +73,9 @@
<moduleType
types="jst.web"
versions="2.2, 2.3, 2.4"/>
+ <moduleType
+ types="jst.utility"
+ versions="1.0"/>
</runtimeType>
</extension>
@@ -272,5 +287,15 @@
id="jst.web"
version="2.4"/>
</supported>
+
+ <supported>
+ <runtime-component
+ id="org.eclipse.jst.server.tomcat"
+ version="3.2"
+ allow-newer="true"/>
+ <facet
+ id="jst.utility"
+ version="1.0"/>
+ </supported>
</extension>
</plugin>
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.server.ui/sjavaui/org/eclipse/jst/server/ui/internal/RuntimeLabelProvider.java b/plugins/org.eclipse.jst.server.ui/sjavaui/org/eclipse/jst/server/ui/internal/RuntimeLabelProvider.java
index 26d540a..f5be1c1 100644
--- a/plugins/org.eclipse.jst.server.ui/sjavaui/org/eclipse/jst/server/ui/internal/RuntimeLabelProvider.java
+++ b/plugins/org.eclipse.jst.server.ui/sjavaui/org/eclipse/jst/server/ui/internal/RuntimeLabelProvider.java
@@ -12,8 +12,6 @@
package org.eclipse.jst.server.ui.internal;
import org.eclipse.core.runtime.IAdapterFactory;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
import org.eclipse.wst.common.project.facet.core.runtime.IRuntimeComponent;
import org.eclipse.wst.common.project.facet.ui.IRuntimeComponentLabelProvider;
/**
@@ -27,16 +25,7 @@
}
public String getLabel() {
- IPath location = Path.fromPortableString(rc.getProperty("location"));
-
- StringBuffer buf = new StringBuffer();
- buf.append(rc.getProperty("name") + " ");
- buf.append(rc.getRuntimeComponentVersion().getVersionString());
- buf.append(" [");
- buf.append(location.toOSString());
- buf.append("]");
-
- return buf.toString();
+ return rc.getProperty("type");
}
public static final class Factory implements IAdapterFactory {
diff --git a/plugins/org.eclipse.jst.server.ui/sjavaui/org/eclipse/jst/server/ui/internal/StandardJreLabelProvider.java b/plugins/org.eclipse.jst.server.ui/sjavaui/org/eclipse/jst/server/ui/internal/StandardJreLabelProvider.java
index da8e5cc..446ed8e 100644
--- a/plugins/org.eclipse.jst.server.ui/sjavaui/org/eclipse/jst/server/ui/internal/StandardJreLabelProvider.java
+++ b/plugins/org.eclipse.jst.server.ui/sjavaui/org/eclipse/jst/server/ui/internal/StandardJreLabelProvider.java
@@ -12,16 +12,12 @@
package org.eclipse.jst.server.ui.internal;
import org.eclipse.core.runtime.IAdapterFactory;
-import org.eclipse.jdt.launching.IVMInstall;
-import org.eclipse.jdt.launching.JavaRuntime;
import org.eclipse.wst.common.project.facet.core.runtime.IRuntimeComponent;
import org.eclipse.wst.common.project.facet.ui.IRuntimeComponentLabelProvider;
/**
*
*/
public final class StandardJreLabelProvider implements IRuntimeComponentLabelProvider {
- private static final String TYPE = "org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType";
-
private final IRuntimeComponent rc;
public StandardJreLabelProvider(final IRuntimeComponent rc) {
@@ -29,16 +25,11 @@
}
public String getLabel() {
- String name = this.rc.getProperty("name");
-
- IVMInstall install = JavaRuntime.getVMInstallType(TYPE).findVMInstallByName(name);
-
StringBuffer buf = new StringBuffer();
- buf.append("Standard JRE ");
- buf.append(this.rc.getRuntimeComponentVersion().getVersionString());
- buf.append(" [");
- buf.append(install.getInstallLocation().toString());
- buf.append("]");
+ buf.append("JRE ");
+ buf.append(rc.getRuntimeComponentVersion().getVersionString());
+ buf.append(": ");
+ buf.append(rc.getProperty("name"));
return buf.toString();
}