org.eclipse.core.runtime.preferences.DefaultScope Java Examples

The following examples show how to use org.eclipse.core.runtime.preferences.DefaultScope. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: PreferenceInitializer.java    From elexis-3-core with Eclipse Public License 1.0 6 votes vote down vote up
@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);
}
 
Example #2
Source File: AnalysisPreferenceInitializer.java    From Pydev with Eclipse Public License 1.0 6 votes vote down vote up
@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(USE_PEP8_CONSOLE, DEFAULT_USE_PEP8_CONSOLE);
    node.putBoolean(PEP8_USE_SYSTEM, DEFAULT_PEP8_USE_SYSTEM);
}
 
Example #3
Source File: PyLintPrefInitializer.java    From Pydev with Eclipse Public License 1.0 6 votes vote down vote up
public static void initializeDefaultPreferences() {
    Preferences node = DefaultScope.INSTANCE.getNode(SharedCorePlugin.DEFAULT_PYDEV_PREFERENCES_SCOPE);

    node.put(PyLintPreferences.PYLINT_FILE_LOCATION, "");
    node.putBoolean(PyLintPreferences.USE_PYLINT, PyLintPreferences.DEFAULT_USE_PYLINT);

    node.putInt(PyLintPreferences.SEVERITY_ERRORS, PyLintPreferences.DEFAULT_SEVERITY_ERRORS);
    node.putInt(PyLintPreferences.SEVERITY_WARNINGS, PyLintPreferences.DEFAULT_SEVERITY_WARNINGS);
    node.putInt(PyLintPreferences.SEVERITY_FATAL, PyLintPreferences.DEFAULT_SEVERITY_FATAL);
    node.putInt(PyLintPreferences.SEVERITY_CODING_STANDARD, PyLintPreferences.DEFAULT_SEVERITY_CODING_STANDARD);
    node.putInt(PyLintPreferences.SEVERITY_REFACTOR, PyLintPreferences.DEFAULT_SEVERITY_REFACTOR);

    node.putBoolean(PyLintPreferences.USE_CONSOLE, PyLintPreferences.DEFAULT_USE_CONSOLE);
    node.put(PyLintPreferences.PYLINT_ARGS, PyLintPreferences.DEFAULT_PYLINT_ARGS);

}
 
Example #4
Source File: DefaultValuesInitializer.java    From e4Preferences with Eclipse Public License 1.0 6 votes vote down vote up
@Override
public void initializeDefaultPreferences()
{
	IEclipsePreferences node = DefaultScope.INSTANCE.getNode(FrameworkUtil.getBundle(getClass()).getSymbolicName());

	if (node != null)
	{
		node.put("rootPageValue", "DEFAULT ROOT PAGE VALUE");
		node.put("page1", "DEFAULT PAGE 1 VALUE");
		node.put("page2", "DEFAULT PAGE 2 VALUE");
	
		node.put("prefCombo", "value2");
		node.put("prefColor", StringConverter.asString(new RGB(0,255,0)));
		node.putBoolean("prefBoolean",true);
		node.put("prefString","Default string value");
		
		try { node.flush();  }  catch (BackingStoreException e) { }
	}		
	
	
	
}
 
Example #5
Source File: CleanUpConfigurationBlock.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 6 votes vote down vote up
/**
 * {@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());
           }
    });
}
 
Example #6
Source File: CheckstyleUIPluginPrefs.java    From eclipse-cs with GNU Lesser General Public License v2.1 6 votes vote down vote up
/**
 * {@inheritDoc}
 */
@Override
public void initializeDefaultPreferences() {

  IEclipsePreferences prefs = DefaultScope.INSTANCE.getNode(CheckstyleUIPlugin.PLUGIN_ID);

  prefs.putBoolean(PREF_FILESET_WARNING, true);
  prefs.put(PREF_ASK_BEFORE_REBUILD, MessageDialogWithToggle.PROMPT);
  prefs.putBoolean(PREF_TRANSLATE_TOKENS, true);
  prefs.putBoolean(PREF_SORT_TOKENS, false);
  prefs.putBoolean(PREF_OPEN_MODULE_EDITOR, true);
  prefs.putInt(PREF_DUPLICATED_CODE_MIN_LINES, DUPLICATED_CODE_MIN_LINES);
  prefs.putBoolean(PREF_STATS_SHOW_ALL_CATEGORIES, false);

  try {
    prefs.flush();
  } catch (BackingStoreException e) {
    CheckstyleLog.log(e);
  }
}
 
