Author: rob.stryker(a)jboss.com
Date: 2010-04-15 06:47:54 -0400 (Thu, 15 Apr 2010)
New Revision: 21489
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/src/org/jboss/ide/eclipse/as/classpath/core/runtime/ClientAllRuntimeClasspathProvider.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/IJBossRuntimeResourceConstants.java
Log:
JBIDE-5894 - changes to classpath returns for AS 6. Also, I sorted the returned entries
by jar name alphabetically to make it easier to find what you're looking for.
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/src/org/jboss/ide/eclipse/as/classpath/core/runtime/ClientAllRuntimeClasspathProvider.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/src/org/jboss/ide/eclipse/as/classpath/core/runtime/ClientAllRuntimeClasspathProvider.java 2010-04-15
10:24:32 UTC (rev 21488)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/src/org/jboss/ide/eclipse/as/classpath/core/runtime/ClientAllRuntimeClasspathProvider.java 2010-04-15
10:47:54 UTC (rev 21489)
@@ -14,12 +14,14 @@
import java.io.File;
import java.text.MessageFormat;
import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.List;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Status;
import org.eclipse.jdt.core.IClasspathEntry;
import org.eclipse.jdt.launching.JavaRuntime;
@@ -70,28 +72,36 @@
IPath loc = runtime.getLocation();
IPath configPath = jbsrt.getConfigurationFullPath();
String rtID = runtime.getRuntimeType().getId();
- if(AS_32.equals(rtID)) return get32(loc, configPath);
- if(AS_40.equals(rtID)) return get40(loc,configPath);
- if(AS_42.equals(rtID)) return get42(loc,configPath);
- if(AS_50.equals(rtID)) return get50(loc,configPath);
- if(EAP_43.equals(rtID)) return getEAP43(loc,configPath);
+ List<IClasspathEntry> list = new ArrayList<IClasspathEntry>();
+ if(AS_32.equals(rtID)) list = get32(loc, configPath);
+ if(AS_40.equals(rtID)) list = get40(loc,configPath);
+ if(AS_42.equals(rtID)) list = get42(loc,configPath);
+ if(AS_50.equals(rtID)) list = get50(loc,configPath);
+ if(EAP_43.equals(rtID)) list = getEAP43(loc,configPath);
// Added cautiously, not sure on changes, may change
- if(AS_51.equals(rtID)) return get50(loc,configPath);
- if(AS_60.equals(rtID)) return get50(loc,configPath);
- if(EAP_50.equals(rtID)) return get50(loc,configPath);
- return null;
+ if(AS_51.equals(rtID)) list = get50(loc,configPath);
+ if(AS_60.equals(rtID)) list = get60(loc,configPath);
+ if(EAP_50.equals(rtID)) list = get50(loc,configPath);
+
+ if( list == null )
+ return null;
+ Collections.sort(list, new Comparator<IClasspathEntry>() {
+ public int compare(IClasspathEntry o1, IClasspathEntry o2) {
+ return o1.getPath().lastSegment().compareTo(o2.getPath().lastSegment());
+ } });
+ return list.toArray(new IClasspathEntry[list.size()]);
}
- protected IClasspathEntry[] get32(IPath location, IPath configPath) {
+ protected List<IClasspathEntry> get32(IPath location, IPath configPath) {
ArrayList<IClasspathEntry> list = new ArrayList<IClasspathEntry>();
addEntries(location.append(CLIENT), list);
addEntries(location.append(LIB), list);
addEntries(configPath.append(LIB), list);
- return list.toArray(new IClasspathEntry[list.size()]);
+ return list;
}
- protected IClasspathEntry[] get40(IPath location, IPath configPath) {
+ protected List<IClasspathEntry> get40(IPath location, IPath configPath) {
ArrayList<IClasspathEntry> list = new ArrayList<IClasspathEntry>();
IPath deployPath = configPath.append(DEPLOY);
addEntries(location.append(CLIENT), list);
@@ -100,18 +110,18 @@
addEntries(deployPath.append(JBOSS_WEB_DEPLOYER).append(JSF_LIB), list);
addEntries(deployPath.append(AOP_JDK5_DEPLOYER), list);
addEntries(deployPath.append(EJB3_DEPLOYER), list);
- return list.toArray(new IClasspathEntry[list.size()]);
+ return list;
}
- protected IClasspathEntry[] get42(IPath location, IPath configPath) {
+ protected List<IClasspathEntry> get42(IPath location, IPath configPath) {
return get40(location, configPath);
}
- protected IClasspathEntry[] getEAP43(IPath location, IPath configPath) {
+ protected List<IClasspathEntry> getEAP43(IPath location, IPath configPath) {
return get40(location, configPath);
}
- protected IClasspathEntry[] get50(IPath location, IPath configPath) {
+ protected List<IClasspathEntry> get50(IPath location, IPath configPath) {
ArrayList<IClasspathEntry> list = new ArrayList<IClasspathEntry>();
IPath deployerPath = configPath.append(DEPLOYERS);
IPath deployPath = configPath.append(DEPLOY);
@@ -125,9 +135,16 @@
addEntries(deployerPath.append(AS5_AOP_DEPLOYER), list);
addEntries(deployerPath.append(EJB3_DEPLOYER), list);
addEntries(deployerPath.append(WEBBEANS_DEPLOYER).append(JSR299_API_JAR), list);
- return list.toArray(new IClasspathEntry[list.size()]);
+ return list;
}
+ protected List<IClasspathEntry> get60(IPath location, IPath configPath) {
+ ArrayList<IClasspathEntry> list = new ArrayList<IClasspathEntry>();
+ list.addAll(get50(location, configPath));
+ addEntries(configPath.append(DEPLOYERS).append(REST_EASY_DEPLOYER), list);
+ return list;
+ }
+
protected IClasspathEntry getEntry(IPath path) {
return JavaRuntime.newArchiveRuntimeClasspathEntry(path).getClasspathEntry();
}
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/IJBossRuntimeResourceConstants.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/IJBossRuntimeResourceConstants.java 2010-04-15
10:24:32 UTC (rev 21488)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/IJBossRuntimeResourceConstants.java 2010-04-15
10:47:54 UTC (rev 21489)
@@ -45,6 +45,7 @@
public static final String AOP_JDK5_DEPLOYER = "jboss-aop-jdk50.deployer";
//$NON-NLS-1$
public static final String JBOSS_AOP_JDK5_JAR = "jboss-aop-jdk50.jar";
//$NON-NLS-1$
public static final String JBOSS_WEB_DEPLOYER = "jboss-web.deployer";
//$NON-NLS-1$
+ public static final String REST_EASY_DEPLOYER = "resteasy.deployer";
//$NON-NLS-1$
public static final String JSP_API_JAR = "jsp-api.jar"; //$NON-NLS-1$
public static final String SERVLET_API_JAR = "servlet-api.jar"; //$NON-NLS-1$
public static final String JSF_API_JAR = "jsf-api.jar"; //$NON-NLS-1$