Java Code Examples for org.osgi.service.prefs.Preferences#putBoolean()

The following examples show how to use org.osgi.service.prefs.Preferences#putBoolean() . 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: WorkingSetManagerBrokerImpl.java    From n4js with Eclipse Public License 1.0 6 votes vote down vote up
private IStatus saveState() {

		final Preferences node = getPreferences();
		// Top level element.
		node.putBoolean(IS_WORKINGSET_TOP_LEVEL_KEY, workingSetTopLevel.get());

		// Active working set manager.
		final WorkingSetManager activeManager = getActiveManager();
		final String activeId = activeManager == null ? null : activeManager.getId();
		node.put(ACTIVE_MANAGER_KEY, Strings.nullToEmpty(activeId));

		try {
			node.flush();
			return OK_STATUS;
		} catch (final BackingStoreException e) {
			final String message = "Unexpected error when trying to persist working set broker state.";
			LOGGER.error(message, e);
			return statusHelper.createError(message, e);
		}
	}
 
Example 2
Source File: StaticAnalyzerPreferences.java    From CogniCrypt with Eclipse Public License 2.0 6 votes vote down vote up
@Override
protected void storeValues() {
	preferences.setValue(Constants.AUTOMATED_ANALYSIS, automatedAnalysisCheckBox.getSelection());
	preferences.setValue(Constants.PROVIDER_DETECTION_ANALYSIS, providerDetectionCheckBox.getSelection());
	preferences.setValue(Constants.SHOW_SECURE_OBJECTS, secureObjectsCheckBox.getSelection());
	preferences.setValue(Constants.ANALYSE_DEPENDENCIES, analyseDependenciesCheckBox.getSelection());
	preferences.setValue(Constants.CALL_GRAPH_SELECTION, CGSelection.getSelectionIndex());
	preferences.setValue(Constants.FORBIDDEN_METHOD_MARKER_TYPE, forbidden.getSelectionIndex());
	preferences.setValue(Constants.CONSTRAINT_ERROR_MARKER_TYPE, constraint.getSelectionIndex());
	preferences.setValue(Constants.INCOMPLETE_OPERATION_MARKER_TYPE, incompleteOp.getSelectionIndex());
	preferences.setValue(Constants.NEVER_TYPEOF_MARKER_TYPE, neverType.getSelectionIndex());
	preferences.setValue(Constants.REQUIRED_PREDICATE_MARKER_TYPE, reqPred.getSelectionIndex());
	preferences.setValue(Constants.TYPESTATE_ERROR_MARKER_TYPE, typestate.getSelectionIndex());

	for (Iterator<Ruleset> itr = listOfRulesets.iterator(); itr.hasNext();) {
		Ruleset ruleset = (Ruleset) itr.next();

		Preferences subPref = rulePreferences.node(ruleset.getFolderName());
		subPref.putBoolean("CheckboxState", ruleset.isChecked());
		subPref.put("FolderName", ruleset.getFolderName());
		subPref.put("SelectedVersion", ruleset.getSelectedVersion());
		subPref.put("Url", ruleset.getUrl());
	}
}
 
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: 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 5
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 6
Source File: DefaultRulePreferences.java    From CogniCrypt with Eclipse Public License 2.0 5 votes vote down vote up
public static void addDefaults() {
	Preferences rulePreferences = InstanceScope.INSTANCE.getNode(de.cognicrypt.core.Activator.PLUGIN_ID);
	String[] listOfNodes;
	try {
		listOfNodes = rulePreferences.childrenNames();
		if (listOfNodes.length == 0) {
			Section ini = Utils.getConfig().get(Constants.INI_URL_HEADER);
			List<Ruleset> listOfRulesets = new ArrayList<Ruleset>() {
		 		private static final long serialVersionUID = 1L;
		 		{
		 			add(new Ruleset(ini.get(Constants.INI_JCA_NEXUS), true));
		 			add(new Ruleset(ini.get(Constants.INI_BC_NEXUS)));
		 			add(new Ruleset(ini.get(Constants.INI_TINK_NEXUS)));
		 			add(new Ruleset(ini.get(Constants.INI_BCJCA_NEXUS)));
		 		}
		 	};
		 	for (Iterator<Ruleset> itr = listOfRulesets.iterator(); itr.hasNext();) {
	 			Ruleset ruleset = (Ruleset) itr.next();
	
	 			Preferences subPref = rulePreferences.node(ruleset.getFolderName());
	 			subPref.putBoolean("CheckboxState", ruleset.isChecked());
	 			subPref.put("FolderName", ruleset.getFolderName());
	 			subPref.put("SelectedVersion", ruleset.getSelectedVersion());
	 			subPref.put("Url", ruleset.getUrl());
	 		}
		}
	} catch (BackingStoreException e) {
		Activator.getDefault().logError(e);
	}
}
 