Example #7
Source File: ProfileManager.java    From APICloud-Studio with GNU General Public License v3.0 6 votes vote down vote up
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;
}
 
Example #8
Source File: FormatterProfileManager.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 6 votes vote down vote up
@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;
   }
 
Example #9
Source File: CheckstylePluginPrefs.java    From eclipse-cs with GNU Lesser General Public License v2.1 6 votes vote down vote up
/**
 * {@inheritDoc}
 */
@Override
public void initializeDefaultPreferences() {

  IEclipsePreferences prefs = DefaultScope.INSTANCE.getNode(CheckstylePlugin.PLUGIN_ID);
  prefs.putBoolean(PREF_INCLUDE_RULE_NAMES, false);
  prefs.putBoolean(PREF_INCLUDE_MODULE_IDS, false);
  prefs.putBoolean(PREF_LIMIT_MARKERS_PER_RESOURCE, false);
  prefs.putInt(PREF_MARKER_AMOUNT_LIMIT, MARKER_LIMIT);
  prefs.putBoolean(PREF_BACKGROUND_FULL_BUILD, false);

  try {
    prefs.flush();
  } catch (BackingStoreException e) {
    CheckstyleLog.log(e);
  }
}
 
Example #10
Source File: JavaLanguageServerPlugin.java    From eclipse.jdt.ls with Eclipse Public License 2.0 6 votes vote down vote up
private void setPreferenceNodeId() {
	// a hack to ensure unit tests work in Eclipse and CLI builds on Mac
	Bundle bundle = Platform.getBundle(JDT_UI_PLUGIN);
	if (bundle != null && bundle.getState() != Bundle.ACTIVE) {
		// start the org.eclipse.jdt.ui plugin if it exists
		try {
			bundle.start();
		} catch (BundleException e) {
			JavaLanguageServerPlugin.logException(e.getMessage(), e);
		}
	}
	// if preferenceNodeId is already set, we have to nullify it
	// https://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/commit/?id=4c731bc9cc7e1cfd2e67746171aede8d7719e9c1
	JavaManipulation.setPreferenceNodeId(null);
	// Set the ID to use for preference lookups
	JavaManipulation.setPreferenceNodeId(IConstants.PLUGIN_ID);

	IEclipsePreferences fDefaultPreferenceStore = DefaultScope.INSTANCE.getNode(JavaManipulation.getPreferenceNodeId());
	fDefaultPreferenceStore.put(MembersOrderPreferenceCacheCommon.APPEARANCE_MEMBER_SORT_ORDER, DEFAULT_MEMBER_SORT_ORDER);
	fDefaultPreferenceStore.put(CodeGenerationSettingsConstants.CODEGEN_USE_OVERRIDE_ANNOTATION, Boolean.TRUE.toString());

	// initialize MembersOrderPreferenceCacheCommon used by BodyDeclarationRewrite
	MembersOrderPreferenceCacheCommon preferenceCache = JavaManipulationPlugin.getDefault().getMembersOrderPreferenceCacheCommon();
	preferenceCache.install();
}
 
Example #11
Source File: TimeZoneInitializer.java    From neoscada with Eclipse Public License 1.0 5 votes vote down vote up
@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 );
}
 
Example #12
Source File: MinimapPreferenceInitializer.java    From Pydev with Eclipse Public License 1.0 5 votes vote down vote up
@Override
public void initializeDefaultPreferences() {
    Preferences node = DefaultScope.INSTANCE.getNode(SharedUiPlugin.PLUGIN_ID);

    node.putBoolean(MinimapOverviewRulerPreferencesPage.USE_MINIMAP, true);
    node.putBoolean(MinimapOverviewRulerPreferencesPage.SHOW_VERTICAL_SCROLLBAR, false);
    node.putBoolean(MinimapOverviewRulerPreferencesPage.SHOW_HORIZONTAL_SCROLLBAR, true);
    node.putBoolean(MinimapOverviewRulerPreferencesPage.SHOW_MINIMAP_CONTENTS, false);
    node.putInt(MinimapOverviewRulerPreferencesPage.MINIMAP_WIDTH, 25); // Change default from 70 -> 25
    node.put(MinimapOverviewRulerPreferencesPage.MINIMAP_SELECTION_COLOR,
            StringConverter.asString(new RGB(51, 153, 255)));

}
 
