Java Code Examples for org.eclipse.core.runtime.preferences.IEclipsePreferences#put()

The following examples show how to use org.eclipse.core.runtime.preferences.IEclipsePreferences#put() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AbstractProfileManager.java    From xtext-xtend with Eclipse Public License 2.0 6 votes vote down vote up
/**
 * Update all formatter settings with the settings of the specified profile.
 * 
 * @param profile
 *            The profile to write to the preference store
 */
private void writeToPreferenceStore(Profile profile, IScopeContext context) {
	final Map profileOptions = profile.getSettings();

	for (int i = 0; i < fKeySets.length; i++) {
		updatePreferences(context.getNode(fKeySets[i].getNodeName()), fKeySets[i].getKeys(), profileOptions);
	}

	final IEclipsePreferences uiPrefs = context.getNode(getNodeId());
	if (uiPrefs.getInt(fProfileVersionKey, 0) != fProfileVersioner.getCurrentVersion()) {
		uiPrefs.putInt(fProfileVersionKey, fProfileVersioner.getCurrentVersion());
	}

	if (context.getName() == InstanceScope.SCOPE) {
		uiPrefs.put(fProfileKey, profile.getID());
	} else if (context.getName() == ProjectScope.SCOPE && !profile.isSharedProfile()) {
		uiPrefs.put(fProfileKey, profile.getID());
	}
}
 
Example 2
Source File: GWTProjectProperties.java    From gwt-eclipse-plugin with Eclipse Public License 1.0 6 votes vote down vote up
public static void setFileNamesCopiedToWebInfLib(IProject project,
    List<String> fileNamesCopiedToWebInfLib) throws BackingStoreException {
  IEclipsePreferences prefs = getProjectProperties(project);
  StringBuilder sb = new StringBuilder();
  boolean addPipe = false;
  for (String fileNameCopiedToWebInfLib : fileNamesCopiedToWebInfLib) {
    if (addPipe) {
      sb.append("|");
    } else {
      addPipe = true;
    }

    sb.append(fileNameCopiedToWebInfLib);
  }

  prefs.put(FILES_COPIED_TO_WEB_INF_LIB, sb.toString());
  prefs.flush();
}
 
Example 3
Source File: TypeScriptCorePreferenceInitializer.java    From typescript.java with MIT License 5 votes vote down vote up
private void initializeTypeScriptRuntimePreferences(IEclipsePreferences node,
		ITypeScriptRepository defaultRepository) {
	if (defaultRepository != null) {
		node.put(TypeScriptCorePreferenceConstants.EMBEDDED_TYPESCRIPT_ID, defaultRepository.getName());
		node.putBoolean(TypeScriptCorePreferenceConstants.USE_EMBEDDED_TYPESCRIPT, true);
	} else {
		node.putBoolean(TypeScriptCorePreferenceConstants.USE_EMBEDDED_TYPESCRIPT, false);
	}
	node.put(TypeScriptCorePreferenceConstants.INSTALLED_TYPESCRIPT_PATH, "");
}
 
