public IInformationControlCreatorProvider getHoverInfo(final EObject object, final ITextViewer viewer, final IRegion region) { boolean showHover = true; try { IEclipsePreferences defaultNode = DefaultScope.INSTANCE.getNode("org.bbaw.bts.ui.corpus.egy"); IEclipsePreferences instanceNode = InstanceScope.INSTANCE.getNode("org.bbaw.bts.ui.corpus.egy"); showHover = instanceNode.getBoolean(BTSEGYUIConstants.PREF_TRANSLITERATION_EDITOR_ACTIVATE_HOVER_INFO, defaultNode.getBoolean(BTSEGYUIConstants.PREF_TRANSLITERATION_EDITOR_ACTIVATE_HOVER_INFO, true)); } catch (Exception e) { } if (showHover) { return super.getHoverInfo(object, viewer, region); } return null; }
/** * Initialize the preference page. */ public void init(IWorkbench workbench) { // BundleContext bundleContext = Platform.getBundle("org.bbaw.bts.ui.main").getBundleContext(); context = StaticAccessController.getContext(); corpusController = context.get(CorpusNavigatorController.class); prefs = ConfigurationScope.INSTANCE.getNode("org.bbaw.bts.app"); IEclipsePreferences defaultpref = DefaultScope.INSTANCE.getNode("org.bbaw.bts.app"); main_corpus_key = prefs.get(BTSPluginIDs.PREF_MAIN_CORPUS_KEY, defaultpref.get(BTSPluginIDs.PREF_MAIN_CORPUS_KEY, null)); active_corpora = prefs.get(BTSPluginIDs.PREF_ACTIVE_CORPORA, defaultpref.get(BTSPluginIDs.PREF_ACTIVE_CORPORA, null)); logger = context.get(Logger.class); loadListInput(); activate = prefs.getBoolean(BTSPluginIDs.PREF_CORPUS_ACTIVATE_MAIN_CORPUS_SELECTION, false); initialActivate = new Boolean(activate); mainCorpusComboViewer.getCombo().setEnabled(activate); activateButton.setSelection(activate); }
/** * Retrieves the default doxygen instance to use. */ public static Doxygen getDefault() { Doxygen doxygen = null; // get the actual default preference store //final String identifier = Plugin.getDefault().getPluginPreferences().getString( IPreferences.DEFAULT_DOXYGEN ); IPreferencesService service = Platform.getPreferencesService(); final String PLUGIN_ID = Plugin.getDefault().getBundle().getSymbolicName(); IEclipsePreferences defaultNode = DefaultScope.INSTANCE.getNode(PLUGIN_ID); IEclipsePreferences instanceNode = InstanceScope.INSTANCE.getNode(PLUGIN_ID); IEclipsePreferences[] nodes = new IEclipsePreferences[] { instanceNode, defaultNode }; final String identifier = service.get(IPreferences.DEFAULT_DOXYGEN, "", nodes); List<Class<? extends Doxygen>> doxygenClassList = new ArrayList<Class<? extends Doxygen>>(); doxygenClassList.add(DefaultDoxygen.class); doxygenClassList.add(CustomDoxygen.class); doxygenClassList.add(BundledDoxygen.class); for (Class<? extends Doxygen> doxygenClass : doxygenClassList) { doxygen = getFromClassAndIdentifier(doxygenClass, identifier); if (doxygen != null) break; } return doxygen; }
/** {@inheritDoc} */ @Override public void start(BundleContext context) throws Exception { super.start(context); if (SingleSourcePlugin.getUIHelper().getUI() == UI.RAP) { // Is this necessary? // RAPCorePlugin adds the "server" scope for all plugins, // but starts too late... Platform.getPreferencesService().setDefaultLookupOrder( PLUGIN_ID, null, new String[] { InstanceScope.SCOPE, ConfigurationScope.SCOPE, "server", DefaultScope.SCOPE }); } plugin = this; }
/** * Sets the default values for all the preferences the plug-in uses. */ /* Override */ public void initializeDefaultPreferences() { ZDebug.print( 4, "initializeDefaultPreferences()" ); IEclipsePreferences node = new DefaultScope().getNode( Ids.PLUGIN ); for( Preference pref : EnumSet.allOf( Preference.class ) ) { ZDebug.print( 6, "Setting default for: ", pref, " = ", pref.getDefault() ); switch( pref.getFormat() ) { case INT: case POSITIVE_INT: case MILISECONDS: { node.putInt( pref.getKey(), (Integer) pref.getDefault() ); break; } case STRING: default: { node.put( pref.getKey(), pref.getDefault().toString() ); } } } }
protected IScopeContext[] createPreferenceScopes( NestedValidatorContext context) { if (context != null) { final IProject project = context.getProject(); if (project != null && project.isAccessible()) { final ProjectScope projectScope = new ProjectScope(project); if (projectScope.getNode( JSONCorePlugin.getDefault().getBundle() .getSymbolicName()).getBoolean( JSONCorePreferenceNames.USE_PROJECT_SETTINGS, false)) return new IScopeContext[] { projectScope, new InstanceScope(), new DefaultScope() }; } } return new IScopeContext[] { new InstanceScope(), new DefaultScope() }; }
private Map<String, String> loadDefaultSettings() { Map<String, String> settings = new HashMap<String, String>(); PreferenceKey[] keys = getPreferenceKeys(); if (keys != null) { DefaultScope scope = EclipseUtil.defaultScope(); for (PreferenceKey key : keys) { String name = key.getName(); IEclipsePreferences preferences = scope.getNode(key.getQualifier()); String value = preferences.get(name, null); if (value != null) settings.put(name, value); } } return settings; }
@Override protected String getSelectedProfileId(IScopeContext instanceScope) { String profileId= instanceScope.getNode(JavaUI.ID_PLUGIN).get(PROFILE_KEY, null); if (profileId == null) { // request from bug 129427 profileId= DefaultScope.INSTANCE.getNode(JavaUI.ID_PLUGIN).get(PROFILE_KEY, null); // fix for bug 89739 if (DEFAULT_PROFILE.equals(profileId)) { // default default: IEclipsePreferences node= instanceScope.getNode(JavaCore.PLUGIN_ID); if (node != null) { String tabSetting= node.get(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, null); if (JavaCore.SPACE.equals(tabSetting)) { profileId= JAVA_PROFILE; } } } } return profileId; }
/** * {@inheritDoc} */ @Override public void performDefaults() { super.performDefaults(); if (fCurrContext == null) return; fCurrContext.getNode(JavaUI.ID_PLUGIN).remove(CleanUpConstants.SHOW_CLEAN_UP_WIZARD); boolean showWizard= DefaultScope.INSTANCE.getNode(JavaUI.ID_PLUGIN).getBoolean(CleanUpConstants.SHOW_CLEAN_UP_WIZARD, true); fShowCleanUpWizardDialogField.setDialogFieldListener(null); fShowCleanUpWizardDialogField.setSelection(showWizard); fShowCleanUpWizardDialogField.setDialogFieldListener(new IDialogFieldListener() { public void dialogFieldChanged(DialogField field) { doShowCleanUpWizard(fShowCleanUpWizardDialogField.isSelected()); } }); }
public static String getPreference(String name, String defaultValue, IProject project) { IEclipsePreferences[] preferencesLookup; if (project != null) { preferencesLookup = new IEclipsePreferences[] { new ProjectScope(project).getNode(PLUGIN_ID), InstanceScope.INSTANCE.getNode(PLUGIN_ID), DefaultScope.INSTANCE.getNode(PLUGIN_ID) }; } else { preferencesLookup = new IEclipsePreferences[] { InstanceScope.INSTANCE.getNode(PLUGIN_ID), DefaultScope.INSTANCE.getNode(PLUGIN_ID) }; } IPreferencesService service = Platform.getPreferencesService(); String value = service.get(name, defaultValue, preferencesLookup); return value; }
@Override public void initializeDefaultPreferences() { IEclipsePreferences preferences = DefaultScope.INSTANCE.getNode(ParichayanaActivator.PLUGIN_ID); preferences.putBoolean(Constants.ENABLE_PARICHAYANA, true); preferences.put(Constants.TEST_PSTE, JavaCore.WARNING); preferences.put(Constants.TEST_LGTE, JavaCore.WARNING); preferences.put(Constants.TEST_LGRN, JavaCore.WARNING); preferences.put(Constants.TEST_PSRN, JavaCore.WARNING); preferences.put(Constants.TEST_MLLM, JavaCore.WARNING); preferences.put(Constants.TEST_RNHR, JavaCore.WARNING); preferences.put(Constants.TEST_THGE, JavaCore.WARNING); preferences.put(Constants.TEST_WEPG, JavaCore.WARNING); preferences.put(Constants.TEST_RRGC, JavaCore.WARNING); preferences.put(Constants.TEST_INEE, JavaCore.WARNING); preferences.put(Constants.TEST_LGFT, JavaCore.WARNING); preferences.put(Constants.TEST_CNPE, JavaCore.WARNING); preferences.put(Constants.TEST_TNPE, JavaCore.WARNING); preferences.put(Constants.TEST_CTGE, JavaCore.WARNING); preferences.put(Constants.INCLUDE_EXPRESSION, ""); preferences.put(Constants.EXCLUDE_EXPRESSION, ""); }
private boolean isSearchInAllCSSFiles(IProject project) { if (fPreferenceService == null) { fPreferenceService = Platform.getPreferencesService(); } IScopeContext[] fLookupOrder; ProjectScope projectScope = new ProjectScope(project); if (projectScope .getNode(getQualifier()) .getBoolean( WebResourcesCorePreferenceNames.CSS_USE_PROJECT_SETTINGS, false)) { fLookupOrder = new IScopeContext[] { projectScope, new InstanceScope(), new DefaultScope() }; } else { fLookupOrder = new IScopeContext[] { new InstanceScope(), new DefaultScope() }; } return fPreferenceService .getBoolean( getQualifier(), WebResourcesCorePreferenceNames.SEARCH_IN_ALL_CSS_FILES_IF_NO_LINKS, false, fLookupOrder); }
@Override public void initializeDefaultPreferences() { Preferences node = DefaultScope.INSTANCE.getNode(DEFAULT_SCOPE); for (int i = 0; i < AnalysisPreferences.completeSeverityMap.length; i++) { Object[] s = AnalysisPreferences.completeSeverityMap[i]; node.putInt((String) s[1], (Integer) s[2]); } node.put(NAMES_TO_IGNORE_UNUSED_VARIABLE, DEFAULT_NAMES_TO_IGNORE_UNUSED_VARIABLE); node.put(NAMES_TO_IGNORE_UNUSED_IMPORT, DEFAULT_NAMES_TO_IGNORE_UNUSED_IMPORT); node.put(NAMES_TO_CONSIDER_GLOBALS, DEFAULT_NAMES_TO_CONSIDER_GLOBALS); node.putBoolean(DO_CODE_ANALYSIS, DEFAULT_DO_CODE_ANALYSIS); node.putBoolean(DO_AUTO_IMPORT, DEFAULT_DO_AUT_IMPORT); node.putBoolean(DO_AUTO_IMPORT_ON_ORGANIZE_IMPORTS, DEFAULT_DO_AUTO_IMPORT_ON_ORGANIZE_IMPORTS); node.putBoolean(DO_IGNORE_IMPORTS_STARTING_WITH_UNDER, DEFAULT_DO_IGNORE_FIELDS_WITH_UNDER); //pep8 related. node.putBoolean(AnalysisPreferencesPage.USE_PEP8_CONSOLE, AnalysisPreferencesPage.DEFAULT_USE_PEP8_CONSOLE); node.putBoolean(AnalysisPreferencesPage.PEP8_USE_SYSTEM, AnalysisPreferencesPage.DEFAULT_PEP8_USE_SYSTEM); }
@Override public void initializeDefaultPreferences() { Preferences node = DefaultScope.INSTANCE.getNode(PydevPlugin.DEFAULT_PYDEV_SCOPE); node.put(PyLintPrefPage.PYLINT_FILE_LOCATION, ""); node.putBoolean(PyLintPrefPage.USE_PYLINT, PyLintPrefPage.DEFAULT_USE_PYLINT); node.putInt(PyLintPrefPage.SEVERITY_ERRORS, PyLintPrefPage.DEFAULT_SEVERITY_ERRORS); node.putInt(PyLintPrefPage.SEVERITY_WARNINGS, PyLintPrefPage.DEFAULT_SEVERITY_WARNINGS); node.putInt(PyLintPrefPage.SEVERITY_FATAL, PyLintPrefPage.DEFAULT_SEVERITY_FATAL); node.putInt(PyLintPrefPage.SEVERITY_CODING_STANDARD, PyLintPrefPage.DEFAULT_SEVERITY_CODING_STANDARD); node.putInt(PyLintPrefPage.SEVERITY_REFACTOR, PyLintPrefPage.DEFAULT_SEVERITY_REFACTOR); node.putBoolean(PyLintPrefPage.USE_CONSOLE, PyLintPrefPage.DEFAULT_USE_CONSOLE); node.put(PyLintPrefPage.PYLINT_ARGS, PyLintPrefPage.DEFAULT_PYLINT_ARGS); }
/** * Initializes the given preference store with the default values. * * @param store * the preference store to be initialized */ public static void initializeDefaultValues() { IEclipsePreferences node = new DefaultScope().getNode(AngularCorePlugin.PLUGIN_ID); // directive syntax node.putBoolean(AngularCoreConstants.DIRECTIVE_STARTS_WITH_NOTHING, true); node.putBoolean(AngularCoreConstants.DIRECTIVE_MINUS_DELIMITER, true); // start/end symbols used in angular expression node.put(AngularCoreConstants.EXPRESSION_START_SYMBOL, AngularProject.DEFAULT_START_SYMBOL); node.put(AngularCoreConstants.EXPRESSION_END_SYMBOL, AngularProject.DEFAULT_END_SYMBOL); // Protractor node.put(AngularCoreConstants.PROTRACTOR_NODEJS_DEBUGGER, "ProgramNodejs"); // By default use the embedded Node.js install (if exists) if (!useBundledNodeJsInstall(node)) { // Use native node.js install in case there is no embedded install. node.put(AngularCoreConstants.PROTRACTOR_NODEJS_INSTALL, INodejsInstall.NODE_NATIVE); node.put(AngularCoreConstants.PROTRACTOR_NODEJS_PATH, IDENodejsProcessHelper.getNodejsPath()); } }
/** * @see org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer#initializeDefaultPreferences() */ @Override public void initializeDefaultPreferences() { final IEclipsePreferences lNode = DefaultScope.INSTANCE .getNode(RelationsConstants.PREFERENCE_NODE); lNode.put(RelationsConstants.KEY_DB_CATALOG, RelationsConstants.DFT_DB_EMBEDDED); lNode.put(RelationsConstants.KEY_DB_PLUGIN_ID, RelationsConstants.DFT_DBCONFIG_PLUGIN_ID); lNode.put(RelationsConstants.KEY_LANGUAGE_CONTENT, RelationsConstants.DFT_LANGUAGE); lNode.put(RelationsConstants.KEY_BIBLIO_SCHEMA, RelationsConstants.DFT_BIBLIO_SCHEMA_ID); lNode.put(RelationsConstants.KEY_PRINT_OUT_PLUGIN_ID, RelationsConstants.DFT_PRINT_OUT_PLUGIN_ID); lNode.putInt(RelationsConstants.KEY_TEXT_FONT_SIZE, RelationsConstants.DFT_TEXT_FONT_SIZE); lNode.putInt(RelationsConstants.KEY_MAX_SEARCH_HITS, RelationsConstants.DFT_MAX_SEARCH_HITS); lNode.putInt(RelationsConstants.KEY_MAX_LAST_CHANGED, RelationsConstants.DFT_MAX_LAST_CHANGED); }
@Override public void initializeDefaultPreferences(){ Preferences node = DefaultScope.INSTANCE.getNode(Activator.PLUGIN_ID); //$NON-NLS-1$ // default values node.putBoolean(PreferenceConstants.REPOSITORIES_VISIBLE, true); node.putBoolean(PreferenceConstants.SHOW_LATEST_VERSION_ONLY, true); node.putBoolean(PreferenceConstants.AVAILABLE_SHOW_ALL_BUNDLES, false); node.putBoolean(PreferenceConstants.INSTALLED_SHOW_ALL_BUNDLES, false); node.putBoolean(PreferenceConstants.AVAILABLE_GROUP_BY_CATEGORY, true); node.putBoolean(PreferenceConstants.SHOW_DRILLDOWN_REQUIREMENTS, false); node.putInt(PreferenceConstants.RESTART_POLICY, Policy.RESTART_POLICY_PROMPT_RESTART_OR_APPLY); node.putInt(PreferenceConstants.UPDATE_WIZARD_STYLE, Policy.UPDATE_STYLE_MULTIPLE_IUS); node.putBoolean(PreferenceConstants.FILTER_ON_ENV, true); node.putInt(PreferenceConstants.UPDATE_DETAILS_HEIGHT, SWT.DEFAULT); node.putInt(PreferenceConstants.UPDATE_DETAILS_WIDTH, SWT.DEFAULT); }
@Override public void initializeDefaultPreferences () { String defaultTimeZone = TimeZone.getDefault ().getID (); for ( final IConfigurationElement ele : Platform.getExtensionRegistry ().getConfigurationElementsFor ( EXTP_CFG_ID ) ) { if ( !Activator.TIME_ZONE_KEY.equals ( ele.getName () ) ) { continue; } defaultTimeZone = ele.getAttribute ( "id" ); //$NON-NLS-1$ } final Preferences node = DefaultScope.INSTANCE.getNode ( Activator.PLUGIN_ID ); node.put ( Activator.TIME_ZONE_KEY, defaultTimeZone ); }
@Override public void initializeDefaultPreferences() { IEclipsePreferences node = DefaultScope.INSTANCE.getNode("com.twinsoft.convertigo.studio"); node.put(ConvertigoPlugin.PREFERENCE_LOG_LEVEL, "3"); node.put(ConvertigoPlugin.PREFERENCE_OPENED_CONSOLES, ""); node.put(ConvertigoPlugin.PREFERENCE_TRACEPLAYER_PORT, "2323"); node.put(ConvertigoPlugin.PREFERENCE_TREE_HIGHLIGHT_DETECTED, "true"); node.put(ConvertigoPlugin.PREFERENCE_IGNORE_NEWS, "false"); node.put(ConvertigoPlugin.PREFERENCE_LOCAL_BUILD_FOLDER, SWT.getPlatform().startsWith("win") ? "C:\\TMP\\C8O_build" : "/tmp/C8O_build"); }
public OptionsConfigurationBlock(IStatusChangeListener context, IProject project, Key[] allKeys, IWorkbenchPreferenceContainer container) { fContext = context; fProject = project; fAllKeys = allKeys; fContainer = container; if (container == null) { fManager = new WorkingCopyManager(); } else { fManager = container.getWorkingCopyManager(); } if (fProject != null) { fLookupOrder = new IScopeContext[] { new ProjectScope(fProject), InstanceScope.INSTANCE, DefaultScope.INSTANCE }; } else { fLookupOrder = new IScopeContext[] { InstanceScope.INSTANCE, DefaultScope.INSTANCE }; } testIfOptionsComplete(allKeys); if (fProject == null || hasProjectSpecificOptions(fProject)) { fDisabledProjectSettings = null; } else { fDisabledProjectSettings = new IdentityHashMap(); for (int i = 0; i < allKeys.length; i++) { Key curr = allKeys[i]; fDisabledProjectSettings.put(curr, curr.getStoredValue(fLookupOrder, false, fManager)); } } settingsUpdated(); fCheckBoxes = new ArrayList(); fComboBoxes = new ArrayList(); fTextBoxes = new ArrayList(2); fLabels = new HashMap(); fExpandedComposites = new ArrayList(); fRebuildCount = getRebuildCount(); }
public TypeScriptMainPreferencePage() { super(GRID); IScopeContext scope = DefaultScope.INSTANCE; setPreferenceStore(new ScopedPreferenceStore(scope, TypeScriptCorePlugin.PLUGIN_ID)); // setDescription(Messages.js_debug_pref_page_desc); setImageDescriptor(TypeScriptUIImageResource.getImageDescriptor(TypeScriptUIImageResource.IMG_LOGO)); }
private static IPreferenceStore createProjectSpecificPreferenceStore(IProject project) { List<IPreferenceStore> stores = new ArrayList<IPreferenceStore>(); if (project != null) { stores.add(new EclipsePreferencesAdapter(new ProjectScope(project), TypeScriptUIPlugin.PLUGIN_ID)); stores.add(new EclipsePreferencesAdapter(new ProjectScope(project), TypeScriptCorePlugin.PLUGIN_ID)); } stores.add(new ScopedPreferenceStore(InstanceScope.INSTANCE, TypeScriptUIPlugin.PLUGIN_ID)); stores.add(new ScopedPreferenceStore(InstanceScope.INSTANCE, TypeScriptCorePlugin.PLUGIN_ID)); stores.add(new ScopedPreferenceStore(DefaultScope.INSTANCE, TypeScriptUIPlugin.PLUGIN_ID)); stores.add(new ScopedPreferenceStore(DefaultScope.INSTANCE, TypeScriptCorePlugin.PLUGIN_ID)); return new ChainedPreferenceStore(stores.toArray(new IPreferenceStore[stores.size()])); }
public InstallationWizard(IEclipseContext context, ApplicationStartupController startupController, UISynchronize sync, BTSUserController userController) { this.context = context; this.startupController = startupController; this.preferences = DefaultScope.INSTANCE.getNode("org.bbaw.bts.app"); this.logger = context.get(Logger.class); this.sync = sync; this.userController = userController; setWindowTitle("BTS Installation Wizard"); }
public static void initialize() { IEclipsePreferences defaultNode = DefaultScope.INSTANCE.getNode(ROOT_PREFERENCES_NODE); defaultNode.putBoolean(SHOW_TEXT, true); IEclipsePreferences lastActiveNode = DefaultScope.INSTANCE.getNode(LAST_ACTIVE_CONTEXT_NODE); lastActiveNode.put(LAST_ACTIVE, ""); //$NON-NLS-1$ }
@Override public void initializeDefaultPreferences() { IEclipsePreferences node = DefaultScope.INSTANCE.getNode(ResourcesPlugin.PI_RESOURCES); // auto-refresh default node.putBoolean(ResourcesPlugin.PREF_AUTO_REFRESH, PREF_AUTO_REFRESH_DEFAULT); node.putBoolean( ResourcesPlugin.PREF_LIGHTWEIGHT_AUTO_REFRESH, PREF_LIGHTWEIGHT_AUTO_REFRESH_DEFAULT); // linked resources default node.putBoolean(ResourcesPlugin.PREF_DISABLE_LINKING, PREF_DISABLE_LINKING_DEFAULT); // build manager defaults node.putBoolean(ResourcesPlugin.PREF_AUTO_BUILDING, PREF_AUTO_BUILDING_DEFAULT); node.put(ResourcesPlugin.PREF_BUILD_ORDER, PREF_BUILD_ORDER_DEFAULT); node.putInt(ResourcesPlugin.PREF_MAX_BUILD_ITERATIONS, PREF_MAX_BUILD_ITERATIONS_DEFAULT); node.putBoolean(ResourcesPlugin.PREF_DEFAULT_BUILD_ORDER, PREF_DEFAULT_BUILD_ORDER_DEFAULT); // history store defaults node.putBoolean( ResourcesPlugin.PREF_APPLY_FILE_STATE_POLICY, PREF_APPLY_FILE_STATE_POLICY_DEFAULT); node.putLong(ResourcesPlugin.PREF_FILE_STATE_LONGEVITY, PREF_FILE_STATE_LONGEVITY_DEFAULT); node.putLong(ResourcesPlugin.PREF_MAX_FILE_STATE_SIZE, PREF_MAX_FILE_STATE_SIZE_DEFAULT); node.putInt(ResourcesPlugin.PREF_MAX_FILE_STATES, PREF_MAX_FILE_STATES_DEFAULT); // save manager defaults node.putLong(ResourcesPlugin.PREF_SNAPSHOT_INTERVAL, PREF_SNAPSHOT_INTERVAL_DEFAULT); node.putInt(PREF_OPERATIONS_PER_SNAPSHOT, PREF_OPERATIONS_PER_SNAPSHOT_DEFAULT); node.putLong(PREF_DELTA_EXPIRATION, PREF_DELTA_EXPIRATION_DEFAULT); // encoding defaults node.put(ResourcesPlugin.PREF_ENCODING, PREF_ENCODING_DEFAULT); }
public WorkspaceDescription(String name) { super(name); // initialize based on the values in the default preferences IEclipsePreferences node = DefaultScope.INSTANCE.getNode(ResourcesPlugin.PI_RESOURCES); autoBuilding = node.getBoolean( ResourcesPlugin.PREF_AUTO_BUILDING, PreferenceInitializer.PREF_AUTO_BUILDING_DEFAULT); maxBuildIterations = node.getInt( ResourcesPlugin.PREF_MAX_BUILD_ITERATIONS, PreferenceInitializer.PREF_MAX_BUILD_ITERATIONS_DEFAULT); applyFileStatePolicy = node.getBoolean( ResourcesPlugin.PREF_APPLY_FILE_STATE_POLICY, PreferenceInitializer.PREF_APPLY_FILE_STATE_POLICY_DEFAULT); fileStateLongevity = node.getLong( ResourcesPlugin.PREF_FILE_STATE_LONGEVITY, PreferenceInitializer.PREF_FILE_STATE_LONGEVITY_DEFAULT); maxFileStates = node.getInt( ResourcesPlugin.PREF_MAX_FILE_STATES, PreferenceInitializer.PREF_MAX_FILE_STATES_DEFAULT); maxFileStateSize = node.getLong( ResourcesPlugin.PREF_MAX_FILE_STATE_SIZE, PreferenceInitializer.PREF_MAX_FILE_STATE_SIZE_DEFAULT); snapshotInterval = node.getLong( ResourcesPlugin.PREF_SNAPSHOT_INTERVAL, PreferenceInitializer.PREF_SNAPSHOT_INTERVAL_DEFAULT); operationsPerSnapshot = node.getInt( PreferenceInitializer.PREF_OPERATIONS_PER_SNAPSHOT, PreferenceInitializer.PREF_OPERATIONS_PER_SNAPSHOT_DEFAULT); deltaExpiration = node.getLong( PreferenceInitializer.PREF_DELTA_EXPIRATION, PreferenceInitializer.PREF_DELTA_EXPIRATION_DEFAULT); }
/** * @see org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer#initializeDefaultPreferences() */ public void initializeDefaultPreferences() { // get the actual default preference store final String PLUGIN_ID = Plugin.getDefault().getBundle().getSymbolicName(); IEclipsePreferences defaultNode = DefaultScope.INSTANCE.getNode(PLUGIN_ID); // set defaults setDefaults(defaultNode); }
public void initializeDefaultPreferences() { Preferences node = DefaultScope.INSTANCE.getNode(Activator.PLUGIN_ID); // default values node.putBoolean(PreferenceConstants.REPOSITORIES_VISIBLE, false); node.putBoolean(PreferenceConstants.SHOW_LATEST_VERSION_ONLY, true); node.putBoolean(PreferenceConstants.AVAILABLE_SHOW_ALL_BUNDLES, false); node.putBoolean(PreferenceConstants.INSTALLED_SHOW_ALL_BUNDLES, false); node.putBoolean(PreferenceConstants.AVAILABLE_GROUP_BY_CATEGORY, true); node.putBoolean(PreferenceConstants.SHOW_DRILLDOWN_REQUIREMENTS, false); node.putInt(PreferenceConstants.RESTART_POLICY, Policy.RESTART_POLICY_PROMPT_RESTART_OR_APPLY); node.putInt(PreferenceConstants.UPDATE_WIZARD_STYLE, Policy.UPDATE_STYLE_MULTIPLE_IUS); node.putBoolean(PreferenceConstants.FILTER_ON_ENV, false); node.putInt(PreferenceConstants.UPDATE_DETAILS_HEIGHT, SWT.DEFAULT); node.putInt(PreferenceConstants.UPDATE_DETAILS_WIDTH, SWT.DEFAULT); }
public void initializeDefaultPreferences() { Preferences node = new DefaultScope().getNode(Activator.PLUGIN_ID); //$NON-NLS-1$ // default values node.putBoolean(PreferenceConstants.REPOSITORIES_VISIBLE, false); node.putBoolean(PreferenceConstants.SHOW_LATEST_VERSION_ONLY, true); node.putBoolean(PreferenceConstants.AVAILABLE_SHOW_ALL_BUNDLES, false); node.putBoolean(PreferenceConstants.INSTALLED_SHOW_ALL_BUNDLES, false); node.putBoolean(PreferenceConstants.AVAILABLE_GROUP_BY_CATEGORY, true); node.putBoolean(PreferenceConstants.SHOW_DRILLDOWN_REQUIREMENTS, false); node.putInt(PreferenceConstants.RESTART_POLICY, Policy.RESTART_POLICY_PROMPT_RESTART_OR_APPLY); node.putInt(PreferenceConstants.UPDATE_WIZARD_STYLE, Policy.UPDATE_STYLE_MULTIPLE_IUS); node.putBoolean(PreferenceConstants.FILTER_ON_ENV, false); node.putInt(PreferenceConstants.UPDATE_DETAILS_HEIGHT, SWT.DEFAULT); node.putInt(PreferenceConstants.UPDATE_DETAILS_WIDTH, SWT.DEFAULT); }
protected void performDefaultsForSyntaxValidationGroup() { IEclipsePreferences modelPreferences = new DefaultScope() .getNode(getPreferenceNodeQualifier()); boolean useExtendedSyntaxValidation = modelPreferences.getBoolean( JSONCorePreferenceNames.SYNTAX_VALIDATION, false); if (fExtendedSyntaxValidation != null) { if (fExtendedSyntaxValidation.getSelection() != useExtendedSyntaxValidation) { handleSyntaxSeveritySelection(useExtendedSyntaxValidation); } fExtendedSyntaxValidation.setSelection(useExtendedSyntaxValidation); } }
@SuppressWarnings("deprecation") @Before public void setUp() throws Exception { workspace = ResourcesPlugin.getWorkspace(); // Turn off auto building IWorkspaceDescription description = workspace.getDescription(); description.setAutoBuilding(false); workspace.setDescription(description); // Turn off index updating IEclipsePreferences store = new DefaultScope().getNode(IMavenConstants.PLUGIN_ID); store.putBoolean(MavenPreferenceConstants.P_UPDATE_INDEXES, false); mavenConfiguration = MavenPlugin.getMavenConfiguration(); if (settingsFile != null) { oldUserSettingsFile = mavenConfiguration.getUserSettingsFile(); File settings = new File(settingsFile).getCanonicalFile(); if (settings.canRead()) { String userSettingsFile = settings.getAbsolutePath(); System.out.println("Setting user settings file: " + userSettingsFile); mavenConfiguration.setUserSettingsFile(userSettingsFile); } else { fail("User settings file cannot be read: " + settings); } } cleanWorkspace(); waitForJobs(); }
@Override protected void performDefaults() { super.performDefaults(); final Preferences pref = new DefaultScope().getNode(P2_Activator.PLUGIN_ID); showLatestRadio.setSelection(pref.getBoolean(PreferenceConstants.PREF_SHOW_LATEST_VERSION, false)); showAllRadio.setSelection(!pref.getBoolean(PreferenceConstants.PREF_SHOW_LATEST_VERSION, false)); final String openWizard = pref.get(PreferenceConstants.PREF_OPEN_WIZARD_ON_ERROR_PLAN, ""); //$NON-NLS-1$ alwaysShowFailedPlan.setSelection(openWizard.equals(MessageDialogWithToggle.ALWAYS)); neverShowFailedPlan.setSelection(openWizard.equals(MessageDialogWithToggle.NEVER)); promptOnFailedPlan.setSelection(openWizard.equals(MessageDialogWithToggle.PROMPT)); }
private static ICleanUp[] getCleanUps(IProject project) throws CoreException { ICleanUp[] cleanUps; Map<String, String> settings= CleanUpPreferenceUtil.loadSaveParticipantOptions(new ProjectScope(project)); if (settings == null) { IEclipsePreferences contextNode= InstanceScope.INSTANCE.getNode(JavaUI.ID_PLUGIN); String id= contextNode.get(CleanUpConstants.CLEANUP_ON_SAVE_PROFILE, null); if (id == null) { id= DefaultScope.INSTANCE.getNode(JavaUI.ID_PLUGIN).get(CleanUpConstants.CLEANUP_ON_SAVE_PROFILE, CleanUpConstants.DEFAULT_SAVE_PARTICIPANT_PROFILE); } throw new CoreException(new Status(IStatus.ERROR, JavaUI.ID_PLUGIN, Messages.format(FixMessages.CleanUpPostSaveListener_unknown_profile_error_message, id))); } if (CleanUpOptions.TRUE.equals(settings.get(CleanUpConstants.CLEANUP_ON_SAVE_ADDITIONAL_OPTIONS))) { cleanUps= getCleanUps(settings, null); } else { HashMap<String, String> filteredSettins= new HashMap<String, String>(); filteredSettins.put(CleanUpConstants.FORMAT_SOURCE_CODE, settings.get(CleanUpConstants.FORMAT_SOURCE_CODE)); filteredSettins.put(CleanUpConstants.FORMAT_SOURCE_CODE_CHANGES_ONLY, settings.get(CleanUpConstants.FORMAT_SOURCE_CODE_CHANGES_ONLY)); filteredSettins.put(CleanUpConstants.ORGANIZE_IMPORTS, settings.get(CleanUpConstants.ORGANIZE_IMPORTS)); Set<String> ids= new HashSet<String>(2); ids.add("org.eclipse.jdt.ui.cleanup.format"); //$NON-NLS-1$ ids.add("org.eclipse.jdt.ui.cleanup.imports"); //$NON-NLS-1$ cleanUps= getCleanUps(filteredSettins, ids); } return cleanUps; }
/** * Returns the value for the given key in the given context. * @param key The preference key * @param project The current context or <code>null</code> if no context is available and the * workspace setting should be taken. Note that passing <code>null</code> should * be avoided. * @return Returns the current value for the string. * @since 3.1 */ public static String getPreference(String key, IJavaProject project) { String val; if (project != null) { val= new ProjectScope(project.getProject()).getNode(JavaUI.ID_PLUGIN).get(key, null); if (val != null) { return val; } } val= InstanceScope.INSTANCE.getNode(JavaUI.ID_PLUGIN).get(key, null); if (val != null) { return val; } return DefaultScope.INSTANCE.getNode(JavaUI.ID_PLUGIN).get(key, null); }
/** * {@inheritDoc} */ public void performDefaults() { String key= getPreferenceKey(); boolean defaultEnabled; if (ProjectScope.SCOPE.equals(fContext.getName())) { defaultEnabled= InstanceScope.INSTANCE.getNode(JavaUI.ID_PLUGIN).getBoolean(key, false); } else { defaultEnabled= DefaultScope.INSTANCE.getNode(JavaUI.ID_PLUGIN).getBoolean(key, false); } fContext.getNode(JavaUI.ID_PLUGIN).putBoolean(key, defaultEnabled); fEnableField.setSelection(defaultEnabled); enabled(defaultEnabled); }
/** * {@inheritDoc} */ public boolean isEnabled(IScopeContext context) { IEclipsePreferences node; if (hasSettingsInScope(context)) { node= context.getNode(JavaUI.ID_PLUGIN); } else { node= InstanceScope.INSTANCE.getNode(JavaUI.ID_PLUGIN); } IEclipsePreferences defaultNode= DefaultScope.INSTANCE.getNode(JavaUI.ID_PLUGIN); String key= getPreferenceKey(); return node.getBoolean(key, defaultNode.getBoolean(key, false)); }
private boolean showWizard() { IEclipsePreferences instanceNode= InstanceScope.INSTANCE.getNode(JavaUI.ID_PLUGIN); if (instanceNode.get(CleanUpConstants.SHOW_CLEAN_UP_WIZARD, null) != null) return instanceNode.getBoolean(CleanUpConstants.SHOW_CLEAN_UP_WIZARD, true); IEclipsePreferences defaultNode= DefaultScope.INSTANCE.getNode(JavaUI.ID_PLUGIN); return defaultNode.getBoolean(CleanUpConstants.SHOW_CLEAN_UP_WIZARD, true); }
protected String getSelectedProfileId(IScopeContext instanceScope) { String profileId= instanceScope.getNode(JavaUI.ID_PLUGIN).get(fProfileKey, null); if (profileId == null) { // request from bug 129427 profileId= DefaultScope.INSTANCE.getNode(JavaUI.ID_PLUGIN).get(fProfileKey, null); } return profileId; }