Example #13
Source File: DebugPluginPrefsInitializer.java    From Pydev with Eclipse Public License 1.0 5 votes vote down vote up
@Override
public void initializeDefaultPreferences() {
    Preferences node = DefaultScope.INSTANCE.getNode(SharedCorePlugin.DEFAULT_PYDEV_PREFERENCES_SCOPE);
    node.putInt(PYDEV_REMOTE_DEBUGGER_PORT, DEFAULT_REMOTE_DEBUGGER_PORT);

    node.putInt(DEBUG_SERVER_STARTUP, DEFAULT_DEBUG_SERVER_ALWAYS_ON);
    node.putInt(FORCE_SHOW_SHELL_ON_BREAKPOINT, DEFAULT_FORCE_SHOW_SHELL_ON_BREAKPOINT);
}
 
Example #14
Source File: BonitaStudioWorkbenchAdvisor.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
protected void initXMLandHTMLValidationPreferences() {
    IEclipsePreferences xmlNode = DefaultScope.INSTANCE
            .getNode(XMLCorePlugin.getDefault().getBundle().getSymbolicName());
    xmlNode.putInt(XMLCorePreferenceNames.INDICATE_NO_GRAMMAR, -1);

    IEclipsePreferences htmlNode = DefaultScope.INSTANCE
            .getNode(HTMLCorePlugin.getDefault().getBundle().getSymbolicName());
    htmlNode.putInt(HTMLCorePreferenceNames.ATTRIBUTE_INVALID_NAME, -1);
    htmlNode.putInt(HTMLCorePreferenceNames.ATTRIBUTE_INVALID_VALUE, -1);
    htmlNode.putInt(HTMLCorePreferenceNames.ATTRIBUTE_UNDEFINED_NAME, -1);
    htmlNode.putInt(HTMLCorePreferenceNames.ATTRIBUTE_UNDEFINED_VALUE, -1);
    htmlNode.putInt(HTMLCorePreferenceNames.ATTRIBUTE_VALUE_EQUALS_MISSING, -1);
    htmlNode.putInt(HTMLCorePreferenceNames.ELEM_UNKNOWN_NAME, -1);
}
 
Example #15
Source File: DataRepositoryServerManager.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
private void initializeDebugPreferences() {
    IPreferenceStore store = DebugUIPlugin.getDefault().getPreferenceStore();
    IEclipsePreferences prefNode = DefaultScope.INSTANCE.getNode(DebugPlugin.getUniqueIdentifier());
    prefNode.putBoolean(IInternalDebugCoreConstants.PREF_ENABLE_STATUS_HANDLERS, false);
    store.setValue(IDebugPreferenceConstants.CONSOLE_OPEN_ON_OUT, false);
    store.setValue(IDebugPreferenceConstants.CONSOLE_OPEN_ON_ERR, false);
}
 
Example #16
Source File: PreferenceInitializer.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
protected void initializeWorkbenchPreferences() {
    IScopeContext context = DefaultScope.INSTANCE;
    IEclipsePreferences node = context.getNode(WorkbenchPlugin
            .getDefault().getBundle().getSymbolicName());

    node.putBoolean(IPreferenceConstants.RUN_IN_BACKGROUND, false);
}
 
Example #17
Source File: PreferencesLookupHelper.java    From goclipse with Eclipse Public License 1.0 5 votes vote down vote up
public PreferencesLookupHelper(String qualifier, Optional<IProject> project) {
	this.qualifier = qualifier;
	
	project = MiscUtil.toOptional(project);
	if(project.isPresent()) {
		contexts = array(new ProjectScope(project.get()), InstanceScope.INSTANCE, DefaultScope.INSTANCE);
	} else {
		contexts = array(InstanceScope.INSTANCE, DefaultScope.INSTANCE);
	}
}
 
