org.eclipse.core.runtime.preferences.IEclipsePreferences.PreferenceChangeEvent Java Examples
The following examples show how to use
org.eclipse.core.runtime.preferences.IEclipsePreferences.PreferenceChangeEvent.
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: ConsoleThemer.java From APICloud-Studio with GNU General Public License v3.0 | 6 votes |
/** * listenForThemeChanges */ private void listenForThemeChanges() { this.fThemeChangeListener = new IPreferenceChangeListener() { public void preferenceChange(PreferenceChangeEvent event) { if (event.getKey().equals(IThemeManager.THEME_CHANGED)) { applyTheme(); } } }; EclipseUtil.instanceScope().getNode(ThemePlugin.PLUGIN_ID).addPreferenceChangeListener(this.fThemeChangeListener); }
Example #2
Source File: CommonContentAssistProcessor.java From APICloud-Studio with GNU General Public License v3.0 | 6 votes |
/** * Respond to preference change events */ public void preferenceChange(PreferenceChangeEvent event) { String key = event.getKey(); if (IPreferenceConstants.COMPLETION_PROPOSAL_ACTIVATION_CHARACTERS.equals(key)) { _completionProposalChars = retrieveCAPreference(IPreferenceConstants.COMPLETION_PROPOSAL_ACTIVATION_CHARACTERS); } else if (IPreferenceConstants.CONTEXT_INFORMATION_ACTIVATION_CHARACTERS.equals(key)) { _contextInformationChars = retrieveCAPreference(IPreferenceConstants.CONTEXT_INFORMATION_ACTIVATION_CHARACTERS); } else if (IPreferenceConstants.PROPOSAL_TRIGGER_CHARACTERS.equals(key)) { _proposalTriggerChars = retrieveCAPreference(IPreferenceConstants.PROPOSAL_TRIGGER_CHARACTERS); } }
Example #3
Source File: IDETypeScriptProjectSettings.java From typescript.java with MIT License | 6 votes |
private boolean isFormatPreferencesChanged(PreferenceChangeEvent event) { return TypeScriptCorePreferenceConstants.EDITOR_OPTIONS_CONVERT_TABS_TO_SPACES.equals(event.getKey()) || TypeScriptCorePreferenceConstants.EDITOR_OPTIONS_INDENT_SIZE.equals(event.getKey()) || TypeScriptCorePreferenceConstants.EDITOR_OPTIONS_TAB_SIZE.equals(event.getKey()) || TypeScriptCorePreferenceConstants.FORMAT_OPTIONS_INSERT_SPACE_AFTER_COMMA_DELIMITER .equals(event.getKey()) || TypeScriptCorePreferenceConstants.FORMAT_OPTIONS_INSERT_SPACE_AFTER_SEMICOLON_IN_FOR_STATEMENTS .equals(event.getKey()) || TypeScriptCorePreferenceConstants.FORMAT_OPTIONS_INSERT_SPACE_BEFORE_AND_AFTER_BINARY_OPERATORS .equals(event.getKey()) || TypeScriptCorePreferenceConstants.FORMAT_OPTIONS_INSERT_SPACE_AFTER_KEYWORDS_IN_CONTROL_FLOW_STATEMENTS .equals(event.getKey()) || TypeScriptCorePreferenceConstants.FORMAT_OPTIONS_INSERT_SPACE_AFTER_FUNCTION_KEYWORD_FOR_ANONYMOUS_FUNCTIONS .equals(event.getKey()) || TypeScriptCorePreferenceConstants.FORMAT_OPTIONS_INSERT_SPACE_AFTER_OPENING_AND_BEFORE_CLOSING_NONEMPTY_PARENTHESIS .equals(event.getKey()) || TypeScriptCorePreferenceConstants.FORMAT_OPTIONS_INSERT_SPACE_AFTER_OPENING_AND_BEFORE_CLOSING_NONEMPTY_BRACKETS .equals(event.getKey()) || TypeScriptCorePreferenceConstants.FORMAT_OPTIONS_PLACE_OPEN_BRACE_ON_NEW_LINE_FOR_FUNCTIONS .equals(event.getKey()) || TypeScriptCorePreferenceConstants.FORMAT_OPTIONS_PLACE_OPEN_BRACE_ON_NEW_LINE_FOR_CONTROL_BLOCKS .equals(event.getKey()); }
Example #4
Source File: InvasiveThemeHijacker.java From APICloud-Studio with GNU General Public License v3.0 | 5 votes |
public void preferenceChange(PreferenceChangeEvent event) { // If invasive themes are on and we changed the theme, schedule. Also schedule if we toggled invasive theming. if (event.getKey().equals(IPreferenceConstants.APPLY_TO_ALL_VIEWS) || event.getKey().equals(IPreferenceConstants.APPLY_TO_ALL_EDITORS) || (event.getKey().equals(IThemeManager.THEME_CHANGED) && applyToViews())) { cancel(); schedule(); } }
Example #5
Source File: TMPresentationReconciler.java From tm4e with Eclipse Public License 1.0 | 5 votes |
@Override public void preferenceChange(PreferenceChangeEvent event) { IThemeManager themeManager = TMUIPlugin.getThemeManager(); if (PreferenceConstants.E4_THEME_ID.equals(event.getKey())) { preferenceThemeChange((String) event.getNewValue(), themeManager); } else if (PreferenceConstants.THEME_ASSOCIATIONS.equals(event.getKey())) { preferenceThemeChange(PreferenceUtils.getE4PreferenceCSSThemeId(), themeManager); } }
Example #6
Source File: ControlThemer.java From APICloud-Studio with GNU General Public License v3.0 | 5 votes |
private void addThemeChangeListener() { // TODO Just use one global listener that updates all instances? fThemeChangeListener = new IPreferenceChangeListener() { public void preferenceChange(PreferenceChangeEvent event) { if (event.getKey().equals(IThemeManager.THEME_CHANGED)) { applyTheme(); } else if (event.getKey().equals(IPreferenceConstants.INVASIVE_FONT)) { // Handle the invasive font setting change if (Boolean.parseBoolean((String) event.getNewValue())) { applyControlFont(); } else { unapplyControlFont(); } } else if (event.getKey().equals(IPreferenceConstants.APPLY_TO_ALL_VIEWS)) { if (Boolean.parseBoolean((String) event.getNewValue())) { applyTheme(); } else { unapplyTheme(); } } } }; EclipseUtil.instanceScope().getNode(ThemePlugin.PLUGIN_ID).addPreferenceChangeListener(fThemeChangeListener); }
Example #7
Source File: CorePlugin.java From APICloud-Studio with GNU General Public License v3.0 | 5 votes |
/** * Respond to a preference change event */ public void preferenceChange(PreferenceChangeEvent event) { if (ICorePreferenceConstants.PREF_DEBUG_LEVEL.equals(event.getKey())) { IdeLog.setCurrentSeverity(IdeLog.getSeverityPreference()); } }
Example #8
Source File: NodeModuleResolver.java From APICloud-Studio with GNU General Public License v3.0 | 5 votes |
protected synchronized IPath nodeSrcPath() { // Cache value and hook pref listener if (fNodeSrcPathListener == null) { fNodeSrcPathListener = new IEclipsePreferences.IPreferenceChangeListener() { public void preferenceChange(PreferenceChangeEvent event) { if (IPreferenceConstants.NODEJS_SOURCE_PATH.equals(event.getKey())) { String value = (String) event.getNewValue(); if (StringUtil.isEmpty(value)) { fNodeSrcPath = null; } else { fNodeSrcPath = Path.fromOSString(value); } } } }; EclipseUtil.instanceScope().getNode(JSCorePlugin.PLUGIN_ID) .addPreferenceChangeListener(fNodeSrcPathListener); String value = Platform.getPreferencesService().getString(JSCorePlugin.PLUGIN_ID, IPreferenceConstants.NODEJS_SOURCE_PATH, null, null); if (StringUtil.isEmpty(value)) { fNodeSrcPath = null; } else { fNodeSrcPath = Path.fromOSString(value); } } return fNodeSrcPath; }
Example #9
Source File: UIPlugin.java From APICloud-Studio with GNU General Public License v3.0 | 5 votes |
@SuppressWarnings("restriction") public void preferenceChange(PreferenceChangeEvent event) { if (ResourcesPlugin.PREF_AUTO_BUILDING.equals(event.getKey())) { if ((Boolean.FALSE.toString().equals(event.getNewValue()))) { // APSTUD-4350 - We make sure that the preference change was done through the ToggleAutoBuildAction // (e.g. the menu action), or though the Workspace preference page. Any other trigger for that // preference change will not show the dialog. String buildToggleActionClassName = org.eclipse.ui.internal.ide.actions.ToggleAutoBuildAction.class .getCanonicalName(); String workspacePreferencePage = org.eclipse.ui.internal.ide.dialogs.IDEWorkspacePreferencePage.class .getCanonicalName(); StackTraceElement[] stackTrace = new Exception().getStackTrace(); for (StackTraceElement element : stackTrace) { String className = element.getClassName(); if (className.equals(buildToggleActionClassName) || className.equals(workspacePreferencePage)) { MessageDialog.openWarning(UIUtils.getActiveShell(), Messages.UIPlugin_automaticBuildsWarningTitle, Messages.UIPlugin_automaticBuildsWarningMessage); } } } } }
Example #10
Source File: HTMLOutlineContentProvider.java From APICloud-Studio with GNU General Public License v3.0 | 5 votes |
public void preferenceChange(PreferenceChangeEvent event) { if (IPreferenceConstants.HTML_OUTLINE_SHOW_TEXT_NODES.equals(event.getKey())) { showTextNode = HTMLPreferenceUtil.getShowTextNodesInOutline(); } }
Example #11
Source File: HTMLEditor.java From APICloud-Studio with GNU General Public License v3.0 | 5 votes |
public void preferenceChange(PreferenceChangeEvent event) { if (IPreferenceConstants.HTML_OUTLINE_TAG_ATTRIBUTES_TO_SHOW.equals(event.getKey())) { getOutlinePage().refresh(); } }
Example #12
Source File: CommonTextHover.java From APICloud-Studio with GNU General Public License v3.0 | 5 votes |
public void preferenceChange(PreferenceChangeEvent event) { if (event.getKey().equals(IThemeManager.THEME_CHANGED)) { getThemeColors(); } }
Example #13
Source File: CommonProjectionViewer.java From APICloud-Studio with GNU General Public License v3.0 | 5 votes |
public void preferenceChange(PreferenceChangeEvent event) { if (IPreferenceConstants.CONTENT_ASSIST_DELAY.equals(event.getKey())) { setSnippetProcessorEnablement(); } }
Example #14
Source File: AllCleanUpsAction.java From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 | 5 votes |
private void installPreferenceListener() { fPreferenceChangeListener= new IPreferenceChangeListener() { public void preferenceChange(PreferenceChangeEvent event) { if (event.getKey().equals(CleanUpConstants.SHOW_CLEAN_UP_WIZARD)) { updateActionLabel(); } } }; InstanceScope.INSTANCE.getNode(JavaUI.ID_PLUGIN).addPreferenceChangeListener(fPreferenceChangeListener); }
Example #15
Source File: ConsoleColorCache.java From Pydev with Eclipse Public License 1.0 | 5 votes |
@Override public void preferenceChange(PreferenceChangeEvent event) { String key = event.getKey(); if ("org.eclipse.debug.ui.consoleBackground".equals(key) || "org.eclipse.debug.ui.outColor".equals(key) || "org.eclipse.debug.ui.errorColor".equals(key)) { synchronized (referencesLock) { ArrayList<IOConsole> currentRefs = getCurrentRefs(); for (IOConsole console : currentRefs) { updateConsole(console); } } } }
Example #16
Source File: FileTypesPreferences.java From Pydev with Eclipse Public License 1.0 | 5 votes |
@Override public void preferenceChange(PreferenceChangeEvent event) { this.wildcaldValidSourceFiles = null; this.dottedValidSourceFiles = null; this.pythondValidSourceFiles = null; this.pythonValidInitFiles = null; }
Example #17
Source File: TextStylingPreference.java From goclipse with Eclipse Public License 1.0 | 5 votes |
@Override protected void handlePreferenceChange(PreferenceChangeEvent event) { String changedKey = event.getKey(); String baseKey = key; if(changedKey.startsWith(baseKey)) { String suffix = changedKey.substring(baseKey.length()); if(suffix.isEmpty() || suffixes.contains(suffix)) { field.setFieldValue(get()); } } }
Example #18
Source File: RendererPreferences.java From depan with Apache License 2.0 | 5 votes |
@Override public void preferenceChange(PreferenceChangeEvent event) { // changes in the configuration for the views, so redraw the graph. if (event.getKey().startsWith(LabelPreferencesIds.LABEL_PREFIX)) { setLabelPreferences(); } if (event.getKey().startsWith(ColorPreferencesIds.COLORS_PREFIX)) { setColorsPreferences(); } if (event.getKey().startsWith(NodePreferencesIds.NODE_PREFIX)) { setNodePreferences(); } }
Example #19
Source File: PreferencesHelper.java From typescript.java with MIT License | 5 votes |
public void preferenceChange(PreferenceChangeEvent event) { if (TypeScriptCorePreferenceConstants.USE_SALSA_AS_JS_INFERENCE.equals(event.getKey())) { try { useSalsa = UseSalsa.valueOf(event.getNewValue().toString()); } catch (Throwable e) { } } }
Example #20
Source File: ConfigPropertyWidgetMultiCheck.java From eclipse-cs with GNU Lesser General Public License v2.1 | 5 votes |
@Override public void preferenceChange(PreferenceChangeEvent event) { if (CheckstyleUIPluginPrefs.PREF_TRANSLATE_TOKENS.equals(event.getKey())) { mTranslateTokens = Boolean.valueOf((String) event.getNewValue()).booleanValue(); mTable.refresh(true); } if (CheckstyleUIPluginPrefs.PREF_SORT_TOKENS.equals(event.getKey())) { mSortTokens = Boolean.valueOf((String) event.getNewValue()).booleanValue(); installSorter(mSortTokens); } }
Example #21
Source File: IDETypeScriptProjectSettings.java From typescript.java with MIT License | 5 votes |
private boolean isTslintPreferencesChanged(PreferenceChangeEvent event) { return TypeScriptCorePreferenceConstants.TSLINT_STRATEGY.equals(event.getKey()) || TypeScriptCorePreferenceConstants.TSLINT_USE_CUSTOM_TSLINTJSON_FILE.equals(event.getKey()) || TypeScriptCorePreferenceConstants.TSLINT_USE_EMBEDDED_TYPESCRIPT.equals(event.getKey()) || TypeScriptCorePreferenceConstants.TSLINT_EMBEDDED_TYPESCRIPT_ID.equals(event.getKey()) || TypeScriptCorePreferenceConstants.TSLINT_INSTALLED_TYPESCRIPT_PATH.equals(event.getKey()); }
Example #22
Source File: IDETypeScriptProjectSettings.java From typescript.java with MIT License | 5 votes |
private boolean isTypeScriptRuntimePreferencesChanged(PreferenceChangeEvent event) { return TypeScriptCorePreferenceConstants.USE_EMBEDDED_TYPESCRIPT.equals(event.getKey()) || TypeScriptCorePreferenceConstants.EMBEDDED_TYPESCRIPT_ID.equals(event.getKey()) || TypeScriptCorePreferenceConstants.INSTALLED_TYPESCRIPT_PATH.equals(event.getKey()) || TypeScriptCorePreferenceConstants.TSSERVER_TRACE_ON_CONSOLE.equals(event.getKey()) || TypeScriptCorePreferenceConstants.TSSERVER_EMULATE_PLUGINS.equals(event.getKey()); }
Example #23
Source File: PreferenceRecorder.java From workspacemechanic with Eclipse Public License 1.0 | 5 votes |
public void preferenceChange(PreferenceChangeEvent event) { synchronized (lock) { if (currState != State.RECORDING) { return; } changeLog.add(new PreferenceChanged(new Path(event.getNode().absolutePath()), event.getKey(), (String) event.getNewValue())); } }
Example #24
Source File: FixedScopedPreferenceStore.java From xtext-eclipse with Eclipse Public License 2.0 | 5 votes |
/** * Initialize the preferences listener. */ private void initializePreferencesListener() { if (preferencesListener == null) { preferencesListener = new IEclipsePreferences.IPreferenceChangeListener() { /* * (non-Javadoc) * * @see org.eclipse.core.runtime.preferences.IEclipsePreferences.IPreferenceChangeListener#preferenceChange(org.eclipse.core.runtime.preferences.IEclipsePreferences.PreferenceChangeEvent) */ @Override public void preferenceChange(PreferenceChangeEvent event) { if (silentRunning) { return; } Object oldValue = event.getOldValue(); Object newValue = event.getNewValue(); String key = event.getKey(); if (newValue == null) { newValue = getDefault(key, oldValue); } else if (oldValue == null) { oldValue = getDefault(key, newValue); } firePropertyChangeEvent(event.getKey(), oldValue, newValue); } }; getStorePreferences().addPreferenceChangeListener( preferencesListener); } }
Example #25
Source File: ToggleMarkOccurrencesHandler.java From xds-ide with Eclipse Public License 1.0 | 5 votes |
@Override public void preferenceChange(PreferenceChangeEvent event) { if (isExecuting) return; if (PreferenceKeys.PKEY_HIGHLIGHT_OCCURENCES.getKey().equals(event.getKey())) { isTurnedOn = PreferenceKeys.PKEY_HIGHLIGHT_OCCURENCES.getStoredBoolean(); setToggleState(isTurnedOn); } }
Example #26
Source File: SourceCodeTextEditor.java From xds-ide with Eclipse Public License 1.0 | 5 votes |
public SourceCodeTextEditor() { super(); rulerPainters = LineNumberColumnPainterRegistry.get().contributions(); corePluginPreferenceListener = new IPreferenceChangeListener() { @Override public void preferenceChange(PreferenceChangeEvent event) { String key = event.getKey(); if (PreferenceKeys.PKEY_EXECUTABLE_SOURCE_CODE_COLOR.getKey().equals(key)) { fLineNumberRulerColumn.redraw(); } } }; PreferenceKeys.addChangeListener(corePluginPreferenceListener); }
Example #27
Source File: SpellCheckEngine.java From xds-ide with Eclipse Public License 1.0 | 5 votes |
@Override public void preferenceChange(PreferenceChangeEvent event) { String key = event.getKey(); if (key.equals(PreferenceKeys.PKEY_SPELLING_LOCALE.getKey())) { resetSpellChecker(); return; } if (key.equals( PreferenceKeys.PKEY_SPELLING_USER_DICTIONARY.getKey()) || key.equals(PreferenceKeys.PKEY_SPELLING_USER_DICTIONARY_ENCODING.getKey())) { resetUserDictionary(); return; } }
Example #28
Source File: PreferenceHelper.java From goclipse with Eclipse Public License 1.0 | 4 votes |
protected void handlePreferenceChange(PreferenceChangeEvent event) { if(event.getKey().equals(key)) { updateFieldFromPrefStore(); } }
Example #29
Source File: ThemeManager.java From APICloud-Studio with GNU General Public License v3.0 | 4 votes |
private ThemeManager() { EclipseUtil.instanceScope().getNode("org.eclipse.ui.editors").addPreferenceChangeListener( //$NON-NLS-1$ new IPreferenceChangeListener() { public void preferenceChange(PreferenceChangeEvent event) { // Listen to see if the user is modifying the annotations through Annotations pref page for (String prefix : annotationKeyPrefixes) { if (event.getKey().startsWith(prefix)) { final String scopeSelector = "override." + prefix; //$NON-NLS-1$ // If it's color and getting set to null, then it probably means that user // chose to restore defaults. Does that mean we should remove override? if (event.getNewValue() == null && event.getKey().endsWith("Color")) //$NON-NLS-1$ { // Do we need to run this in a delayed job to avoid clashes when the other pref // changes come through at same time...? Job job = new UIJob("Restoring overrides of Annotation") //$NON-NLS-1$ { @Override public IStatus runInUIThread(IProgressMonitor monitor) { ThemeRule rule = getCurrentTheme().getRuleForSelector( new ScopeSelector(scopeSelector)); if (rule != null) { getCurrentTheme().remove(rule); } return Status.OK_STATUS; } }; EclipseUtil.setSystemForJob(job); job.setPriority(Job.DECORATE); job.schedule(); } else { if (!getCurrentTheme().hasEntry(scopeSelector)) { // Store that the user has overridden this annotation in this theme int index = getCurrentTheme().getTokens().size(); getCurrentTheme().addNewRule(index, "Annotation Override - " + prefix, //$NON-NLS-1$ new ScopeSelector(scopeSelector), null); } } break; } } } }); }
Example #30
Source File: DebugEarlyStartup.java From Pydev with Eclipse Public License 1.0 | 4 votes |
@Override public void earlyStartup() { //Note: preferences are in the PydevPlugin, not in the debug plugin. IEclipsePreferences preferenceStore = PydevPrefs.getEclipsePreferences(); preferenceStore.addPreferenceChangeListener(new IPreferenceChangeListener() { @Override public void preferenceChange(PreferenceChangeEvent event) { if (DebugPluginPrefsInitializer.DEBUG_SERVER_STARTUP.equals(event.getKey())) { //On a change in the preferences, re-check if it should be always on... checkAlwaysOnJob.schedule(200); } } }); RemoteDebuggerServer.getInstance().addListener(new IRemoteDebuggerListener() { @Override public void stopped(RemoteDebuggerServer remoteDebuggerServer) { //When it stops, re-check if it should be always on. checkAlwaysOnJob.schedule(200); } }); checkAlwaysOnJob.schedule(500); //wait a little bit more to enable on startup. DebugPlugin.getDefault().addDebugEventListener(new IDebugEventSetListener() { @Override public void handleDebugEvents(DebugEvent[] events) { if (events != null) { for (DebugEvent debugEvent : events) { if (debugEvent.getKind() == DebugEvent.SUSPEND) { if (debugEvent.getDetail() == DebugEvent.BREAKPOINT) { if (debugEvent.getSource() instanceof PyThread) { IPreferenceStore preferenceStore2 = PyDevUiPrefs.getPreferenceStore(); final int forceOption = preferenceStore2 .getInt(DebugPluginPrefsInitializer.FORCE_SHOW_SHELL_ON_BREAKPOINT); if (forceOption != DebugPluginPrefsInitializer.FORCE_SHOW_SHELL_ON_BREAKPOINT_MAKE_NOTHING) { Runnable r = new Runnable() { @Override public void run() { Shell activeShell = UIUtils.getActiveShell(); if (activeShell != null) { forceActive(activeShell, forceOption); } } }; boolean runNowIfInUiThread = true; RunInUiThread.async(r, runNowIfInUiThread); } } } } } } } }); }