Example 7
Source File: ImportPlatformPage.java    From hybris-commerce-eclipse-plugin with Apache License 2.0 5 votes vote down vote up
private void persistSelections() {
	// persist checkbox selections for next time
	Preferences preferences = InstanceScope.INSTANCE.getNode("com.hybris.hyeclipse.preferences");
	preferences.putBoolean(FIX_CLASS_PATH_ISSUES_PREFERENCE, fixClasspathIssuesButton.getSelection());
	preferences.putBoolean(REMOVE_HYBRIS_BUILDER_PREFERENCE, removeHybrisItemsXmlGeneratorButton.getSelection());
	preferences.putBoolean(REMOVE_EXISTING_PROJECTS_PREFERENCE, removeExistingProjects.getSelection());
	preferences.putBoolean(CREATE_WORKING_SETS_PREFERENCE, createWorkingSetsButton.getSelection());
	preferences.putBoolean(USE_MULTI_THREAD_PREFERENCE, useMultiThreadButton.getSelection());
	preferences.putBoolean(SKIP_JAR_SCANNING_PREFERENCE, skipJarScanningButton.getSelection());
	try {
		preferences.flush();
	} catch (BackingStoreException e) {
		throw new IllegalStateException("Could not save preferences", e);
	}
}
 
Example 8
Source File: SynchronizePlatformPage.java    From hybris-commerce-eclipse-plugin with Apache License 2.0 5 votes vote down vote up
private void persistSelections() {
	// persist checkbox selections for next time
	Preferences preferences = InstanceScope.INSTANCE.getNode("com.hybris.hyeclipse.preferences");
	preferences.putBoolean(ImportPlatformPage.FIX_CLASS_PATH_ISSUES_PREFERENCE, fixClasspathIssuesButton.getSelection());
	preferences.putBoolean(ImportPlatformPage.REMOVE_HYBRIS_BUILDER_PREFERENCE, removeHybrisItemsXmlGeneratorButton.getSelection());
	preferences.putBoolean(ImportPlatformPage.CREATE_WORKING_SETS_PREFERENCE, createWorkingSetsButton.getSelection());
	preferences.putBoolean(ImportPlatformPage.USE_MULTI_THREAD_PREFERENCE, useMultiThreadButton.getSelection());
	preferences.putBoolean(ImportPlatformPage.SKIP_JAR_SCANNING_PREFERENCE, skipJarScanningButton.getSelection());

	try {
		preferences.flush();
	} catch (BackingStoreException e) {
		throw new IllegalStateException("Could not save preferences", e);
	}
}
 
Example 9
Source File: MypyPrefInitializer.java    From Pydev with Eclipse Public License 1.0 5 votes vote down vote up
public static void initializeDefaultPreferences() {
    Preferences node = DefaultScope.INSTANCE.getNode(SharedCorePlugin.DEFAULT_PYDEV_PREFERENCES_SCOPE);

    node.put(MypyPreferences.MYPY_FILE_LOCATION, "");
    node.putBoolean(MypyPreferences.USE_MYPY, MypyPreferences.DEFAULT_USE_MYPY);

    node.putBoolean(MypyPreferences.MYPY_USE_CONSOLE, MypyPreferences.DEFAULT_MYPY_USE_CONSOLE);
    node.put(MypyPreferences.MYPY_ARGS, MypyPreferences.DEFAULT_MYPY_ARGS);
    node.putBoolean(MypyPreferences.MYPY_ADD_PROJECT_FOLDERS_TO_MYPYPATH, MypyPreferences.DEFAULT_MYPY_ADD_PROJECT_FOLDERS_TO_MYPYPATH);

}
 