Example #18
Source File: PydevDebugPreferencesInitializer.java    From Pydev with Eclipse Public License 1.0 5 votes vote down vote up
@Override
public void initializeDefaultPreferences() {
    Preferences node = DefaultScope.INSTANCE.getNode("org.python.pydev.debug");

    //py unit view
    node.putBoolean(PyUnitView.PYUNIT_VIEW_SHOW_ONLY_ERRORS, PyUnitView.PYUNIT_VIEW_DEFAULT_SHOW_ONLY_ERRORS);
    node.putBoolean(PyUnitView.PYUNIT_VIEW_SHOW_VIEW_ON_TEST_RUN,
            PyUnitView.PYUNIT_VIEW_DEFAULT_SHOW_VIEW_ON_TEST_RUN);
    node.putBoolean(PyUnitView.PYUNIT_VIEW_BACKGROUND_RELAUNCH_SHOW_ONLY_ERRORS,
            PyUnitView.PYUNIT_VIEW_DEFAULT_BACKGROUND_RELAUNCH_SHOW_ONLY_ERRORS);

    //debug prefs
    node.putBoolean(HIDE_PYDEVD_THREADS, DEFAULT_HIDE_PYDEVD_THREADS);
    node.putBoolean(SKIP_CAUGHT_EXCEPTIONS_IN_SAME_FUNCTION, DEFAULT_SKIP_CAUGHT_EXCEPTIONS_IN_SAME_FUNCTION);
    node.putBoolean(SKIP_CAUGHT_EXCEPTIONS_IN_LIBRARIES, DEFAULT_SKIP_CAUGHT_EXCEPTIONS_IN_LIBRARIES);
    node.putBoolean(IGNORE_EXCEPTIONS_THROWN_IN_LINES_WITH_IGNORE_EXCEPTION,
            DEFAULT_IGNORE_EXCEPTIONS_THROWN_IN_LINES_WITH_IGNORE_EXCEPTION);

    //Prefs on console prompt on debug
    node.putBoolean(SHOW_CONSOLE_PROMPT_ON_DEBUG, true);
    node.putInt(RELATIVE_CONSOLE_HEIGHT, 30);
    node.putInt(CONSOLE_PROMPT_OUTPUT_MODE, MODE_ASYNC_SEPARATE_CONSOLE);

    //Note: the preferences for the debug which appear in the preferences page are actually in
    //the PydevEditorPrefs (as we use the pydev preferences store there).

    // Delegate to the variables preferences
    PyVariablesPreferences.initializeDefaultPreferences();
}
 
Example #19
Source File: RefactoringPreferencesInitializer.java    From Pydev with Eclipse Public License 1.0 5 votes vote down vote up
@Override
public void initializeDefaultPreferences() {
    Preferences node = DefaultScope.INSTANCE.getNode(DEFAULT_SCOPE);
    node.putBoolean(MarkOccurrencesPreferencesPage.USE_MARK_OCCURRENCES,
            MarkOccurrencesPreferencesPage.DEFAULT_USE_MARK_OCCURRENCES);
    node.putBoolean(MarkOccurrencesPreferencesPage.USE_MARK_OCCURRENCES_IN_STRINGS,
            MarkOccurrencesPreferencesPage.DEFAULT_USE_MARK_OCCURRENCES_IN_STRINGS);
}
 
Example #20
Source File: ScriptingExtensionInitializer.java    From Pydev with Eclipse Public License 1.0 5 votes vote down vote up
@Override
public void initializeDefaultPreferences() {
    Preferences node = DefaultScope.INSTANCE.getNode(DEFAULT_SCOPE);

    node.putBoolean(JyScriptingPreferencesPage.SHOW_SCRIPTING_OUTPUT,
            JyScriptingPreferencesPage.DEFAULT_SHOW_SCRIPTING_OUTPUT);
    node.putBoolean(JyScriptingPreferencesPage.LOG_SCRIPTING_ERRORS,
            JyScriptingPreferencesPage.DEFAULT_LOG_SCRIPTING_ERRORS);
}
 
