Author: snjeza
Date: 2012-05-15 04:56:48 -0400 (Tue, 15 May 2012)
New Revision: 41015
Modified:
trunk/runtime/plugins/org.jboss.tools.runtime.ui/src/org/jboss/tools/runtime/ui/dialogs/SearchRuntimePathDialog.java
Log:
JBIDE-11829 - Different result of Seam runtime detection based on JBoss AS detector
presence
Modified:
trunk/runtime/plugins/org.jboss.tools.runtime.ui/src/org/jboss/tools/runtime/ui/dialogs/SearchRuntimePathDialog.java
===================================================================
---
trunk/runtime/plugins/org.jboss.tools.runtime.ui/src/org/jboss/tools/runtime/ui/dialogs/SearchRuntimePathDialog.java 2012-05-15
08:48:38 UTC (rev 41014)
+++
trunk/runtime/plugins/org.jboss.tools.runtime.ui/src/org/jboss/tools/runtime/ui/dialogs/SearchRuntimePathDialog.java 2012-05-15
08:56:48 UTC (rev 41015)
@@ -337,28 +337,51 @@
} else {
serverDefinitions.clear();
}
+ List<RuntimeDefinition> allDefinitions = getAllDefinitions();
for (RuntimePath runtimePath : runtimePaths) {
- for (RuntimeDefinition serverDefinition : runtimePath
- .getServerDefinitions()) {
+ List<RuntimeDefinition> pathDefinitions = getAllDefinitions(runtimePath);
+ for (RuntimeDefinition serverDefinition : pathDefinitions) {
if (!RuntimeUIActivator.runtimeCreated(serverDefinition)) {
- List<RuntimeDefinition> allServerDefinitions =
RuntimeUIActivator.getDefault().getServerDefinitions();
+
String name = serverDefinition.getName();
int i = 2;
- while (serverDefinitionsExists(serverDefinition, allServerDefinitions)) {
+ while (serverDefinitionsExists(serverDefinition, allDefinitions)) {
serverDefinition.setName(name + " (" + i++ + ")");
}
}
+ }
+
+ }
+ for (RuntimePath runtimePath : runtimePaths) {
+ for (RuntimeDefinition serverDefinition : runtimePath.getServerDefinitions()) {
if (!hideCreatedRuntimes) {
serverDefinitions.add(serverDefinition);
} else if (!RuntimeUIActivator.runtimeCreated(serverDefinition)) {
serverDefinitions.add(serverDefinition);
}
}
-
}
return serverDefinitions;
}
+ protected List<RuntimeDefinition> getAllDefinitions(RuntimePath runtimePath) {
+ List<RuntimeDefinition> allDefinitions = new
ArrayList<RuntimeDefinition>();
+ allDefinitions.addAll(runtimePath.getServerDefinitions());
+ for (RuntimeDefinition serverDefinition : runtimePath.getServerDefinitions()) {
+ allDefinitions.addAll(serverDefinition.getIncludedServerDefinitions());
+ }
+ return allDefinitions;
+ }
+
+ private List<RuntimeDefinition> getAllDefinitions() {
+ List<RuntimeDefinition> allServerDefinitions = new
ArrayList<RuntimeDefinition>();
+ allServerDefinitions.addAll(RuntimeUIActivator.getDefault().getServerDefinitions());
+ for (RuntimeDefinition d:RuntimeUIActivator.getDefault().getServerDefinitions()) {
+ allServerDefinitions.addAll(d.getIncludedServerDefinitions());
+ }
+ return allServerDefinitions;
+ }
+
private boolean serverDefinitionsExists(RuntimeDefinition serverDefinition,
List<RuntimeDefinition> allServerDefinitions) {
String name = serverDefinition.getName();
Show replies by date