Java 类org.eclipse.core.runtime.preferences.DefaultScope 实例源码

项目:bts    文件:BTSEObjectHover.java   
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;

}
项目:bts    文件:CorpusSettingsPage.java   
/**
     * 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);

    }
项目:eclox    文件:Doxygen.java   
/**
 * 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;
}
项目:org.csstudio.display.builder    文件:Activator.java   
/** {@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;
}
项目:vTM-eclipse    文件:PreferenceManager.java   
/**
 * 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() );
         }
      }
   }

}
项目:eclipse-wtp-json    文件:Validator.java   
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() };
}
项目:APICloud-Studio    文件:ProfileManager.java   
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;
}
项目:Eclipse-Postfix-Code-Completion    文件:FormatterProfileManager.java   
@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;
   }
项目:Eclipse-Postfix-Code-Completion    文件:CleanUpConfigurationBlock.java   
/**
 * {@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());
           }
    });
}
项目:parichayana    文件:ParichayanaActivator.java   
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;
}
项目:parichayana    文件:ParichayanaPreferencesInitializer.java   
@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, "");
}
项目:eclipse-wtp-webresources    文件:PreferencesWebResourcesProvider.java   
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);
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:FormatterProfileManager.java   
@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;
   }
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:CleanUpConfigurationBlock.java   
/**
 * {@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());
           }
    });
}
项目:Pydev    文件:AnalysisPreferenceInitializer.java   
@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);
}
项目:Pydev    文件:PyLintPrefInitializer.java   
@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);

}
项目:angularjs-eclipse    文件:AngularCorePreferenceConstants.java   
/**
 * 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());
    }
}
项目:relations    文件:RelationsPreferenceInitializer.java   
/**
 * @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);
}
项目:elexis-3-core    文件:PreferenceInitializer.java   
@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);
}
项目:neoscada    文件:TimeZoneInitializer.java   
@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 );
}
项目:convertigo-eclipse    文件:ConvertigoPluginPreferenceInitializer.java   
@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");
}
项目:typescript.java    文件:OptionsConfigurationBlock.java   
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();
}
项目:typescript.java    文件:TypeScriptMainPreferencePage.java   
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));
}
项目:typescript.java    文件:TypeScriptDocumentProvider.java   
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()]));
}
项目:bts    文件:InstallationWizard.java   
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");
}
项目:bts    文件:E4PerspectiveSwitcherPreferences.java   
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$
}
项目:che    文件:PreferenceInitializer.java   
@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);
}
项目:che    文件:WorkspaceDescription.java   
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);
}
项目:eclox    文件:PreferencesInitializer.java   
/**
 * @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);
}
项目:PDFReporter-Studio    文件:PreferenceInitializer.java   
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);
}
项目:IDRT-Import-and-Mapping-Tool    文件:PreferenceInitializer.java   
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);
}
项目:eclipse-wtp-json    文件:JSONValidatorPreferencePage.java   
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);
    }
}
项目:m2e-nar    文件:AbstractTestBuild.java   
@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();

}
项目:mytourbook    文件:ProvisioningPreferencePage.java   
@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));
}
项目:Eclipse-Postfix-Code-Completion    文件:CleanUpPostSaveListener.java   
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;
}
项目:Eclipse-Postfix-Code-Completion    文件:PreferenceConstants.java   
/**
 * 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);
}
项目:Eclipse-Postfix-Code-Completion    文件:AbstractSaveParticipantPreferenceConfiguration.java   
/**
 * {@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);
}
项目:Eclipse-Postfix-Code-Completion    文件:AbstractSaveParticipantPreferenceConfiguration.java   
/**
 * {@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));
}
项目:Eclipse-Postfix-Code-Completion    文件:AllCleanUpsAction.java   
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);
}
项目:Eclipse-Postfix-Code-Completion    文件:ProfileManager.java   
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;
  }