Example #21
Source File: UMLPreferences.java    From textuml with Eclipse Public License 1.0 5 votes vote down vote up
@Override
public void initializeDefaultPreferences() {
    IEclipsePreferences defaults = new DefaultScope().getNode(UML.PLUGIN_ID);
    defaults.putBoolean(UML2DOTPreferences.SHOW_CLASSIFIER_STEREOTYPES, true);
    defaults.putBoolean(UML2DOTPreferences.SHOW_FEATURE_STEREOTYPES, false);
    defaults.putBoolean(UML2DOTPreferences.SHOW_RELATIONSHIP_STEREOTYPES, true);
    defaults.putBoolean(UML2DOTPreferences.SHOW_ASSOCIATION_END_OWNERSHIP, false);
    defaults.putBoolean(UML2DOTPreferences.SHOW_FEATURE_VISIBILITY, true);
    defaults.putBoolean(UML2DOTPreferences.SHOW_ASSOCIATION_END_MULTIPLICITY, true);
    defaults.putBoolean(UML2DOTPreferences.SHOW_ASSOCIATION_NAME, false);
    defaults.putBoolean(UML2DOTPreferences.SHOW_ASSOCIATION_END_NAME, true);
    defaults.putBoolean(UML2DOTPreferences.OMIT_CONSTRAINTS_FOR_NAVIGABILITY, false);
    defaults.putBoolean(UML2DOTPreferences.SHOW_COMMENTS, true);
    defaults.putBoolean(UML2DOTPreferences.SHOW_PARAMETERS, true);
    defaults.putBoolean(UML2DOTPreferences.SHOW_RETURN_PARAMETER, true);
    defaults.putBoolean(UML2DOTPreferences.SHOW_PARAMETER_NAMES, false);
    defaults.putBoolean(UML2DOTPreferences.SHOW_PARAMETER_DIRECTION, false);
    defaults.put(UML2DOTPreferences.SHOW_CLASSIFIER_COMPARTMENT,
            UML2DOTPreferences.ShowClassifierCompartmentOptions.NotEmpty.name());
    defaults.put(UML2DOTPreferences.SHOW_CLASSIFIER_COMPARTMENT_FOR_PACKAGE,
            UML2DOTPreferences.ShowClassifierCompartmentForPackageOptions.Local.name());
    defaults.put(UML2DOTPreferences.SHOW_ELEMENTS_IN_OTHER_PACKAGES,
            UML2DOTPreferences.ShowCrossPackageElementOptions.Local.name());
    defaults.putBoolean(UML2DOTPreferences.SHOW_ELEMENTS_IN_LIBRARIES, false);
    defaults.putBoolean(UML2DOTPreferences.SHOW_PRIMITIVES, false);
    defaults.putBoolean(UML2DOTPreferences.SHOW_CLASSES, true);
    defaults.putBoolean(UML2DOTPreferences.SHOW_INTERFACES, true);
    defaults.putBoolean(UML2DOTPreferences.SHOW_STATEMACHINES, true);
    defaults.putBoolean(UML2DOTPreferences.SHOW_OPERATIONS, true);
    defaults.putBoolean(UML2DOTPreferences.SHOW_ATTRIBUTES, true);
    defaults.putBoolean(UML2DOTPreferences.SHOW_DATATYPES, false);
    defaults.putBoolean(UML2DOTPreferences.SHOW_SIGNALS, false);
}
 
Example #22
Source File: JavaModelManager.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * Initialize preferences lookups for JavaCore plug-in.
 */
