/** * Creates a new configuration with editable left and right sides, * suitable default labels, and no images. * This configuration uses the preference store of the Compare plug-in * (<code>CompareUIPlugin.getDefault().getPreferenceStore()</code>). */ public CompareConfiguration() { this(CompareUIPlugin.getDefault().getPreferenceStore()); }
/** * Creates a new configuration with editable left and right sides, * suitable default labels, and no images. * This configuration uses the preference store of the Compare plug-in * (<code>CompareUIPlugin.getDefault().getPreferenceStore()</code>). */ public CompareConfiguration() { this(CompareUIPlugin.getDefault().getPreferenceStore()); }
private Map getStructureViewerAliases() { if (fStructureViewerAliases == null) { fStructureViewerAliases= new Hashtable(10); String aliases= getPreferenceStore().getString(STRUCTUREVIEWER_ALIASES_PREFERENCE_NAME); if (aliases != null && aliases.length() > 0) { StringTokenizer st= new StringTokenizer(aliases, " "); //$NON-NLS-1$ while (st.hasMoreTokens()) { String pair= st.nextToken(); int pos= pair.indexOf('.'); if (pos > 0) { String key= pair.substring(0, pos); String alias= pair.substring(pos+1); fStructureViewerAliases.put(key, alias); } } } } return fStructureViewerAliases; }
private Map<String, String> getStructureViewerAliases() { if (fStructureViewerAliases == null) { fStructureViewerAliases= new Hashtable<>(10); String aliases= getPreferenceStore().getString(STRUCTUREVIEWER_ALIASES_PREFERENCE_NAME); if (aliases != null && aliases.length() > 0) { StringTokenizer st= new StringTokenizer(aliases, " "); //$NON-NLS-1$ while (st.hasMoreTokens()) { String pair= st.nextToken(); int pos= pair.indexOf('.'); if (pos > 0) { String key= pair.substring(0, pos); String alias= pair.substring(pos+1); fStructureViewerAliases.put(key, alias); } } } } return fStructureViewerAliases; }
@Override public void start(BundleContext context) throws Exception { super.start(context); Hashtable<String, String> properties = new Hashtable<>(2); properties.put(DebugOptions.LISTENER_SYMBOLICNAME, PLUGIN_ID); debugRegistration = context.registerService(DebugOptionsListener.class, Policy.DEBUG_OPTIONS_LISTENER, properties); ComparePlugin.getDefault().setCappingDisabled( getPreferenceStore().getBoolean( ComparePreferencePage.CAPPING_DISABLED)); }
@Override public void initializeDefaultPreferences() { IPreferenceStore store = CompareUIPlugin.getDefault().getPreferenceStore(); ComparePreferencePage.initDefaults(store); }
public static void setSaveAllEditors(boolean value) { IPreferenceStore store= CompareUIPlugin.getDefault().getPreferenceStore(); store.setValue(PREF_SAVE_ALL_EDITORS, value); }
static public boolean getSaveAllEditors() { IPreferenceStore store= CompareUIPlugin.getDefault().getPreferenceStore(); return store.getBoolean(PREF_SAVE_ALL_EDITORS); }
public static boolean getSaveAllEditors() { IPreferenceStore store= CompareUIPlugin.getDefault().getPreferenceStore(); return store.getBoolean(PREF_SAVE_ALL_EDITORS); }
static public void setSaveAllEditors(boolean value) { IPreferenceStore store= CompareUIPlugin.getDefault().getPreferenceStore(); store.setValue(PREF_SAVE_ALL_EDITORS, value); }
private boolean isCappingDisabled() { return CompareUIPlugin.getDefault().getPreferenceStore().getBoolean(ComparePreferencePage.CAPPING_DISABLED); }
public void stop(BundleContext context) throws Exception { IPreferenceStore ps= getPreferenceStore(); rememberAliases(ps); if (fPropertyChangeListener != null) { ps.removePropertyChangeListener(fPropertyChangeListener); fPropertyChangeListener= null; } super.stop(context); if (fgDisposeOnShutdownImages != null) { Iterator i= fgDisposeOnShutdownImages.iterator(); while (i.hasNext()) { Image img= (Image) i.next(); if (!img.isDisposed()) img.dispose(); } fgImages= null; } }
public void initializeDefaultPreferences() { IPreferenceStore store = CompareUIPlugin.getDefault().getPreferenceStore(); store.setDefault(ICompareUIConstants.PREF_NAVIGATION_END_ACTION, ICompareUIConstants.PREF_VALUE_PROMPT); store.setDefault(ICompareUIConstants.PREF_NAVIGATION_END_ACTION_LOCAL, ICompareUIConstants.PREF_VALUE_LOOP); ComparePreferencePage.initDefaults(store); }
@Override protected Control createCustomArea(Composite parent) { editor = new RadioGroupFieldEditor(ICompareUIConstants.PREF_NAVIGATION_END_ACTION_LOCAL, CompareMessages.NavigationEndDialog_1, 1, labelsAndValues, parent, true); editor.setPreferenceStore(CompareUIPlugin.getDefault().getPreferenceStore()); editor.fillIntoGrid(parent, 1); editor.load(); return parent; }
public ComparePreferencePage() { setPreferenceStore(CompareUIPlugin.getDefault().getPreferenceStore()); fOverlayStore= new OverlayPreferenceStore(getPreferenceStore(), fKeys); fPreferenceChangeListener= event -> { String key= event.getProperty(); if (key.equals(INITIALLY_SHOW_ANCESTOR_PANE)) { boolean b= fOverlayStore.getBoolean(INITIALLY_SHOW_ANCESTOR_PANE); if (fCompareConfiguration != null) { fCompareConfiguration.setProperty(INITIALLY_SHOW_ANCESTOR_PANE, Boolean.valueOf(b)); } } }; fOverlayStore.addPropertyChangeListener(fPreferenceChangeListener); }
protected Control createCustomArea(Composite parent) { editor = new RadioGroupFieldEditor(ICompareUIConstants.PREF_NAVIGATION_END_ACTION_LOCAL, CompareMessages.NavigationEndDialog_1, 1, labelsAndValues, parent, true); editor.setPreferenceStore(CompareUIPlugin.getDefault().getPreferenceStore()); editor.fillIntoGrid(parent, 1); editor.load(); return parent; }
public boolean filter(String name, boolean isFolder, boolean isArchive) { if (fFilter == null) { fFilter= new CompareResourceFilter(); final IPreferenceStore ps= getPreferenceStore(); fFilter.setFilters(ps.getString(ComparePreferencePage.PATH_FILTER)); fPropertyChangeListener= event -> { if (ComparePreferencePage.PATH_FILTER.equals(event.getProperty())) fFilter.setFilters(ps.getString(ComparePreferencePage.PATH_FILTER)); }; ps.addPropertyChangeListener(fPropertyChangeListener); } return fFilter.filter(name, isFolder, isArchive); }
public boolean filter(String name, boolean isFolder, boolean isArchive) { if (fFilter == null) { fFilter= new CompareFilter(); final IPreferenceStore ps= getPreferenceStore(); fFilter.setFilters(ps.getString(ComparePreferencePage.PATH_FILTER)); fPropertyChangeListener= new IPropertyChangeListener() { public void propertyChange(PropertyChangeEvent event) { if (ComparePreferencePage.PATH_FILTER.equals(event.getProperty())) fFilter.setFilters(ps.getString(ComparePreferencePage.PATH_FILTER)); } }; ps.addPropertyChangeListener(fPropertyChangeListener); } return fFilter.filter(name, isFolder, isArchive); }
public ComparePreferencePage() { //setDescription(Utilities.getString("ComparePreferencePage.description")); //$NON-NLS-1$ setPreferenceStore(CompareUIPlugin.getDefault().getPreferenceStore()); fOverlayStore= new OverlayPreferenceStore(getPreferenceStore(), fKeys); fPreferenceChangeListener= new IPropertyChangeListener() { public void propertyChange(PropertyChangeEvent event) { String key= event.getProperty(); if (key.equals(INITIALLY_SHOW_ANCESTOR_PANE)) { boolean b= fOverlayStore.getBoolean(INITIALLY_SHOW_ANCESTOR_PANE); if (fCompareConfiguration != null) { fCompareConfiguration.setProperty(INITIALLY_SHOW_ANCESTOR_PANE, new Boolean(b)); } } } }; fOverlayStore.addPropertyChangeListener(fPreferenceChangeListener); }
@Override public void widgetSelected(SelectionEvent e) { /* * Disable capping temporarily, refresh, restore global state. * The global state is bad, but fixing that would require lots of changes and new APIs. */ IPreferenceStore preferenceStore = CompareUIPlugin.getDefault().getPreferenceStore(); boolean wasDisabled = preferenceStore.getBoolean(ComparePreferencePage.CAPPING_DISABLED); ComparePlugin.getDefault().setCappingDisabled(true); preferenceStore.setValue(ComparePreferencePage.CAPPING_DISABLED, true); try { getCompareConfiguration().setProperty(DISABLE_CAPPING_TEMPORARILY, Boolean.TRUE); } finally { if (!wasDisabled) { ComparePlugin.getDefault().setCappingDisabled(false); preferenceStore.setValue(ComparePreferencePage.CAPPING_DISABLED, false); } } } });