Author: snjeza
Date: 2012-09-26 09:26:10 -0400 (Wed, 26 Sep 2012)
New Revision: 44034
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/preferences/RuntimePreferencePage.java
Log:
JBIDE-12726 - Search button not enabled
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-09-26
12:56:23 UTC (rev 44033)
+++
trunk/runtime/plugins/org.jboss.tools.runtime.ui/src/org/jboss/tools/runtime/ui/dialogs/SearchRuntimePathDialog.java 2012-09-26
13:26:10 UTC (rev 44034)
@@ -340,18 +340,29 @@
}
private List<RuntimeDefinition> getEnabledRuntimeDefinitions() {
- ArrayList<RuntimeDefinition> all = getRuntimeDefinitions(true);
+ List<RuntimeDefinition> all = getRuntimeDefinitions(true);
Iterator<RuntimeDefinition> i = all.iterator();
while(i.hasNext()) {
- if( !i.next().isEnabled())
- i.remove();
+ RuntimeDefinition rd = i.next();
+ if( !rd.isEnabled()) {
+ boolean add = false;
+ for (RuntimeDefinition ird:rd.getIncludedRuntimeDefinitions() ) {
+ if (ird.isEnabled()) {
+ add = true;
+ break;
+ }
+ }
+ if (!add) {
+ i.remove();
+ }
+ }
}
return all;
}
- private ArrayList<RuntimeDefinition> getRuntimeDefinitions(
+ private List<RuntimeDefinition> getRuntimeDefinitions(
boolean hideCreatedRuntimes) {
- ArrayList<RuntimeDefinition> runtimeDefinitions = new
ArrayList<RuntimeDefinition>();
+ List<RuntimeDefinition> runtimeDefinitions = new
ArrayList<RuntimeDefinition>();
List<RuntimeDefinition> allDefinitions = getAllDefinitions();
for (RuntimePath runtimePath : runtimePaths) {
Modified:
trunk/runtime/plugins/org.jboss.tools.runtime.ui/src/org/jboss/tools/runtime/ui/preferences/RuntimePreferencePage.java
===================================================================
---
trunk/runtime/plugins/org.jboss.tools.runtime.ui/src/org/jboss/tools/runtime/ui/preferences/RuntimePreferencePage.java 2012-09-26
12:56:23 UTC (rev 44033)
+++
trunk/runtime/plugins/org.jboss.tools.runtime.ui/src/org/jboss/tools/runtime/ui/preferences/RuntimePreferencePage.java 2012-09-26
13:26:10 UTC (rev 44034)
@@ -402,7 +402,8 @@
runtimePathViewer.setInput(runtimePaths);
configureSearch();
runtimePathViewer.refresh();
-
+ RuntimeUIActivator.getDefault().getModel().addRuntimePath(runtimePath);
+ RuntimeUIActivator.getDefault().saveRuntimePreferences();
}
private void removedPressed() {