public void initializePreferences() {

	// Create lookups
	this.preferencesLookup[PREF_INSTANCE] = InstanceScope.INSTANCE.getNode(JavaCore.PLUGIN_ID);
	this.preferencesLookup[PREF_DEFAULT] = DefaultScope.INSTANCE.getNode(JavaCore.PLUGIN_ID);

	// Listen to instance preferences node removal from parent in order to refresh stored one
	this.instanceNodeListener = new IEclipsePreferences.INodeChangeListener() {
		public void added(IEclipsePreferences.NodeChangeEvent event) {
			// do nothing
		}
		public void removed(IEclipsePreferences.NodeChangeEvent event) {
			if (event.getChild() == JavaModelManager.this.preferencesLookup[PREF_INSTANCE]) {
				JavaModelManager.this.preferencesLookup[PREF_INSTANCE] = InstanceScope.INSTANCE.getNode(JavaCore.PLUGIN_ID);
				JavaModelManager.this.preferencesLookup[PREF_INSTANCE].addPreferenceChangeListener(new EclipsePreferencesListener());
			}
		}
	};
	((IEclipsePreferences) this.preferencesLookup[PREF_INSTANCE].parent()).addNodeChangeListener(this.instanceNodeListener);
	this.preferencesLookup[PREF_INSTANCE].addPreferenceChangeListener(this.instancePreferencesListener = new EclipsePreferencesListener());

	// Listen to default preferences node removal from parent in order to refresh stored one
	this.defaultNodeListener = new IEclipsePreferences.INodeChangeListener() {
		public void added(IEclipsePreferences.NodeChangeEvent event) {
			// do nothing
		}
		public void removed(IEclipsePreferences.NodeChangeEvent event) {
			if (event.getChild() == JavaModelManager.this.preferencesLookup[PREF_DEFAULT]) {
				JavaModelManager.this.preferencesLookup[PREF_DEFAULT] = DefaultScope.INSTANCE.getNode(JavaCore.PLUGIN_ID);
			}
		}
	};
	((IEclipsePreferences) this.preferencesLookup[PREF_DEFAULT].parent()).addNodeChangeListener(this.defaultNodeListener);
}
 
Example #23
Source File: CleanUpConfigurationBlock.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * {@inheritDoc}
 */
@Override
public Composite createContents(Composite parent) {
    Composite composite= super.createContents(parent);

    if (fCurrContext == null)
    	return composite;

    fShowCleanUpWizardDialogField= new SelectionButtonDialogField(SWT.CHECK);
	fShowCleanUpWizardDialogField.setLabelText(CleanUpMessages.CleanUpConfigurationBlock_ShowCleanUpWizard_checkBoxLabel);
    fShowCleanUpWizardDialogField.doFillIntoGrid(composite, 5);

    IEclipsePreferences node= fCurrContext.getNode(JavaUI.ID_PLUGIN);
	boolean showWizard;
	if (node.get(CleanUpConstants.SHOW_CLEAN_UP_WIZARD, null) != null) {
		showWizard= node.getBoolean(CleanUpConstants.SHOW_CLEAN_UP_WIZARD, true);
	} else {
		showWizard= DefaultScope.INSTANCE.getNode(JavaUI.ID_PLUGIN).getBoolean(CleanUpConstants.SHOW_CLEAN_UP_WIZARD, true);
	}
	if (showWizard)
		fShowCleanUpWizardDialogField.setSelection(true);

    fShowCleanUpWizardDialogField.setDialogFieldListener(new IDialogFieldListener() {
		public void dialogFieldChanged(DialogField field) {
			doShowCleanUpWizard(fShowCleanUpWizardDialogField.isSelected());
           }
    });

	return composite;
}
 
Example #24
Source File: ProfileManager.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
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;
  }
 
Example #25
Source File: AllCleanUpsAction.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
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);
}
 
Example #26
Source File: AbstractSaveParticipantPreferenceConfiguration.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * {@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));
}
 
Example #27
Source File: AbstractSaveParticipantPreferenceConfiguration.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * {@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);
}
 
Example #28
Source File: PreferenceConstants.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * 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);
}
 
Example #29
Source File: TypeFilter.java    From eclipse.jdt.ls with Eclipse Public License 2.0 5 votes vote down vote up
public static String getPreference(String key) {
	String val = InstanceScope.INSTANCE.getNode(JavaManipulation.getPreferenceNodeId()).get(key, null);
	if (val != null) {
		return val;
	}
	return DefaultScope.INSTANCE.getNode(JavaManipulation.getPreferenceNodeId()).get(key, null);
}
 
Example #30
Source File: CleanUpPostSaveListener.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
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;
}