public XMLComparePreferencePage() { super(); fIdMaps = new HashMap(); XMLPlugin plugin = XMLPlugin.getDefault(); HashMap PluginIdMaps = plugin.getIdMaps(); Set keySet = PluginIdMaps.keySet(); for (Iterator iter = keySet.iterator(); iter.hasNext(); ) { String key = (String) iter.next(); fIdMaps.put(key, ((HashMap) PluginIdMaps.get(key)).clone()); } fIdMapsInternal = plugin.getIdMapsInternal(); fIdExtensionToName = new HashMap(); HashMap PluginIdExtensionToName = plugin.getIdExtensionToName(); keySet = PluginIdExtensionToName.keySet(); for (Iterator iter = keySet.iterator(); iter.hasNext(); ) { String key = (String) iter.next(); fIdExtensionToName.put(key, PluginIdExtensionToName.get(key)); } fOrderedElements = new HashMap(); HashMap PluginOrderedElements = plugin.getOrderedElements(); keySet = PluginOrderedElements.keySet(); for (Iterator iter = keySet.iterator(); iter.hasNext(); ) { String key = (String) iter.next(); fOrderedElements.put(key, ((ArrayList) PluginOrderedElements.get(key)).clone()); } fOrderedElementsInternal = plugin.getOrderedElementsInternal(); }
/* * @see IWorkbenchPreferencePage#performDefaults */ public boolean performOk() { XMLPlugin plugin = XMLPlugin.getDefault(); if (!plugin.getIdMaps().equals(fIdMaps) || !plugin.getIdExtensionToName().equals(fIdExtensionToName) || !plugin.getOrderedElements().equals(fOrderedElements)) plugin.setIdMaps(fIdMaps, fIdExtensionToName, fOrderedElements, true); // XMLPlugin.getDefault().setIdMaps(fIdMaps,fIdExtensionToName,null); return super.performOk(); }
public boolean performCancel() { fIdMaps = (HashMap) XMLPlugin.getDefault().getIdMaps().clone(); return super.performCancel(); }