public void clearImportedThemes() { IPreferenceStore store = getPreferenceStore(); for (int i = 1; store.contains("importedColorTheme" + i); i++) store.setToDefault("importedColorTheme" + i); themes.clear(); readStockThemes(themes); }
/** * Adds the color theme to the list and saves it to the preferences. * Existing themes will be overwritten with the new content. * @param input The input for theme file. * @throws TransformerException * @throws IOException * @throws SAXException * @throws ParserConfigurationException */ public void saveTheme(InputStream input) throws ParserConfigurationException, SAXException, IOException, TransformerException { ParsedTheme theme = parseTheme(input, true); themes.put(theme.getTheme().getName(), theme.getTheme()); IPreferenceStore store = getPreferenceStore(); for (int i = 1;; i++) if (!store.contains("importedColorTheme" + i)) { store.putValue("importedColorTheme" + i, theme.getSource()); break; } }
@Override public boolean contains(String name) { return fStore.contains(name); }
private static boolean isRelevant(IPreferenceStore javaStore) { //XXX: likely to be different in post 3.0 releases of eclipse!! return javaStore.contains("CustomFiltersActionGroup." + //$NON-NLS-1$ JavaUI.ID_PACKAGES + ".TAG_DUMMY_TO_TEST_EXISTENCE"); //$NON-NLS-1$ }
@Override public boolean contains(String name) { return fStore.contains(name); }
private boolean getBoolean(OutputConfiguration outputConfiguration, String name, IPreferenceStore preferenceStore, Boolean defaultValue) { String preferenceKey = getKey(outputConfiguration, name); return preferenceStore.contains(preferenceKey) ? preferenceStore.getBoolean(preferenceKey) : defaultValue; }
public boolean isAutoBuildEnabled(Object context) { IPreferenceStore preferenceStore = preferenceStoreAccess.getContextPreferenceStore(context); return preferenceStore.contains(PREF_AUTO_BUILDING) ? preferenceStore.getBoolean(PREF_AUTO_BUILDING) : true; }
private String getString(OutputConfiguration outputConfiguration, String name, IPreferenceStore preferenceStore, String defaultValue) { String preferenceKey = getKey(outputConfiguration, name); return preferenceStore.contains(preferenceKey) ? preferenceStore.getString(preferenceKey) : defaultValue; }
private void restorePersistedSettings() { IPreferenceStore pstore = AspectJUIPlugin.getDefault() .getPreferenceStore(); if (pstore.contains(AspectJPreferences.CHANGES_VIEW_PROPAGATE_UP)) { propagateUp = pstore.getBoolean(AspectJPreferences.CHANGES_VIEW_PROPAGATE_UP); } if (pstore.contains(AspectJPreferences.CHANGES_VIEW_COMPARE_PREV)) { comparePrev = pstore.getBoolean(AspectJPreferences.CHANGES_VIEW_COMPARE_PREV); } }
public boolean hasDisabledListeners(String projectName, boolean projectOnly) { if(projectOnly || m_storage.contains(projectName + TestNGPluginConstants.S_DISABLEDLISTENERS)) { return m_storage.getBoolean(projectName + TestNGPluginConstants.S_DISABLEDLISTENERS); } else { return m_storage.getBoolean(TestNGPluginConstants.S_DISABLEDLISTENERS); } }
private void updateUninstalledComputerCount() { IPreferenceStore preferenceStore= PreferenceConstants.getPreferenceStore(); fIsFirstTimeCheckForUninstalledComputers= !preferenceStore.contains(NUM_COMPUTERS_PREF_KEY); int lastNumberOfComputers= preferenceStore.getInt(NUM_COMPUTERS_PREF_KEY); int currNumber= fDescriptors.size(); fHasUninstalledComputers= lastNumberOfComputers > currNumber; preferenceStore.putValue(NUM_COMPUTERS_PREF_KEY, Integer.toString(currNumber)); JavaPlugin.flushInstanceScope(); }
private void updateUninstalledComputerCount() { IPreferenceStore preferenceStore= PreferenceConstants.getPreferenceStore(); fIsFirstTimeCheckForUninstalledComputers= !preferenceStore.contains(NUM_COMPUTERS_PREF_KEY); int lastNumberOfComputers= preferenceStore.getInt(NUM_COMPUTERS_PREF_KEY); int currNumber= fDescriptors.size(); fHasUninstalledComputers= lastNumberOfComputers > currNumber; preferenceStore.putValue(NUM_COMPUTERS_PREF_KEY, Integer.toString(currNumber)); JavaPlugin.flushInstanceScope(); }
public static boolean wordWrap() { IPreferenceStore pStore = Activator.getDefault().getPreferenceStore(); if (! pStore.contains(MarkdownPreferencePage.PREF_WORD_WRAP)) { return false; } return pStore.getBoolean(MarkdownPreferencePage.PREF_WORD_WRAP); }
private RGB getColorFromStore(IPreferenceStore store, String key) { RGB rgb= null; if (store.contains(key)) { if (store.isDefault(key)) rgb= PreferenceConverter.getDefaultColor(store, key); else rgb= PreferenceConverter.getColor(store, key); } return rgb; }
private RGB getColorFromStore(IPreferenceStore store, String key) { RGB rgb= null; if (store.contains(key)) { if (store.isDefault(key)) rgb= PreferenceConverter.getDefaultColor(store, key); else rgb= PreferenceConverter.getColor(store, key); } return rgb; }
/** * Load user customizations * @param paletteItemManager */ public static void loadUserCustomizations(IPaletteItemManager paletteItemManager) { IPreferenceStore store = getPreferenceStore(); for (Iterator it=paletteItemManager.getAllCategories().iterator();it.hasNext();){ TaglibPaletteDrawer tld = (TaglibPaletteDrawer)it.next(); if (store.contains(PREFS_TAGLIBHIDE_PREFIX+tld.getURI())){ tld.setVisible( ! store.getBoolean(PREFS_TAGLIBHIDE_PREFIX+tld.getURI())); } } }
@Override public IUndoManager getUndoManager(ISourceViewer sourceViewer) { if (fPreferenceStore == null || !fPreferenceStore.contains(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_UNDO_HISTORY_SIZE)) return super.getUndoManager(sourceViewer); int undoHistorySize= fPreferenceStore.getInt(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_UNDO_HISTORY_SIZE); return new TextViewerUndoManager(undoHistorySize); }
public final void load(final IPreferenceStore store, final String preferenceKey) { final boolean currentValue = ((Boolean) getValue()).booleanValue(); store.setDefault(preferenceKey, currentValue); if (shouldPersist() && (store.contains(preferenceKey))) { final boolean value = store.getBoolean(preferenceKey); setValue(value ? Boolean.TRUE : Boolean.FALSE); } }
private void persistSettings() { IPreferenceStore pstore = AspectJUIPlugin.getDefault() .getPreferenceStore(); if (!pstore.contains(AspectJPreferences.CHANGES_VIEW_PROPAGATE_UP)) { pstore.setDefault(AspectJPreferences.CHANGES_VIEW_PROPAGATE_UP, false); } pstore.setValue(AspectJPreferences.CHANGES_VIEW_PROPAGATE_UP, propagateUp); if (!pstore.contains(AspectJPreferences.CHANGES_VIEW_COMPARE_PREV)) { pstore.setDefault(AspectJPreferences.CHANGES_VIEW_COMPARE_PREV, true); } pstore.setValue(AspectJPreferences.CHANGES_VIEW_COMPARE_PREV, comparePrev); AspectJUIPlugin.getDefault().savePluginPreferences(); }
public boolean getEngineEnabled(EngineDescriptor desc) { IPreferenceStore store = getPreferenceStore(); String key = getMasterKey(desc.getId()); if (store.contains(key)) return store.getBoolean(key); store.setValue(key, desc.isEnabled()); return desc.isEnabled(); } public void setEngineEnabled(EngineDescriptor desc, boolean value) {