private void convertFromProperties(Properties props) { IEclipsePreferences preferences = getPluginPreferences(true); for (Iterator<Object> i = props.keySet().iterator(); i.hasNext();) { String key = (String) i.next(); String value = props.getProperty(key); if (value != null) preferences.put(key, value); } }
@Override public void putPreferences(IEclipsePreferences preferences, ColorThemeSetting setting) { preferences.put(pluginKey, setting.getColor().asRGB()); if (setting.isBoldEnabled() != null) preferences.putBoolean(pluginKey.replaceAll(".color", ".bold"), setting.isBoldEnabled()); if (setting.isItalicEnabled() != null) preferences.putBoolean(pluginKey.replaceAll(".color", ".italic"), setting.isItalicEnabled()); if (setting.isStrikethroughEnabled() != null) preferences.putBoolean(pluginKey.replaceAll(".color", ".strikethrough"), setting.isStrikethroughEnabled()); if (setting.isUnderlineEnabled() != null) preferences.putBoolean(pluginKey.replaceAll(".color", ".underline"), setting.isUnderlineEnabled()); } }
@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.putBoolean(pluginKey + separator + "enabled", true); preferences.put(pluginKey + separator + "color", setting.getColor().asRGB()); if (setting.isBoldEnabled() != null) preferences.putBoolean(pluginKey + separator + "bold", setting.isBoldEnabled()); if (setting.isItalicEnabled() != null) preferences.putBoolean(pluginKey + separator + "italic", setting.isItalicEnabled()); if (setting.isUnderlineEnabled() != null) preferences.putBoolean(pluginKey + separator + "underline", setting.isUnderlineEnabled()); if (setting.isStrikethroughEnabled() != null) preferences.putBoolean(pluginKey + separator + "strikethrough", setting.isStrikethroughEnabled()); }
/** * Sets the default value for the string-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, String value) { if (value == null) throw new IllegalArgumentException(); getDefaultPreferences().put(name, value); }
@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); } }
@Override public void putPreferences(IEclipsePreferences preferences, ColorThemeSetting setting) { preferences.put(pluginKey, setting.getColor().asRGB()); if (setting.isBoldEnabled() != null) preferences.putBoolean(pluginKey + "Bold", setting.isBoldEnabled()); } }
@Override public void putPreferences(IEclipsePreferences preferences, ColorThemeSetting setting) { preferences.put(pluginKey, setting.getColor().asRGB()); if (setting.isBoldEnabled() != null) preferences.putBoolean(pluginKey + "_bold", setting.isBoldEnabled()); if (setting.isItalicEnabled() != null) preferences.putBoolean(pluginKey + "_italic", setting.isItalicEnabled()); if (setting.isStrikethroughEnabled() != null) preferences.putBoolean(pluginKey + "_strikethrough", setting.isStrikethroughEnabled()); if (setting.isUnderlineEnabled() != null) preferences.putBoolean(pluginKey + "_underline", setting.isUnderlineEnabled()); }
@Override public void putPreferences(IEclipsePreferences preferences, ColorThemeSetting setting) { // TODO: Add support for bold, italic, etc. String value = "0,0,0,0,0," + setting.getColor().asRGB(); preferences.put(pluginKey, value); } }
@Override public void putPreferences(IEclipsePreferences preferences, ColorThemeSetting setting) { String baseKey = pluginKey.replaceAll("Color", ""); preferences.put(pluginKey, setting.getColor().asHex()); if (setting.isBoldEnabled() != null) preferences.putBoolean(baseKey + "Bold", setting.isBoldEnabled()); if (setting.isItalicEnabled() != null) preferences.putBoolean(baseKey + "Italic", setting.isItalicEnabled()); if (setting.isUnderlineEnabled() != null) preferences.putBoolean(baseKey + "Underline", setting.isUnderlineEnabled()); if (setting.isStrikethroughEnabled() != null) preferences.putBoolean(baseKey + "Strikethrough", setting.isStrikethroughEnabled()); }
public void putPreferences(IEclipsePreferences preferences, ColorThemeSetting setting) { Color color = setting.getColor(); preferences.put(pluginKey, color.toString()); }
@Override public void putPreferences(IEclipsePreferences preferences, ColorThemeSetting setting) { preferences.put(pluginKey, setting.getColor().asRGB()); if (setting.isBoldEnabled() != null) preferences.putBoolean(pluginKey + "_bold", setting.isBoldEnabled()); if (setting.isItalicEnabled() != null) preferences.putBoolean(pluginKey + "_italic", setting.isItalicEnabled()); if (setting.isStrikethroughEnabled() != null) preferences.putBoolean(pluginKey + "_strikethrough", setting.isStrikethroughEnabled()); if (setting.isUnderlineEnabled() != null) preferences.putBoolean(pluginKey + "_underline", setting.isUnderlineEnabled()); } }
@Override public void putPreferences(IEclipsePreferences preferences, ColorThemeSetting setting) { super.putPreferences(preferences, setting); preferences.put(pluginKey + separator + "color", setting.getColor().asHex()); } }
@Override public void putPreferences(IEclipsePreferences preferences, ColorThemeSetting setting) { if (pluginKey.startsWith("editors/options/")) { Preferences pref = preferences.parent().node("de.walware.statet.base.ui/editors/options"); pref.put(pluginKey.substring(16), setting.getColor().asRGB()); } else { preferences.put(pluginKey, setting.getColor().asRGB()); } }
@Override public void putPreferences(IEclipsePreferences preferences, ColorThemeSetting setting) { String value = setting.getColor().asHex() + " | " + defaultBackground.getHexColorOrNull() + " | " + setting.isBoldEnabled() + " | " + setting.isItalicEnabled() + " | " + setting.isStrikethroughEnabled() + " | " + setting.isUnderlineEnabled(); preferences.put(pluginKey, value); } }
private Preferences setMembersSortOrder(String sortOrder) { if (sortOrder != null) { IEclipsePreferences fPreferenceStore = InstanceScope.INSTANCE.getNode(IConstants.PLUGIN_ID); fPreferenceStore.put(MembersOrderPreferenceCacheCommon.APPEARANCE_MEMBER_SORT_ORDER, sortOrder); } return this; }
@Override void write(String key, String value) { if (value == null) { this.preferences.remove(key); } else { this.preferences.put(key, value); } }
public void performOk() { if (fFormatterCombo == null) { return; } String formatterId= fFormatters[fFormatterCombo.getSelectionIndex()].fId; if (!formatterId.equals(fDefaultFormatterId)) { fPrefs.put(JavaCore.JAVA_FORMATTER, formatterId); } else { // Simply reset to the default one. performDefaults(); } }
public void setStoredValue(IScopeContext context, String value, IWorkingCopyManager manager) { if (value != null) { getNode(context, manager).put(fKey, value); } else { getNode(context, manager).remove(fKey); } }