Author: akazakov
Date: 2011-03-29 21:02:56 -0400 (Tue, 29 Mar 2011)
New Revision: 30134
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamPreferencePage.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/SeamRuntimeListFieldEditor.java
Log:
https://issues.jboss.org/browse/JBIDE-8626
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamPreferencePage.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamPreferencePage.java 2011-03-30
00:41:39 UTC (rev 30133)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamPreferencePage.java 2011-03-30
01:02:56 UTC (rev 30134)
@@ -14,7 +14,6 @@
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
-import java.util.Map;
import org.eclipse.jface.preference.PreferencePage;
import org.eclipse.swt.SWT;
@@ -67,7 +66,6 @@
GridLayout gl = new GridLayout(COLUMNS, false);
root.setLayout(gl);
seamRuntimes.doFillIntoGrid(root);
-
return root;
}
@@ -86,14 +84,6 @@
*/
@Override
protected void performApply() {
- for (SeamRuntime rt : seamRuntimes.getAddedSeamRuntimes()) {
- SeamRuntimeManager.getInstance().addRuntime(rt);
- }
- seamRuntimes.getAddedSeamRuntimes().clear();
- for (SeamRuntime rt : seamRuntimes.getRemoved()) {
- SeamRuntimeManager.getInstance().removeRuntime(rt);
- }
- seamRuntimes.getRemoved().clear();
List<SeamRuntime> defaultRuntimes = seamRuntimes.getDefaultSeamRuntimes();
// reset all default runtimes
for (SeamRuntime seamRuntime : SeamRuntimeManager.getInstance().getRuntimes()) {
@@ -104,19 +94,6 @@
seamRuntime.setDefault(true);
}
seamRuntimes.getDefaultSeamRuntimes().clear();
- Map<SeamRuntime, SeamRuntime> changed = seamRuntimes.getChangedSeamRuntimes();
- for (SeamRuntime c : changed.keySet()) {
- SeamRuntime o = changed.get(c);
- o.setHomeDir(c.getHomeDir());
- o.setVersion(c.getVersion());
- String oldName = o.getName();
- String newName = c.getName();
- if (!oldName.equals(newName)) {
- SeamRuntimeManager.getInstance().changeRuntimeName(oldName, newName);
- }
- }
- seamRuntimes.getChangedSeamRuntimes().clear();
-
SeamRuntimeManager.getInstance().save();
}
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/SeamRuntimeListFieldEditor.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/SeamRuntimeListFieldEditor.java 2011-03-30
00:41:39 UTC (rev 30133)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/SeamRuntimeListFieldEditor.java 2011-03-30
01:02:56 UTC (rev 30134)
@@ -66,6 +66,7 @@
import org.jboss.tools.seam.core.SeamCorePlugin;
import org.jboss.tools.seam.core.SeamUtil;
import org.jboss.tools.seam.core.project.facet.SeamRuntime;
+import org.jboss.tools.seam.core.project.facet.SeamRuntimeManager;
import org.jboss.tools.seam.core.project.facet.SeamVersion;
import org.jboss.tools.seam.internal.core.project.facet.ISeamFacetDataModelProperties;
import org.jboss.tools.seam.ui.SeamUIMessages;
@@ -172,6 +173,31 @@
return removed;
}
+ public void performApply() {
+ for (SeamRuntime rt : getAddedSeamRuntimes()) {
+ SeamRuntimeManager.getInstance().addRuntime(rt);
+ }
+ getAddedSeamRuntimes().clear();
+ for (SeamRuntime rt : getRemoved()) {
+ SeamRuntimeManager.getInstance().removeRuntime(rt);
+ }
+ getRemoved().clear();
+ Map<SeamRuntime, SeamRuntime> changed = getChangedSeamRuntimes();
+ for (SeamRuntime c : changed.keySet()) {
+ SeamRuntime o = changed.get(c);
+ o.setHomeDir(c.getHomeDir());
+ o.setVersion(c.getVersion());
+ String oldName = o.getName();
+ String newName = c.getName();
+ if (!oldName.equals(newName)) {
+ SeamRuntimeManager.getInstance().changeRuntimeName(oldName, newName);
+ }
+ }
+ getChangedSeamRuntimes().clear();
+
+ SeamRuntimeManager.getInstance().save();
+ }
+
/**
* TBD
*
@@ -1031,6 +1057,7 @@
dialog.open();
tableView.refresh();
setDefaultRuntimes();
+ performApply();
}
public void run(String name, String version) {
@@ -1046,6 +1073,7 @@
dialog.open();
tableView.refresh();
setDefaultRuntimes();
+ performApply();
}
}
@@ -1096,6 +1124,7 @@
tableView.setSelection(new StructuredSelection(c));
}
}
+ performApply();
}
private SeamRuntime findChangedRuntime(SeamRuntime source) {
@@ -1140,6 +1169,7 @@
}
tableView.refresh();
setDefaultRuntimes();
+ performApply();
}
private void removeRuntime(SeamRuntime r) {