/** * Sets the default value for the integer-valued property with the * given name. * <p> * Note that the current value of the property is affected if * the property's current value was its old default value, in which * case it changes to the new default value. If the property's current * is different from its old default value, its current value is * unaffected. No property change events are reported by changing default * values. * </p> * * @param name the name of the property * @param value the new default value for the property */ @Override public void setDefault(String name, int value) { getDefaultPreferences().putInt(name, value); }
@Override public void putPreferences(IEclipsePreferences preferences, ColorThemeSetting setting) { // Set the color itself super.putPreferences(preferences, setting); // Enables the color setting preferences.putBoolean(pluginKey + "Enabled", true); // Set style preferences.putInt(pluginKey + "Style", getStyleValue(setting)); }
@Override public void putPreferences(IEclipsePreferences preferences, ColorThemeSetting setting) { preferences.put(pluginKey, setting.getColor().asRGB()); if (pluginKey.endsWith("TexColor")) { String styleKey = pluginKey.replaceAll("Color", "Style"); if (setting.isBoldEnabled() != null && setting.isBoldEnabled()) { preferences.putInt(styleKey, 1); } else if (setting.isItalicEnabled() != null && setting.isItalicEnabled()) { preferences.putInt(styleKey, 2); } else { preferences.remove(styleKey); } } } }
@Override public void putPreferences(IEclipsePreferences preferences, ColorThemeSetting setting) { preferences.put(pluginKey, setting.getColor().asRGB()); String styleKey = pluginKey.replaceAll("COLOR", "STYLE"); int styleVal = 0; if (setting.isBoldEnabled() != null && setting.isBoldEnabled()) { styleVal += 1; } if (setting.isItalicEnabled() != null && setting.isItalicEnabled()) { styleVal += 2; } preferences.putInt(styleKey, styleVal); } }
/** * Associates the specified <code>int</code> value with the specified key in the default scope. * This method is intended for use in conjunction with the {@link #getDefaultInt(String)} method. * * @param key <code>key</code> with which the string form of value is to be associated. * @param value <code>value</code> to be associated with <code>key</code>. * @see #getDefaultInt(String) * @see #getInt(String) */ public void setDefault(String key, int value) { fDefaultScopePrefs.putInt(key, value); }
/** * Associates the specified <code>int</code> value with the specified key in the instance scope. * This method is intended for use in conjunction with the {@link #getInt(String)} method. * * @param key <code>key</code> with which the <code>int</code> value is to be associated. * @param value <code>value</code> to be associated with <code>key</code>. * @see #getInt(String) * @see #getDefaultInt(String) * @see #setToDefault(String) */ public void setValue(String key, int value) { fInstanceScopePrefs.putInt(key, value); }
/** * Sets a integer in the {@link DefaultScope} * @param qualifier the preference qualifier * @param key the key * @param value the new value */ public static synchronized void setDefaultInt(String qualifier, String key, int value) { contexts[DEFAULT_CONTEXT].getNode(qualifier).putInt(key, value); }
@Override public void setDefault(String name, int value) { getDefaultPreferences().putInt(name, value); }
public void setDefault(String name, int value) { getDefaultPreferences().putInt(name, value); }
private void configureXMLEditor() { IEclipsePreferences prefs = Util.getNode("org.eclipse.wst.xml.core"); if(null == prefs) { return; } prefs.putInt("lineWidth", 120); Util.savePrefs(prefs); }
@Override protected void doStore() { InstanceScope.INSTANCE.getNode(node).putInt(key, Integer.parseInt(getStringValue())); }
private void incrementRebuildCount() { fRebuildCount++; fManager.getWorkingCopy(DefaultScope.INSTANCE.getNode(JavaUI.ID_PLUGIN)).putInt(REBUILD_COUNT_KEY, fRebuildCount); }
public static void setScalePercentage(int i) { IEclipsePreferences prefs = InstanceScope.INSTANCE.getNode(IntroPlugin.PLUGIN_ID); prefs.putInt(SCALE_FACTOR, i); try { prefs.flush(); } catch (BackingStoreException e) { } }
private void incrementRebuildCount() { fRebuildCount++; fManager.getWorkingCopy(DefaultScope.INSTANCE.getNode(JavaUI.ID_PLUGIN)).putInt(REBUILD_COUNT_KEY, fRebuildCount); }
public void writeProfiles(Collection<Profile> profiles, IScopeContext instanceScope) throws CoreException { ByteArrayOutputStream stream= new ByteArrayOutputStream(2000); try { writeProfilesToStream(profiles, stream, ENCODING, fProfileVersioner); String val; try { val= stream.toString(ENCODING); } catch (UnsupportedEncodingException e) { val= stream.toString(); } IEclipsePreferences uiPreferences = instanceScope.getNode(JavaUI.ID_PLUGIN); uiPreferences.put(fProfilesKey, val); uiPreferences.putInt(fProfilesVersionKey, fProfileVersioner.getCurrentVersion()); } finally { try { stream.close(); } catch (IOException e) { /* ignore */ } } }
private void configureIde() { IEclipsePreferences prefs = Util.getNode("org.eclipse.ui.ide"); if(null == prefs) { return; } prefs.putBoolean("EXIT_PROMPT_ON_CLOSE_LAST_WINDOW", false); prefs.putInt("MAX_RECENT_WORKSPACES", 10); Util.savePrefs(prefs); }
private void configurePerformanceMonitoring() { IEclipsePreferences prefs = Util.getNode("org.eclipse.ui.monitoring"); if(null == prefs) { return; } prefs.putBoolean("monitoring_enabled", true); prefs.putInt("long_event_error_threshold", 800); Util.savePrefs(prefs); }
private void incrementRebuildCount() { fRebuildCount++; fManager.getWorkingCopy(new DefaultScope().getNode(JavaUI.ID_PLUGIN)).putInt(REBUILD_COUNT_KEY, fRebuildCount); }
private void saveOrientation() { IEclipsePreferences node = InstanceScope.INSTANCE.getNode(DebugUIPlugin.getUniqueIdentifier()); if (node != null) { try { node.putInt(getOrientationPrefId(), fViewOrientation); node.flush(); } catch (BackingStoreException e) { DebugUIPlugin.log(e); } } }
public static void setFlag(String flagId, int value) { if (getDefaultFlag(flagId) == value) new InstanceScope().getNode(PDE.PLUGIN_ID).remove(flagId); else new InstanceScope().getNode(PDE.PLUGIN_ID).putInt(flagId, value); }