當前位置: 首頁>>代碼示例>>Java>>正文


Java DefaultScope類代碼示例

本文整理匯總了Java中org.eclipse.core.runtime.preferences.DefaultScope的典型用法代碼示例。如果您正苦於以下問題:Java DefaultScope類的具體用法?Java DefaultScope怎麽用?Java DefaultScope使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


DefaultScope類屬於org.eclipse.core.runtime.preferences包,在下文中一共展示了DefaultScope類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getHoverInfo

import org.eclipse.core.runtime.preferences.DefaultScope; //導入依賴的package包/類
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;
	
}
 
開發者ID:cplutte,項目名稱:bts,代碼行數:18,代碼來源:BTSEObjectHover.java

示例2: init

import org.eclipse.core.runtime.preferences.DefaultScope; //導入依賴的package包/類
/**
	 * 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);

	}
 
開發者ID:cplutte,項目名稱:bts,代碼行數:23,代碼來源:CorpusSettingsPage.java

示例3: getDefault

import org.eclipse.core.runtime.preferences.DefaultScope; //導入依賴的package包/類
/**
 * 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;
}
 
開發者ID:anb0s,項目名稱:eclox,代碼行數:26,代碼來源:Doxygen.java

示例4: start

import org.eclipse.core.runtime.preferences.DefaultScope; //導入依賴的package包/類
/** {@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;
}
 
開發者ID:kasemir,項目名稱:org.csstudio.display.builder,代碼行數:23,代碼來源:Activator.java

示例5: initializeDefaultPreferences

import org.eclipse.core.runtime.preferences.DefaultScope; //導入依賴的package包/類
/**
 * 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() );
         }
      }
   }
   
}
 
開發者ID:brocade,項目名稱:vTM-eclipse,代碼行數:26,代碼來源:PreferenceManager.java

示例6: createPreferenceScopes

import org.eclipse.core.runtime.preferences.DefaultScope; //導入依賴的package包/類
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() };
}
 
開發者ID:angelozerr,項目名稱:eclipse-wtp-json,代碼行數:17,代碼來源:Validator.java

示例7: loadDefaultSettings

import org.eclipse.core.runtime.preferences.DefaultScope; //導入依賴的package包/類
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;
}
 
開發者ID:apicloudcom,項目名稱:APICloud-Studio,代碼行數:19,代碼來源:ProfileManager.java

示例8: getSelectedProfileId

import org.eclipse.core.runtime.preferences.DefaultScope; //導入依賴的package包/類
@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;
   }
 
開發者ID:trylimits,項目名稱:Eclipse-Postfix-Code-Completion,代碼行數:20,代碼來源:FormatterProfileManager.java

示例9: performDefaults

import org.eclipse.core.runtime.preferences.DefaultScope; //導入依賴的package包/類
/**
 * {@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());
           }
    });
}
 
開發者ID:trylimits,項目名稱:Eclipse-Postfix-Code-Completion,代碼行數:20,代碼來源:CleanUpConfigurationBlock.java

示例10: getPreference

import org.eclipse.core.runtime.preferences.DefaultScope; //導入依賴的package包/類
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;
}
 
開發者ID:ashishsureka,項目名稱:parichayana,代碼行數:19,代碼來源:ParichayanaActivator.java

示例11: initializeDefaultPreferences

import org.eclipse.core.runtime.preferences.DefaultScope; //導入依賴的package包/類
@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, "");
}
 
開發者ID:ashishsureka,項目名稱:parichayana,代碼行數:22,代碼來源:ParichayanaPreferencesInitializer.java

示例12: isSearchInAllCSSFiles

import org.eclipse.core.runtime.preferences.DefaultScope; //導入依賴的package包/類
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);
}
 
開發者ID:angelozerr,項目名稱:eclipse-wtp-webresources,代碼行數:25,代碼來源:PreferencesWebResourcesProvider.java

示例13: initializeDefaultPreferences

import org.eclipse.core.runtime.preferences.DefaultScope; //導入依賴的package包/類
@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);
}
 
開發者ID:fabioz,項目名稱:Pydev,代碼行數:22,代碼來源:AnalysisPreferenceInitializer.java

示例14: initializeDefaultPreferences

import org.eclipse.core.runtime.preferences.DefaultScope; //導入依賴的package包/類
@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);

}
 
開發者ID:fabioz,項目名稱:Pydev,代碼行數:18,代碼來源:PyLintPrefInitializer.java

示例15: initializeDefaultValues

import org.eclipse.core.runtime.preferences.DefaultScope; //導入依賴的package包/類
/**
 * 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());
	}
}
 
開發者ID:angelozerr,項目名稱:angularjs-eclipse,代碼行數:25,代碼來源:AngularCorePreferenceConstants.java


注:本文中的org.eclipse.core.runtime.preferences.DefaultScope類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。