* 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
**********************************************************************/
import net.sourceforge.phpdt.phphelp.PHPHelpPlugin;
import org.eclipse.core.runtime.Preferences;
+
/**
- *
+ *
*/
public class ConfigurationManager {
private static final int ADD = 0;
+
private static final int CHANGE = 1;
+
private static final int REMOVE = 2;
// configurations
protected List configurations;
+
protected Map threads = new HashMap();
protected List configurationListeners = new ArrayList();
private Preferences.IPropertyChangeListener pcl;
+
protected boolean ignorePreferenceChanges = false;
protected static ConfigurationManager instance;
}
};
- PHPHelpPlugin.getDefault().getPluginPreferences().addPropertyChangeListener(pcl);
+ PHPHelpPlugin.getDefault().getPluginPreferences()
+ .addPropertyChangeListener(pcl);
}
protected void dispose() {
- PHPHelpPlugin.getDefault().getPluginPreferences().removePropertyChangeListener(pcl);
+ PHPHelpPlugin.getDefault().getPluginPreferences()
+ .removePropertyChangeListener(pcl);
}
public IConfigurationWorkingCopy createConfiguration() {
/**
* Add monitor listener.
- *
+ *
* @param listener
*/
public void addConfigurationListener(IConfigurationListener listener) {
/**
* Remove monitor listener.
- *
+ *
* @param listener
*/
public void removeConfigurationListener(IConfigurationListener listener) {
/**
* Fire a monitor event.
+ *
* @param rr
* @param fType
*/
}
}
-
-
-
protected void loadConfigurations() {
configurations = new ArrayList();
Preferences prefs = PHPHelpPlugin.getDefault().getPluginPreferences();
- String xmlString = prefs.getString(PHPHelpPlugin.PREF_STRING_CONFIGURATIONS);
+ String xmlString = prefs
+ .getString(PHPHelpPlugin.PREF_STRING_CONFIGURATIONS);
if (xmlString != null && xmlString.length() > 0) {
try {
- ByteArrayInputStream in = new ByteArrayInputStream(xmlString.getBytes());
+ ByteArrayInputStream in = new ByteArrayInputStream(xmlString
+ .getBytes());
IMemento memento = XMLMemento.loadMemento(in);
IMemento[] children = memento.getChildren("config");
protected void saveConfigurations() {
try {
ignorePreferenceChanges = true;
- XMLMemento memento = XMLMemento.createWriteRoot(PHPHelpPlugin.PREF_STRING_CONFIGURATIONS);
+ XMLMemento memento = XMLMemento
+ .createWriteRoot(PHPHelpPlugin.PREF_STRING_CONFIGURATIONS);
Iterator iterator = configurations.iterator();
while (iterator.hasNext()) {
}
String xmlString = memento.saveToString();
- Preferences prefs = PHPHelpPlugin.getDefault().getPluginPreferences();
+ Preferences prefs = PHPHelpPlugin.getDefault()
+ .getPluginPreferences();
prefs.setValue(PHPHelpPlugin.PREF_STRING_CONFIGURATIONS, xmlString);
PHPHelpPlugin.getDefault().savePluginPreferences();
} catch (Exception e) {