Example 4
Source File: CSSFormatterPreferenceInitializer.java    From APICloud-Studio with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void initializeDefaultPreferences()
{
	IEclipsePreferences pref = EclipseUtil.defaultScope().getNode(CSSFormatterPlugin.PLUGIN_ID);

	pref.put(CSSFormatterConstants.FORMATTER_TAB_CHAR, CodeFormatterConstants.EDITOR);
	pref.put(CSSFormatterConstants.FORMATTER_TAB_SIZE,
			Integer.toString(EditorUtil.getSpaceIndentSize(CSSPlugin.getDefault().getBundle().getSymbolicName())));
	pref.put(CSSFormatterConstants.FORMATTER_INDENTATION_SIZE, "4"); //$NON-NLS-1$
	pref.putBoolean(CSSFormatterConstants.WRAP_COMMENTS, false);
	pref.putInt(CSSFormatterConstants.WRAP_COMMENTS_LENGTH, 80);
	pref.put(CSSFormatterConstants.NEW_LINES_BEFORE_BLOCKS, CodeFormatterConstants.SAME_LINE);
	pref.putInt(CSSFormatterConstants.LINES_AFTER_ELEMENTS, 0);
	pref.putInt(CSSFormatterConstants.LINES_AFTER_DECLARATION, 0);
	pref.putInt(CSSFormatterConstants.PRESERVED_LINES, 1);

	pref.putInt(CSSFormatterConstants.SPACES_BEFORE_COMMAS, 0);
	pref.putInt(CSSFormatterConstants.SPACES_AFTER_COMMAS, 1);
	pref.putInt(CSSFormatterConstants.SPACES_BEFORE_SEMICOLON, 0);
	pref.putInt(CSSFormatterConstants.SPACES_AFTER_SEMICOLON, 0);
	pref.putInt(CSSFormatterConstants.SPACES_BEFORE_PARENTHESES, 1);
	pref.putInt(CSSFormatterConstants.SPACES_AFTER_PARENTHESES, 1);
	pref.putInt(CSSFormatterConstants.SPACES_BEFORE_COLON, 0);
	pref.putInt(CSSFormatterConstants.SPACES_AFTER_COLON, 1);
	pref.putInt(CSSFormatterConstants.SPACES_BEFORE_CHILD_COMBINATOR, 1);
	pref.putInt(CSSFormatterConstants.SPACES_AFTER_CHILD_COMBINATOR, 1);

	pref.putBoolean(CSSFormatterConstants.FORMATTER_OFF_ON_ENABLED, false);
	pref.put(CSSFormatterConstants.FORMATTER_ON, CSSFormatterConstants.DEFAULT_FORMATTER_ON);
	pref.put(CSSFormatterConstants.FORMATTER_OFF, CSSFormatterConstants.DEFAULT_FORMATTER_OFF);

	try
	{
		pref.flush();
	}
	catch (BackingStoreException e)
	{
		IdeLog.logError(CSSFormatterPlugin.getDefault(), e, IDebugScopes.DEBUG);
	}
}
 
Example 5
Source File: InvasiveThemeHijacker.java    From APICloud-Studio with GNU General Public License v3.0 5 votes vote down vote up
protected void setGeneralEditorValues(Theme theme, IEclipsePreferences prefs, boolean revertToDefaults)
{
	if (prefs == null)
		return;
	if (revertToDefaults)
	{
		prefs.remove(AbstractTextEditor.PREFERENCE_COLOR_SELECTION_BACKGROUND);
		prefs.remove(AbstractTextEditor.PREFERENCE_COLOR_SELECTION_FOREGROUND);
		prefs.remove(AbstractTextEditor.PREFERENCE_COLOR_BACKGROUND);
		prefs.remove(AbstractTextEditor.PREFERENCE_COLOR_FOREGROUND);
		prefs.remove(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_CURRENT_LINE_COLOR);
	}
	else
	{
		prefs.put(AbstractTextEditor.PREFERENCE_COLOR_SELECTION_BACKGROUND,
				StringConverter.asString(theme.getSelectionAgainstBG()));
		prefs.put(AbstractTextEditor.PREFERENCE_COLOR_SELECTION_FOREGROUND,
				StringConverter.asString(theme.getForeground()));
		prefs.put(AbstractTextEditor.PREFERENCE_COLOR_BACKGROUND, StringConverter.asString(theme.getBackground()));
		prefs.put(AbstractTextEditor.PREFERENCE_COLOR_FOREGROUND, StringConverter.asString(theme.getForeground()));
		prefs.put(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_CURRENT_LINE_COLOR,
				StringConverter.asString(theme.getLineHighlightAgainstBG()));
	}

	prefs.putBoolean(AbstractTextEditor.PREFERENCE_COLOR_SELECTION_FOREGROUND_SYSTEM_DEFAULT, revertToDefaults);
	prefs.putBoolean(AbstractTextEditor.PREFERENCE_COLOR_BACKGROUND_SYSTEM_DEFAULT, revertToDefaults);
	prefs.putBoolean(AbstractTextEditor.PREFERENCE_COLOR_FOREGROUND_SYSTEM_DEFAULT, revertToDefaults);

	try
	{
		prefs.flush();
	}
	catch (BackingStoreException e)
	{
		IdeLog.logError(ThemePlugin.getDefault(), e);
	}
}
 