Example 10
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 11
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 12
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 13
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 14
Source File: PyDevCorePreferencesInitializer.java    From Pydev with Eclipse Public License 1.0 4 votes vote down vote up
public static void initializeDefaultPreferences() {
    Preferences node = DefaultScope.INSTANCE.getNode(SharedCorePlugin.DEFAULT_PYDEV_PREFERENCES_SCOPE);

    //ironpython
    node.put(IInterpreterManager.IRONPYTHON_INTERNAL_SHELL_VM_ARGS,
            IInterpreterManager.IRONPYTHON_DEFAULT_INTERNAL_SHELL_VM_ARGS);

    //text
    node.putBoolean(PyDevTypingPreferences.SMART_INDENT_PAR, PyDevTypingPreferences.DEFAULT_SMART_INDENT_PAR);
    node.putBoolean(PyDevTypingPreferences.AUTO_PAR, PyDevTypingPreferences.DEFAULT_AUTO_PAR);
    node.putBoolean(PyDevTypingPreferences.INDENT_AFTER_PAR_AS_PEP8,
            PyDevTypingPreferences.DEFAULT_INDENT_AFTER_PAR_AS_PEP8);
    node.putBoolean(PyDevTypingPreferences.AUTO_LINK, PyDevTypingPreferences.DEFAULT_AUTO_LINK);
    node.putBoolean(PyDevTypingPreferences.AUTO_INDENT_TO_PAR_LEVEL,
            PyDevTypingPreferences.DEFAULT_AUTO_INDENT_TO_PAR_LEVEL);
    node.putBoolean(PyDevTypingPreferences.AUTO_DEDENT_ELSE, PyDevTypingPreferences.DEFAULT_AUTO_DEDENT_ELSE);
    node.putInt(PyDevTypingPreferences.AUTO_INDENT_AFTER_PAR_WIDTH,
            PyDevTypingPreferences.DEFAULT_AUTO_INDENT_AFTER_PAR_WIDTH);
    node.putBoolean(PyDevTypingPreferences.AUTO_COLON, PyDevTypingPreferences.DEFAULT_AUTO_COLON);
    node.putBoolean(PyDevTypingPreferences.AUTO_BRACES, PyDevTypingPreferences.DEFAULT_AUTO_BRACES);
    node.putBoolean(PyDevTypingPreferences.AUTO_WRITE_IMPORT_STR,
            PyDevTypingPreferences.DEFAULT_AUTO_WRITE_IMPORT_STR);
    node.putBoolean(PyDevTypingPreferences.AUTO_LITERALS, PyDevTypingPreferences.DEFAULT_AUTO_LITERALS);
    node.putBoolean(PyDevTypingPreferences.SMART_LINE_MOVE, PyDevTypingPreferences.DEFAULT_SMART_LINE_MOVE);

    node.putInt(PyDevCoreEditorPreferences.TAB_WIDTH, PyDevCoreEditorPreferences.DEFAULT_TAB_WIDTH);

    //checkboxes
    node.putBoolean(PyDevCoreEditorPreferences.SUBSTITUTE_TABS, PyDevCoreEditorPreferences.DEFAULT_SUBSTITUTE_TABS);
    node.putBoolean(PyDevTypingPreferences.AUTO_ADD_SELF, PyDevTypingPreferences.DEFAULT_AUTO_ADD_SELF);
    node.putBoolean(PyDevCoreEditorPreferences.GUESS_TAB_SUBSTITUTION,
            PyDevCoreEditorPreferences.DEFAULT_GUESS_TAB_SUBSTITUTION);

    //code formatting
    node.putBoolean(PyFormatterPreferences.USE_ASSIGN_WITH_PACES_INSIDER_PARENTESIS,
            PyFormatterPreferences.DEFAULT_USE_ASSIGN_WITH_PACES_INSIDE_PARENTESIS);
    node.putBoolean(PyFormatterPreferences.USE_OPERATORS_WITH_SPACE,
            PyFormatterPreferences.DEFAULT_USE_OPERATORS_WITH_SPACE);
    node.putBoolean(PyFormatterPreferences.USE_SPACE_AFTER_COMMA,
            PyFormatterPreferences.DEFAULT_USE_SPACE_AFTER_COMMA);
    node.putBoolean(PyFormatterPreferences.ADD_NEW_LINE_AT_END_OF_FILE,
            PyFormatterPreferences.DEFAULT_ADD_NEW_LINE_AT_END_OF_FILE);
    node.putBoolean(PyFormatterPreferences.FORMAT_ONLY_CHANGED_LINES,
            PyFormatterPreferences.DEFAULT_FORMAT_ONLY_CHANGED_LINES);
    node.putBoolean(PyFormatterPreferences.TRIM_LINES, PyFormatterPreferences.DEFAULT_TRIM_LINES);
    node.putBoolean(PyFormatterPreferences.USE_SPACE_FOR_PARENTESIS,
            PyFormatterPreferences.DEFAULT_USE_SPACE_FOR_PARENTESIS);
    node.putInt(PyFormatterPreferences.SPACES_BEFORE_COMMENT,
            PyFormatterPreferences.DEFAULT_SPACES_BEFORE_COMMENT);
    node.putInt(PyFormatterPreferences.SPACES_IN_START_COMMENT,
            PyFormatterPreferences.DEFAULT_SPACES_IN_START_COMMENT);
    node.putBoolean(PyFormatterPreferences.MANAGE_BLANK_LINES,
            PyFormatterPreferences.DEFAULT_MANAGE_BLANK_LINES);
    node.putInt(PyFormatterPreferences.BLANK_LINES_TOP_LEVEL,
            PyFormatterPreferences.DEFAULT_BLANK_LINES_TOP_LEVEL);
    node.putInt(PyFormatterPreferences.BLANK_LINES_INNER,
            PyFormatterPreferences.DEFAULT_BLANK_LINES_INNER);
    node.put(PyFormatterPreferences.BLACK_FORMATTER_LOCATION_OPTION,
            PyFormatterPreferences.DEFAULT_BLACK_FORMATTER_LOCATION_OPTION);

    //file types
    node.put(FileTypesPreferences.VALID_SOURCE_FILES, FileTypesPreferences.DEFAULT_VALID_SOURCE_FILES);
    node.put(FileTypesPreferences.FIRST_CHOICE_PYTHON_SOURCE_FILE,
            FileTypesPreferences.DEFAULT_FIRST_CHOICE_PYTHON_SOURCE_FILE);

    //general interpreters
    node.putBoolean(InterpreterGeneralPreferences.NOTIFY_NO_INTERPRETER_PY,
            InterpreterGeneralPreferences.DEFAULT_NOTIFY_NO_INTERPRETER_PY);
    node.putBoolean(InterpreterGeneralPreferences.NOTIFY_NO_INTERPRETER_JY,
            InterpreterGeneralPreferences.DEFAULT_NOTIFY_NO_INTERPRETER_JY);
    node.putBoolean(InterpreterGeneralPreferences.NOTIFY_NO_INTERPRETER_IP,
            InterpreterGeneralPreferences.DEFAULT_NOTIFY_NO_INTERPRETER_IP);

    node.putBoolean(InterpreterGeneralPreferences.CHECK_CONSISTENT_ON_STARTUP,
            InterpreterGeneralPreferences.DEFAULT_CHECK_CONSISTENT_ON_STARTUP);

    node.putBoolean(InterpreterGeneralPreferences.UPDATE_INTERPRETER_INFO_ON_FILESYSTEM_CHANGES,
            InterpreterGeneralPreferences.DEFAULT_UPDATE_INTERPRETER_INFO_ON_FILESYSTEM_CHANGES);

}
 
