Refactory: removed unused viewerFilter classes.
[phpeclipse.git] / archive / net.sourceforge.phpeclipse.wiki / src / net / sourceforge / phpeclipse / wiki / internal / ConfigurationManager.java
index 3713a9b..f73af5a 100644 (file)
@@ -4,7 +4,7 @@
  * are made available under the terms of the Common Public License v1.0
  * which accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/cpl-v10.html
- *
+�*
  * Contributors:
  *    IBM - Initial API and implementation
  **********************************************************************/
@@ -54,7 +54,7 @@ public class ConfigurationManager {
                                if (ignorePreferenceChanges)
                                        return;
                                String property = event.getProperty();
-                               if (property.equals("configurations")) {
+                               if (property.equals(WikiEditorPlugin.PREF_STRING_CONFIGURATIONS)) {
                                        loadConfigurations();
                                }
                        }
@@ -143,7 +143,7 @@ public class ConfigurationManager {
                
                configurations = new ArrayList();
                Preferences prefs = WikiEditorPlugin.getDefault().getPluginPreferences();
-               String xmlString = prefs.getString("configurations");
+               String xmlString = prefs.getString(WikiEditorPlugin.PREF_STRING_CONFIGURATIONS);
                if (xmlString != null && xmlString.length() > 0) {
                        try {
                                ByteArrayInputStream in = new ByteArrayInputStream(xmlString.getBytes());
@@ -153,9 +153,9 @@ public class ConfigurationManager {
                                if (children != null) {
                                        int size = children.length;
                                        for (int i = 0; i < size; i++) {
-                                               Configuration monitor = new Configuration();
-                                               monitor.load(children[i]);
-                                               configurations.add(monitor);
+                                               Configuration configuration = new ConfigurationWorkingCopy();
+                                               configuration.load(children[i]);
+                                               configurations.add(configuration);
                                        }
                                }
                        } catch (Exception e) {
@@ -167,7 +167,7 @@ public class ConfigurationManager {
        protected void saveConfigurations() {
                try {
                        ignorePreferenceChanges = true;
-                       XMLMemento memento = XMLMemento.createWriteRoot("configurations");
+                       XMLMemento memento = XMLMemento.createWriteRoot(WikiEditorPlugin.PREF_STRING_CONFIGURATIONS);
 
                        Iterator iterator = configurations.iterator();
                        while (iterator.hasNext()) {
@@ -178,7 +178,7 @@ public class ConfigurationManager {
                        
                        String xmlString = memento.saveToString();
                        Preferences prefs = WikiEditorPlugin.getDefault().getPluginPreferences();
-                       prefs.setValue("configurations", xmlString);
+                       prefs.setValue(WikiEditorPlugin.PREF_STRING_CONFIGURATIONS, xmlString);
                        WikiEditorPlugin.getDefault().savePluginPreferences();
                } catch (Exception e) {
                        Trace.trace(Trace.SEVERE, "Could not save Configurations", e);