本文整理汇总了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;
}
示例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);
}
示例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;
}
示例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;
}
示例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() );
}
}
}
}
示例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() };
}
示例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;
}
示例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;
}
示例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());
}
});
}
示例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;
}
示例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, "");
}
示例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);
}
示例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);
}
示例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);
}
示例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());
}
}