private static void initializeTextEditiongPreferences(final IPreferenceStore store) { // // set the default values from ExtendedTextEditor // // store.setValue(AbstractDecoratedTextEditorPreferenceConstants.USE_QUICK_DIFF_PREFERENCE_PAGE, // true); final DefaultScope scope = new DefaultScope(); final IEclipsePreferences prefs = scope.getNode(StatetUIPlugin.PLUGIN_ID); final ThemeUtil theme = new ThemeUtil(); // EditorPreferences prefs.putBoolean(DecorationPreferences.MATCHING_BRACKET_ENABLED_KEY, true); prefs.put( DecorationPreferences.MATCHING_BRACKET_COLOR_KEY, theme.getColorPrefValue(IWaThemeConstants.MATCHING_BRACKET_COLOR)); { final IEclipsePreferences node = scope.getNode(IStatetUIPreferenceConstants.CAT_EDITOR_OPTIONS_QUALIFIER); final AssistPreferences assistPrefs = IStatetUIPreferenceConstants.EDITING_ASSIST_PREFERENCES; PreferencesUtil.setPrefValue(scope, assistPrefs.getAutoActivationEnabledPref(), Boolean.TRUE); PreferencesUtil.setPrefValue(scope, assistPrefs.getAutoActivationDelayPref(), 200); PreferencesUtil.setPrefValue(scope, assistPrefs.getAutoInsertSinglePref(), Boolean.FALSE); PreferencesUtil.setPrefValue(scope, assistPrefs.getAutoInsertPrefixPref(), Boolean.FALSE); node.put( "Parameters.background", theme.getColorPrefValue(IWaThemeConstants.INFORMATION_BACKGROUND_COLOR)); // $NON-NLS-1$ node.put( "Parameters.foreground", theme.getColorPrefValue(IWaThemeConstants.INFORMATION_COLOR)); // $NON-NLS-1$ } // store.setDefault(EDITOROUTLINE_SORT, false); // store.setDefault(EDITOROUTLINE_LINKWITHEDITOR, true); }
private void savePrefs(final SelectedRepos repos) { if (fREnv.getConfig() == null) { return; } final IScopeContext prefs = InstanceScope.INSTANCE; final IEclipsePreferences node = prefs.getNode(fSelectedReposPref.getQualifier()); PreferencesUtil.setPrefValue(node, fSelectedReposPref, repos.getRepos()); PreferencesUtil.setPrefValue(node, fSelectedCRANPref, repos.getCRANMirror()); PreferencesUtil.setPrefValue(node, fBioCVersionPref, repos.getBioCVersion()); PreferencesUtil.setPrefValue(node, fSelectedBioCPref, repos.getBioCMirror()); if (repos.getCRANMirror() != null) { PreferencesUtil.setPrefValue(prefs, LAST_CRAN_PREF, repos.getCRANMirror()); } if (repos.getBioCMirror() != null) { PreferencesUtil.setPrefValue(prefs, LAST_BIOC_PREF, repos.getBioCMirror()); } try { node.flush(); } catch (final BackingStoreException e) { RCorePlugin.log( new Status( IStatus.ERROR, RCore.PLUGIN_ID, "An error occurred when saving the R package manager preferences.", e)); } }