Example 15
Source File: PyCodeCompletionInitializer.java    From Pydev with Eclipse Public License 1.0 4 votes vote down vote up
@Override
public void initializeDefaultPreferences() {
    Preferences node = DefaultScope.INSTANCE.getNode(SharedCorePlugin.DEFAULT_PYDEV_PREFERENCES_SCOPE);

    //use?
    node.putBoolean(PyCodeCompletionPreferences.USE_CODECOMPLETION,
            PyCodeCompletionPreferences.DEFAULT_USE_CODECOMPLETION);
    node.putBoolean(PyCodeCompletionPreferences.USE_CODE_COMPLETION_ON_DEBUG_CONSOLES,
            PyCodeCompletionPreferences.DEFAULT_USE_CODE_COMPLETION_ON_DEBUG_CONSOLES);
    node.putBoolean(PyCodeCompletionPreferences.MATCH_BY_SUBSTRING_IN_CODE_COMPLETION,
            PyCodeCompletionPreferences.DEFAULT_MATCH_BY_SUBSTRING_IN_CODE_COMPLETION);

    //Request
    node.putBoolean(PyCodeCompletionPreferences.AUTOCOMPLETE_ON_DOT,
            PyCodeCompletionPreferences.DEFAULT_AUTOCOMPLETE_ON_DOT);
    node.putBoolean(PyCodeCompletionPreferences.USE_AUTOCOMPLETE,
            PyCodeCompletionPreferences.DEFAULT_USE_AUTOCOMPLETE);
    node.putBoolean(PyCodeCompletionPreferences.AUTOCOMPLETE_ON_PAR,
            PyCodeCompletionPreferences.DEFAULT_AUTOCOMPLETE_ON_PAR);
    node.putBoolean(PyCodeCompletionPreferences.AUTOCOMPLETE_ON_ALL_ASCII_CHARS,
            PyCodeCompletionPreferences.DEFAULT_AUTOCOMPLETE_ON_ALL_ASCII_CHARS);
    node.putInt(PyCodeCompletionPreferences.MAX_MILLIS_FOR_COMPLETION,
            PyCodeCompletionPreferences.DEFAULT_MAX_MILLIS_FOR_COMPLETION);

    //When to apply
    node.putBoolean(PyCodeCompletionPreferences.APPLY_COMPLETION_ON_DOT,
            PyCodeCompletionPreferences.DEFAULT_APPLY_COMPLETION_ON_DOT);
    node.putBoolean(PyCodeCompletionPreferences.APPLY_COMPLETION_ON_LPAREN,
            PyCodeCompletionPreferences.DEFAULT_APPLY_COMPLETION_ON_LPAREN);
    node.putBoolean(PyCodeCompletionPreferences.APPLY_COMPLETION_ON_RPAREN,
            PyCodeCompletionPreferences.DEFAULT_APPLY_COMPLETION_ON_RPAREN);

    //others
    node.putInt(PyCodeCompletionPreferences.ATTEMPTS_CODECOMPLETION,
            PyCodeCompletionPreferences.DEFAULT_ATTEMPTS_CODECOMPLETION);
    node.putInt(PyCodeCompletionPreferences.AUTOCOMPLETE_DELAY,
            PyCodeCompletionPreferences.DEFAULT_AUTOCOMPLETE_DELAY);
    node.putInt(PyCodeCompletionPreferences.ARGUMENTS_DEEP_ANALYSIS_N_CHARS,
            PyCodeCompletionPreferences.DEFAULT_ARGUMENTS_DEEP_ANALYSIS_N_CHARS);
    node.putBoolean(PyCodeCompletionPreferences.PUT_LOCAL_IMPORTS_IN_TOP_OF_METHOD,
            PyCodeCompletionPreferences.DEFAULT_PUT_LOCAL_IMPORTS_IN_TOP_OF_METHOD);

    //Debug
    node.putBoolean(PyLoggingPreferences.DEBUG_CODE_COMPLETION,
            PyLoggingPreferences.DEFAULT_DEBUG_CODE_COMPLETION);
    node.putBoolean(PyLoggingPreferences.DEBUG_ANALYSIS_REQUESTS,
            PyLoggingPreferences.DEFAULT_DEBUG_ANALYSIS_REQUESTS);
    node.putBoolean(PyLoggingPreferences.DEBUG_INTERPRETER_AUTO_UPDATE,
            PyLoggingPreferences.DEFAULT_DEBUG_INTERPRETER_AUTO_UPDATE);

    // Code completion context insensitive
    node.putBoolean(PyCodeCompletionPreferences.USE_KEYWORDS_CODE_COMPLETION,
            PyCodeCompletionPreferences.DEFAULT_USE_KEYWORDS_CODE_COMPLETION);
    node.putBoolean(PyCodeCompletionPreferences.ADD_SPACE_WHEN_NEEDED,
            PyCodeCompletionPreferences.DEFAULT_ADD_SPACES_WHEN_NEEDED);
    node.putBoolean(PyCodeCompletionPreferences.ADD_SPACE_AND_COLON_WHEN_NEEDED,
            PyCodeCompletionPreferences.DEFAULT_ADD_SPACES_AND_COLON_WHEN_NEEDED);
    node.putBoolean(PyCodeCompletionPreferences.FORCE_PY3K_PRINT_ON_PY2,
            PyCodeCompletionPreferences.DEFAULT_FORCE_PY3K_PRINT_ON_PY2);
    node.put(PyCodeCompletionPreferences.KEYWORDS_CODE_COMPLETION,
            PyCodeCompletionPreferences.DEFAULT_KEYWORDS_CODE_COMPLETION);
    node.putInt(PyCodeCompletionPreferences.CHARS_FOR_CTX_INSENSITIVE_MODULES_COMPLETION,
            PyCodeCompletionPreferences.DEFAULT_CHARS_FOR_CTX_INSENSITIVE_MODULES_COMPLETION);
    node.putInt(PyCodeCompletionPreferences.CHARS_FOR_CTX_INSENSITIVE_TOKENS_COMPLETION,
            PyCodeCompletionPreferences.DEFAULT_CHARS_FOR_CTX_INSENSITIVE_TOKENS_COMPLETION);

}
 