Example 6
Source File: InvasiveThemeHijacker.java    From APICloud-Studio with GNU General Public License v3.0 5 votes vote down vote up
protected void setWSTToken(IEclipsePreferences prefs, Theme theme, String ourEquivalentScope, String prefKey,
		boolean revertToDefaults)
{
	if (revertToDefaults)
	{
		prefs.remove(prefKey);
	}
	else
	{
		TextAttribute attr = theme.getTextAttribute(ourEquivalentScope);
		boolean bold = (attr.getStyle() & SWT.BOLD) != 0;
		boolean italic = (attr.getStyle() & SWT.ITALIC) != 0;
		boolean strikethrough = (attr.getStyle() & TextAttribute.STRIKETHROUGH) != 0;
		boolean underline = (attr.getStyle() & TextAttribute.UNDERLINE) != 0;
		StringBuilder value = new StringBuilder();
		value.append(Theme.toHex(attr.getForeground().getRGB()));
		value.append('|');
		value.append(Theme.toHex(attr.getBackground().getRGB()));
		value.append('|');
		value.append(bold);
		value.append('|');
		value.append(italic);
		value.append('|');
		value.append(strikethrough);
		value.append('|');
		value.append(underline);
		prefs.put(prefKey, value.toString());
	}
}
 
Example 7
Source File: CheckDefaultPreferencesDialog.java    From Pydev with Eclipse Public License 1.0 5 votes vote down vote up
public void apply() {
    IEclipsePreferences node = InstanceScope.INSTANCE.getNode(this.plugin);
    node.put(this.pref, this.value);
    try {
        node.flush();
    } catch (BackingStoreException e) {
        Log.log(e);
    }
}
 
Example 8
Source File: NodePreferencesInitializer.java    From depan with Apache License 2.0 5 votes vote down vote up
@Override
public void initializeDefaultPreferences() {
  IEclipsePreferences defaults = PreferencesIds.getDefaultNode();

  defaults.put(NodePreferencesIds.NODE_COLOR,
      ViewExtensionRegistry.getRegistryGetDefaultColorMode().getLabel());

  defaults.put(NodePreferencesIds.NODE_SHAPE,
      ViewExtensionRegistry.getRegistryGetDefaultShapeMode().getLabel());

  defaults.put(NodePreferencesIds.NODE_SIZE,
      ViewExtensionRegistry.getRegistryGetDefaultSizeMode().getLabel());
}
 
Example 9
Source File: TmfUIPreferenceInitializer.java    From tracecompass with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public void initializeDefaultPreferences() {
    IEclipsePreferences defaultPreferences = DefaultScope.INSTANCE.getNode(Activator.PLUGIN_ID);
    defaultPreferences.putBoolean(ITmfUIPreferences.PREF_ALIGN_VIEWS, true);
    defaultPreferences.put(ITmfUIPreferences.SWITCH_TO_PERSPECTIVE, MessageDialogWithToggle.PROMPT);
    defaultPreferences.putBoolean(ITmfUIPreferences.CONFIRM_DELETION_SUPPLEMENTARY_FILES, true);
}
 
Example 10
Source File: TypeScriptCorePreferenceInitializer.java    From typescript.java with MIT License 5 votes vote down vote up
/**
 * initialize properties for direct access of node.js server (start an
 * internal process)
 * 
 * @param node
 */
private void initializeNodejsPreferences(IEclipsePreferences node) {
	// By default use the embedded Node.js install (if exists)
	if (!useBundledNodeJsEmbedded(node)) {
		// Use installed node.js in case there is no embedded install.
		node.putBoolean(TypeScriptCorePreferenceConstants.USE_NODEJS_EMBEDDED, false);
	} else {
		node.putBoolean(TypeScriptCorePreferenceConstants.USE_NODEJS_EMBEDDED, true);
	}
	node.put(TypeScriptCorePreferenceConstants.NODEJS_PATH, IDENodejsProcessHelper.getNodejsPath());
}
 
Example 11
Source File: CleanUpPreferenceUtil.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
public static void saveSaveParticipantOptions(IScopeContext context, Map<String, String> settings) {
	IEclipsePreferences node= context.getNode(JavaUI.ID_PLUGIN);
	for (Iterator<String> iterator= settings.keySet().iterator(); iterator.hasNext();) {
     String key= iterator.next();
     node.put(SAVE_PARTICIPANT_KEY_PREFIX + key, settings.get(key));
    }
}
 
Example 12
Source File: ThemerPreferenceInitializer.java    From APICloud-Studio with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void initializeDefaultPreferences()
{
	IEclipsePreferences node = EclipseUtil.defaultScope().getNode(ThemePlugin.PLUGIN_ID);
	node.put(IPreferenceConstants.ACTIVE_THEME, DEFAULT_THEME);
	// Make "invasive theming" the default for our standalones.
	boolean isStandalone = (EclipseUtil.isStandalone() || EclipseUtil
			.getPluginVersion("com.appcelerator.titanium.rcp") != null); //$NON-NLS-1$

	node.putBoolean(IPreferenceConstants.APPLY_TO_ALL_VIEWS, isStandalone);
	node.putBoolean(IPreferenceConstants.APPLY_TO_ALL_EDITORS, isStandalone);
}
 
