String activeThemeName = getPreferenceStore().getString("colorTheme"); if (colorThemeManager.getTheme(activeThemeName) == null) activeThemeName = "Default"; forceDefaultBG.setSelection(getPreferenceStore().getBoolean("forceDefaultBG")); forceDefaultBG.setToolTipText("Forces the background color of all color styles to be 'background' color of the theme");
public class MyPreferenceInitializer extends AbstractPreferenceInitializer { @Override public void initializeDefaultPreferences() { IPreferenceStore store = Plugin.getPlugin().getPreferenceStore(); store.setDefault(MyPreferencePage.PREF_USE_METRIC_UNITS, true); store.setDefault(MyPreferencePage.PREF_AUTO_UPDATE, false); String userHome = System.getProperty("user.home"); String defaultPath = userHome + "\\Local Settings\\Temp\\"; store.setDefault(MyPreferencePage.PREF_USER_FILES_DIR, defaultPath); store.setDefault(MyPreferencePage.PREF_FAVORITE_ANIMAL, "platypus"); } }
@Override public void run() { boolean state= fPreferences.getBoolean(fKey); fPreferences.setValue(fKey, !state); } }
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 void run() { ITextEditor editor= getTextEditor(); if (editor == null) return; boolean showHover= !fStore.getBoolean(PreferenceConstants.EDITOR_SHOW_HOVER); setChecked(showHover); fStore.removePropertyChangeListener(this); fStore.setValue(PreferenceConstants.EDITOR_SHOW_HOVER, showHover); fStore.addPropertyChangeListener(this); }
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 Boolean processPluginUpgrading() { final Version version = getDefault().getBundle().getVersion(); final IPreferenceStore preferenceStore = getDefault().getPreferenceStore(); final String preferenceName = "lastVersionActivated"; final String lastVersionActivated = preferenceStore.getString(preferenceName); final boolean upgraded = "".equals(lastVersionActivated) || (version.compareTo(new Version(lastVersionActivated)) > 0); preferenceStore.setValue(preferenceName, version.toString()); return upgraded; }
public void run() { IPreferenceStore store = getPreferenceStore(); boolean show = isChecked(); store.removePropertyChangeListener(this); store.setValue(getKey(), show); store.addPropertyChangeListener(this); }
public void install(IPreferenceStore store) { fPreferenceStore= store; store.addPropertyChangeListener(this); fSortByVisibility= store.getBoolean(PreferenceConstants.APPEARANCE_ENABLE_VISIBILITY_SORT_ORDER); }
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) {
private void initializeValues() { IPreferenceStore store = getPreferenceStore(); ipAddressText.setText(store.getString(TaskConstants.SERVER_IP_ADDRESS)); portText.setText(store.getInt(TaskConstants.SERVER_PORT) + ""); languageText.setText(store.getString(TaskConstants.LANGUAGE)); transportType.select(store.getInt(TaskConstants.TRANSPORT)); }
/** * Registers this listener on the preference store. */ public void register() { getPreferenceStore().addPropertyChangeListener(this); }
@Override public void widgetDisposed(org.eclipse.swt.events.DisposeEvent e) { combinedStore.removePropertyChangeListener(propertyChangeListener); } });
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); } }
public int getTabWidth(ISourceViewer sourceViewer) { if (fPreferenceStore == null) return super.getTabWidth(sourceViewer); return fPreferenceStore.getInt(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_TAB_WIDTH); }
/** * Initializes states of the controls using default values * in the preference store. */ private void initializeDefaults() { schemaNsPrefixField.setText(getPreferenceStore().getDefaultString(XSDEditorPlugin.CONST_XSD_DEFAULT_PREFIX_TEXT)); qualifyXSDLanguage.setSelection(getPreferenceStore().getDefaultBoolean(XSDEditorPlugin.CONST_XSD_LANGUAGE_QUALIFY)); defaultTargetNamespaceText.setText(getPreferenceStore().getString(XSDEditorPlugin.CONST_DEFAULT_TARGET_NAMESPACE)); honourAllSchemaLocations.setSelection(XSDCorePlugin.getDefault().getPluginPreferences().getDefaultBoolean(XSDCorePreferenceNames.HONOUR_ALL_SCHEMA_LOCATIONS)); }
private int getDay(IPreferenceStore pref, boolean useDefault) { String day = useDefault ? pref.getDefaultString(AutomaticUpdateScheduler.P_DAY) : pref.getString(AutomaticUpdateScheduler.P_DAY); for (int i = 0; i < AutomaticUpdateScheduler.DAYS.length; i++) if (AutomaticUpdateScheduler.DAYS[i].equals(day)) return i; return 0; }
/** * @param modelId the {@link String} model id * @return default number of addressable units per column for the model */ private int getDefaultColumnSizeByModel(String modelId) { int col = DebugUITools.getPreferenceStore().getInt(getColumnPrefId(modelId)); if (col == 0) { DebugUITools.getPreferenceStore().setValue(getColumnPrefId(modelId), IDebugPreferenceConstants.PREF_COLUMN_SIZE_DEFAULT); } col = DebugUITools.getPreferenceStore().getInt(getColumnPrefId(modelId)); return col; }
public void setDefaults() { String res = fStore.getDefaultString(RutaPreferenceConstants.DOC_RUTA_PAGES_LOCATIONS); fStore.setValue(RutaPreferenceConstants.DOC_RUTA_PAGES_LOCATIONS, res); initialize(); }