Author: dgolovin
Date: 2007-10-01 15:34:27 -0400 (Mon, 01 Oct 2007)
New Revision: 3930
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/project/facet/SeamRuntimeManager.java
Log:
http://jira.jboss.org/jira/browse/JBIDE-986
Runtime preferences is flushed on disk every time Seam runtime is added
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/project/facet/SeamRuntimeManager.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/project/facet/SeamRuntimeManager.java 2007-10-01
17:51:26 UTC (rev 3929)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/project/facet/SeamRuntimeManager.java 2007-10-01
19:34:27 UTC (rev 3930)
@@ -10,6 +10,7 @@
******************************************************************************/
package org.jboss.tools.seam.core.project.facet;
+import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
@@ -17,6 +18,8 @@
import java.util.Map;
import org.eclipse.core.resources.IProject;
+import org.eclipse.jface.preference.IPersistentPreferenceStore;
+import org.eclipse.jface.preference.IPreferenceStore;
import org.jboss.tools.seam.core.ISeamProject;
import org.jboss.tools.seam.core.SeamCorePlugin;
import org.jboss.tools.seam.internal.core.project.facet.SeamFacetPreferenceInitializer;
@@ -146,11 +149,19 @@
}
/**
- *
+ * Save preference value and force save changes to disk
*/
public void save() {
SeamCorePlugin.getDefault().getPluginPreferences().setValue(
SeamFacetPreference.RUNTIME_LIST, converter.getString(runtimes));
+ IPreferenceStore store = SeamCorePlugin.getDefault().getPreferenceStore();
+ if(store instanceof IPersistentPreferenceStore) {
+ try {
+ ((IPersistentPreferenceStore)store).save();
+ } catch (IOException e) {
+ SeamCorePlugin.getPluginLog().logError(e);
+ }
+ }
}
/**