Example 13
Source File: XMLFormatterPreferenceInitializer.java    From APICloud-Studio with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void initializeDefaultPreferences()
{
	IEclipsePreferences store = EclipseUtil.defaultScope().getNode(XMLFormatterPlugin.PLUGIN_ID);
	store.put(XMLFormatterConstants.FORMATTER_TAB_CHAR, CodeFormatterConstants.EDITOR);
	store.put(XMLFormatterConstants.FORMATTER_TAB_SIZE,
			Integer.toString(EditorUtil.getSpaceIndentSize(XMLPlugin.getDefault().getBundle().getSymbolicName())));
	store.put(XMLFormatterConstants.FORMATTER_INDENTATION_SIZE, "4"); //$NON-NLS-1$
	store.putBoolean(XMLFormatterConstants.WRAP_COMMENTS, false);
	store.putInt(XMLFormatterConstants.WRAP_COMMENTS_LENGTH, 80);
	// No excluded tags by default
	store.put(XMLFormatterConstants.INDENT_EXCLUDED_TAGS, StringUtil.EMPTY);
	store.put(XMLFormatterConstants.NEW_LINES_EXCLUDED_TAGS, StringUtil.EMPTY);
	store.putBoolean(XMLFormatterConstants.NEW_LINES_EXCLUDED_ON_TEXT_NODES, true);
	store.putInt(XMLFormatterConstants.LINES_AFTER_ELEMENTS, 0);
	store.putInt(XMLFormatterConstants.LINES_AFTER_NON_XML_ELEMENTS, 1);
	store.putInt(XMLFormatterConstants.LINES_BEFORE_NON_XML_ELEMENTS, 1);
	store.putInt(XMLFormatterConstants.PRESERVED_LINES, 1);

	store.putBoolean(XMLFormatterConstants.FORMATTER_OFF_ON_ENABLED, false);
	store.put(XMLFormatterConstants.FORMATTER_ON, XMLFormatterConstants.DEFAULT_FORMATTER_ON);
	store.put(XMLFormatterConstants.FORMATTER_OFF, XMLFormatterConstants.DEFAULT_FORMATTER_OFF);

	try
	{
		store.flush();
	}
	catch (BackingStoreException e)
	{
		IdeLog.logError(XMLFormatterPlugin.getDefault(), e, IDebugScopes.DEBUG);
	}
}
 
Example 14
Source File: GdtPreferences.java    From gwt-eclipse-plugin with Eclipse Public License 1.0 4 votes vote down vote up
public static void setAddedNewWizardActionsForPerspective(String perspectiveId, List<String> wizardIds) {
  IEclipsePreferences instancePrefs = getInstancePreferences();
  instancePrefs.put(ADDED_NEW_WIZARD_ACTIONS + perspectiveId, PropertiesUtilities.serializeStrings(wizardIds));
  flushPreferences(instancePrefs);
}
 
Example 15
Source File: Preferences.java    From eclipse.jdt.ls with Eclipse Public License 2.0 4 votes vote down vote up
public Preferences setImportOrder(List<String> importOrder) {
	this.importOrder = (importOrder == null || importOrder.size() == 0) ? JAVA_IMPORT_ORDER_DEFAULT : importOrder;
	IEclipsePreferences pref = InstanceScope.INSTANCE.getNode(IConstants.PLUGIN_ID);
	pref.put(CodeStyleConfiguration.ORGIMPORTS_IMPORTORDER, String.join(";", importOrder));
	return this;
}
 
Example 16
Source File: EditorConfigVisitor.java    From editorconfig-eclipse with Apache License 2.0 4 votes vote down vote up
private void setPreference(final String prefsNodeName, final String key, final String value) {
	System.out.println(String.format("Setting preference: %s/%s=%s", prefsNodeName, key, value));
	final IEclipsePreferences prefs = InstanceScope.INSTANCE.getNode(prefsNodeName);
	prefs.put(key, value);
}
 
