use of org.eclipse.core.runtime.preferences.IEclipsePreferences in project eclipse.platform.text by eclipse.
the class HighlightStrategy method uninstall.
public void uninstall() {
if (sourceViewer != null) {
sourceViewer.getTextWidget().removeCaretListener(this);
}
IEclipsePreferences preferences = InstanceScope.INSTANCE.getNode(GENERIC_EDITOR_BUNDLE_ID);
preferences.removePreferenceChangeListener(this);
}
use of org.eclipse.core.runtime.preferences.IEclipsePreferences in project eclipse.platform.text by eclipse.
the class HighlightStrategy method uninstall.
public void uninstall() {
if (sourceViewer != null) {
sourceViewer.getTextWidget().removeCaretListener(this);
}
IEclipsePreferences preferences = InstanceScope.INSTANCE.getNode(GENERIC_EDITOR_BUNDLE_ID);
preferences.removePreferenceChangeListener(this);
}
use of org.eclipse.core.runtime.preferences.IEclipsePreferences in project eclipse.platform.text by eclipse.
the class HighlightStrategy method install.
public void install(ITextViewer viewer) {
if (!(viewer instanceof ISourceViewer)) {
return;
}
IEclipsePreferences preferences = InstanceScope.INSTANCE.getNode(GENERIC_EDITOR_BUNDLE_ID);
preferences.addPreferenceChangeListener(this);
this.enabled = preferences.getBoolean(TOGGLE_HIGHLIGHT_PREFERENCE, true);
this.sourceViewer = (ISourceViewer) viewer;
this.sourceViewer.getTextWidget().addCaretListener(this);
}
use of org.eclipse.core.runtime.preferences.IEclipsePreferences in project eclipse.platform.text by eclipse.
the class DefaultWordHighlightStrategy method install.
public void install(ITextViewer viewer) {
if (!(viewer instanceof ISourceViewer)) {
return;
}
IEclipsePreferences preferences = InstanceScope.INSTANCE.getNode(GenericEditorPlugin.BUNDLE_ID);
preferences.addPreferenceChangeListener(this);
this.enabled = preferences.getBoolean(ToggleHighlight.TOGGLE_HIGHLIGHT_PREFERENCE, true);
this.sourceViewer = (ISourceViewer) viewer;
this.sourceViewer.getTextWidget().addCaretListener(this);
}
use of org.eclipse.core.runtime.preferences.IEclipsePreferences in project xtext-xtend by eclipse.
the class AbstractProfileManager method writeToPreferenceStore.
/**
* 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());
}
}
Aggregations