Example 16
Source File: PydevConsolePreferencesInitializer.java    From Pydev with Eclipse Public License 1.0 4 votes vote down vote up
@Override
public void initializeDefaultPreferences() {
    Preferences node = DefaultScope.INSTANCE.getNode("org.python.pydev.debug");

    //text
    node.put(PydevConsoleConstants.PREF_CONTINUE_PROMPT, PydevConsoleConstants.DEFAULT_CONTINUE_PROMPT);
    node.put(PydevConsoleConstants.PREF_NEW_PROMPT, PydevConsoleConstants.DEFAULT_NEW_PROMPT);

    node.put(PydevConsoleConstants.CONSOLE_INPUT_COLOR,
            StringConverter.asString(PydevConsoleConstants.DEFAULT_CONSOLE_SYS_IN_COLOR));

    node.put(PydevConsoleConstants.CONSOLE_OUTPUT_COLOR,
            StringConverter.asString(PydevConsoleConstants.DEFAULT_CONSOLE_SYS_OUT_COLOR));

    node.put(PydevConsoleConstants.CONSOLE_ERROR_COLOR,
            StringConverter.asString(PydevConsoleConstants.DEFAULT_CONSOLE_SYS_ERR_COLOR));

    node.put(PydevConsoleConstants.CONSOLE_PROMPT_COLOR,
            StringConverter.asString(PydevConsoleConstants.DEFAULT_CONSOLE_PROMPT_COLOR));

    node.put(PydevConsoleConstants.CONSOLE_BACKGROUND_COLOR,
            StringConverter.asString(PydevConsoleConstants.DEFAULT_CONSOLE_BACKGROUND_COLOR));

    node.put(PydevConsoleConstants.DEBUG_CONSOLE_BACKGROUND_COLOR,
            StringConverter.asString(PydevConsoleConstants.DEFAULT_DEBUG_CONSOLE_BACKGROUND_COLOR));

    node.put(PydevConsoleConstants.INTERACTIVE_CONSOLE_VM_ARGS,
            PydevConsoleConstants.DEFAULT_INTERACTIVE_CONSOLE_VM_ARGS);

    node.put(PydevConsoleConstants.INTERACTIVE_CONSOLE_ENCODING,
            PydevConsoleConstants.DEFAULT_INTERACTIVE_CONSOLE_ENCODING);

    node.put(PydevConsoleConstants.INITIAL_INTERPRETER_CMDS,
            PydevConsoleConstants.DEFAULT_INITIAL_INTERPRETER_CMDS);

    node.put(PydevConsoleConstants.DJANGO_INTERPRETER_CMDS, PydevConsoleConstants.DEFAULT_DJANGO_INTERPRETER_CMDS);

    node.putInt(PydevConsoleConstants.INTERACTIVE_CONSOLE_MAXIMUM_CONNECTION_ATTEMPTS,
            PydevConsoleConstants.DEFAULT_INTERACTIVE_CONSOLE_MAXIMUM_CONNECTION_ATTEMPTS);

    node.putBoolean(PydevConsoleConstants.INTERACTIVE_CONSOLE_FOCUS_ON_CONSOLE_START,
            PydevConsoleConstants.DEFAULT_INTERACTIVE_CONSOLE_FOCUS_ON_CONSOLE_START);

    node.putBoolean(PydevConsoleConstants.INTERACTIVE_CONSOLE_FOCUS_ON_SEND_COMMAND,
            PydevConsoleConstants.DEFAULT_INTERACTIVE_CONSOLE_FOCUS_ON_SEND_COMMAND);

    node.putBoolean(PydevConsoleConstants.INTERACTIVE_CONSOLE_TAB_COMPLETION,
            PydevConsoleConstants.DEFAULT_INTERACTIVE_CONSOLE_TAB_COMPLETION);

    node.putBoolean(PydevConsoleConstants.INTERACTIVE_CONSOLE_CONNECT_DEBUG_SESSION,
            PydevConsoleConstants.DEFAULT_INTERACTIVE_CONSOLE_CONNECT_DEBUG_SESSION);

    node.putBoolean(PydevConsoleConstants.INTERACTIVE_CONSOLE_SEND_INITIAL_COMMAND_WHEN_CREATED_FROM_EDITOR,
            PydevConsoleConstants.DEFAULT_INTERACTIVE_CONSOLE_SEND_INITIAL_COMMAND_WHEN_CREATED_FROM_EDITOR);

    node.put(PydevConsoleConstants.INTERACTIVE_CONSOLE_ENABLE_GUI_ON_STARTUP,
            PydevConsoleConstants.DEFAULT_INTERACTIVE_CONSOLE_ENABLE_GUI_ON_STARTUP);

    node.putBoolean(PydevConsoleConstants.INTERACTIVE_CONSOLE_UMD_ENABLED,
            PydevConsoleConstants.DEFAULT_INTERACTIVE_CONSOLE_UMD_ENABLED);

    node.putBoolean(PydevConsoleConstants.INTERACTIVE_CONSOLE_UMD_VERBOSE,
            PydevConsoleConstants.DEFAULT_INTERACTIVE_CONSOLE_UMD_VERBOSE);

    node.put(PydevConsoleConstants.INTERACTIVE_CONSOLE_UMD_EXCLUDE_MODULE_LIST,
            PydevConsoleConstants.DEFAULT_INTERACTIVE_CONSOLE_UMD_EXCLUDE_MODULE_LIST);
}