Example 17
Source File: InvasiveThemeHijacker.java    From APICloud-Studio with GNU General Public License v3.0 4 votes vote down vote up
protected void applyThemetoJDT(Theme theme, boolean revertToDefaults)
{
	// Now set for JDT...
	IEclipsePreferences prefs = EclipseUtil.instanceScope().getNode(ORG_ECLIPSE_JDT_UI);
	setGeneralEditorValues(theme, prefs, revertToDefaults);

	// Set prefs for JDT so it's various tokens get colors that match up to our theme!
	// prefs = EclipseUtil.instanceScope().getNode("org.eclipse.jdt.ui");
	setToken(prefs, theme, "string.quoted.double.java", "java_string", revertToDefaults); //$NON-NLS-1$ //$NON-NLS-2$
	setToken(prefs, theme, "source.java", "java_default", revertToDefaults); //$NON-NLS-1$ //$NON-NLS-2$
	setToken(prefs, theme, "keyword", "java_keyword", revertToDefaults); //$NON-NLS-1$ //$NON-NLS-2$
	setToken(prefs, theme, "keyword.operator", "java_operator", revertToDefaults); //$NON-NLS-1$ //$NON-NLS-2$
	setToken(prefs, theme, "keyword.control.java", "java_keyword_return", revertToDefaults); //$NON-NLS-1$ //$NON-NLS-2$
	setToken(prefs, theme, "comment.line.double-slash.java", "java_single_line_comment", revertToDefaults); //$NON-NLS-1$ //$NON-NLS-2$
	setToken(prefs, theme, "comment.block", "java_multi_line_comment", revertToDefaults); //$NON-NLS-1$ //$NON-NLS-2$
	setToken(prefs, theme, "punctuation.bracket.java", "java_bracket", revertToDefaults); //$NON-NLS-1$ //$NON-NLS-2$
	// Javadoc
	//String TASK_TAG= "java_comment_task_tag"; //$NON-NLS-1$
	setToken(prefs, theme, "keyword.other.documentation.java", "java_doc_keyword", revertToDefaults); //$NON-NLS-1$ //$NON-NLS-2$
	setToken(prefs, theme, "entity.name.tag.inline.any.html", "java_doc_tag", revertToDefaults); //$NON-NLS-1$ //$NON-NLS-2$
	setToken(prefs, theme, "markup.underline.link.javadoc", "java_doc_link", revertToDefaults); //$NON-NLS-1$ //$NON-NLS-2$
	setToken(prefs, theme, "comment.block.documentation.javadoc", "java_doc_default", revertToDefaults); //$NON-NLS-1$ //$NON-NLS-2$

	// deprecated
	// setToken(prefs, theme, "entity.name.function.java", "java_method_name", revertToDefaults);
	setToken(prefs, theme, "entity.name.type.class.java", "java_type", revertToDefaults); //$NON-NLS-1$ //$NON-NLS-2$
	setToken(prefs, theme, "storage.type.annotation.java", "java_annotation", revertToDefaults); //$NON-NLS-1$ //$NON-NLS-2$

	// Semantic
	setSemanticToken(prefs, theme, "entity.name.type.class.java", "class", revertToDefaults); //$NON-NLS-1$ //$NON-NLS-2$
	setSemanticToken(prefs, theme, "entity.name.type.enum.java", "enum", revertToDefaults); //$NON-NLS-1$ //$NON-NLS-2$
	setSemanticToken(prefs, theme, "entity.name.type.interface.java", "interface", revertToDefaults); //$NON-NLS-1$ //$NON-NLS-2$
	setSemanticToken(prefs, theme, "constant.numeric.java", "number", revertToDefaults); //$NON-NLS-1$ //$NON-NLS-2$
	setSemanticToken(prefs, theme, "variable.parameter.java", "parameterVariable", revertToDefaults); //$NON-NLS-1$ //$NON-NLS-2$
	setSemanticToken(prefs, theme, "constant.other.java", "staticField", revertToDefaults); //$NON-NLS-1$ //$NON-NLS-2$
	setSemanticToken(prefs, theme, "constant.other.java", "staticFinalField", revertToDefaults); //$NON-NLS-1$ //$NON-NLS-2$
	setSemanticToken(prefs, theme, "entity.name.function.java", "methodDeclarationName", revertToDefaults); //$NON-NLS-1$ //$NON-NLS-2$
	setSemanticToken(prefs, theme, "invalid.deprecated.java", "deprecatedMember", revertToDefaults); //$NON-NLS-1$ //$NON-NLS-2$
	setSemanticToken(prefs, theme, "storage.type.annotation.java", "annotation", revertToDefaults); //$NON-NLS-1$ //$NON-NLS-2$
	setSemanticToken(prefs, theme, "constant.other.key.java", "annotationElementReference", revertToDefaults); //$NON-NLS-1$ //$NON-NLS-2$
	setSemanticToken(prefs, theme, "source.java", "localVariable", revertToDefaults); //$NON-NLS-1$ //$NON-NLS-2$
	setSemanticToken(prefs, theme, "source.java", "field", revertToDefaults); //$NON-NLS-1$ //$NON-NLS-2$
	setSemanticToken(prefs, theme, "source.java", "staticMethodInvocation", revertToDefaults); //$NON-NLS-1$ //$NON-NLS-2$
	setSemanticToken(prefs, theme, "source.java", "inheritedMethodInvocation", revertToDefaults); //$NON-NLS-1$ //$NON-NLS-2$
	setSemanticToken(prefs, theme, "source.java", "abstractMethodInvocation", revertToDefaults); //$NON-NLS-1$ //$NON-NLS-2$
	setSemanticToken(prefs, theme, "source.java", "localVariableDeclaration", revertToDefaults); //$NON-NLS-1$ //$NON-NLS-2$
	setSemanticToken(prefs, theme, "source.java", "method", revertToDefaults); //$NON-NLS-1$ //$NON-NLS-2$
	setSemanticToken(prefs, theme, "source.java", "typeParameter", revertToDefaults); //$NON-NLS-1$ //$NON-NLS-2$
	setSemanticToken(prefs, theme, "source.java", "autoboxing", revertToDefaults); //$NON-NLS-1$ //$NON-NLS-2$
	setSemanticToken(prefs, theme, "source.java", "typeArgument", revertToDefaults); //$NON-NLS-1$ //$NON-NLS-2$

	// Java *.properties files
	setToken(prefs, theme, "keyword.other.java-props", "pf_coloring_key", revertToDefaults); //$NON-NLS-1$ //$NON-NLS-2$
	setToken(prefs, theme, "comment.line.number-sign.java-props", "pf_coloring_comment", revertToDefaults); //$NON-NLS-1$ //$NON-NLS-2$
	setToken(prefs, theme, "string.java-props", "pf_coloring_value", revertToDefaults); //$NON-NLS-1$ //$NON-NLS-2$
	setToken(prefs, theme, "punctuation.separator.key-value.java-props", "pf_coloring_assignment", revertToDefaults); //$NON-NLS-1$ //$NON-NLS-2$
	setToken(prefs, theme, "string.interpolated.java-props", "pf_coloring_argument", revertToDefaults); //$NON-NLS-1$ //$NON-NLS-2$

	// Override pair matching colors
	if (!revertToDefaults)
	{
		// FIXME Revert back to default value if revertToDefaults!
		prefs.put("matchingBracketsColor", StringConverter.asString(theme.getCharacterPairColor())); //$NON-NLS-1$
	}

	try
	{
		prefs.flush();
	}
	catch (BackingStoreException e)
	{
		IdeLog.logError(ThemePlugin.getDefault(), e);
	}

	// Override JDT editor font
	Font fFont = JFaceResources.getFontRegistry().get(JFaceResources.TEXT_FONT);
	JFaceResources.getFontRegistry().put("org.eclipse.jdt.ui.editors.textfont", fFont.getFontData()); //$NON-NLS-1$
}
 
Example 18
Source File: TypeScriptCorePreferenceInitializer.java    From typescript.java with MIT License 4 votes vote down vote up
private void initializeTypeScriptBuildPath(IEclipsePreferences node) {
	node.put(TypeScriptCorePreferenceConstants.TYPESCRIPT_BUILD_PATH,
			TypeScriptCorePreferenceConstants.DEFAULT_TYPESCRIPT_BUILD_PATH);
}
 
Example 19
Source File: StringPluginPreference.java    From SparkBuilderGenerator with MIT License 4 votes vote down vote up
@Override
public void putDefaultValue(IEclipsePreferences preferences) {
    preferences.put(this.getKey(), this.getDefaultValue());
}
 
Example 20
Source File: GdtPreferences.java    From gwt-eclipse-plugin with Eclipse Public License 1.0 4 votes vote down vote up
public static void setVersionForLastForcedRebuild(IProject project, Version version) {
  IEclipsePreferences instancePrefs = getInstancePreferences();
  instancePrefs.put(VERSION_FOR_LAST_FORCED_REBUILD_PREFIX + project.getName(), version.toString());
  flushPreferences(instancePrefs);
}