本文整理汇总了Java中org.osgi.service.prefs.Preferences.putInt方法的典型用法代码示例。如果您正苦于以下问题:Java Preferences.putInt方法的具体用法?Java Preferences.putInt怎么用?Java Preferences.putInt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.osgi.service.prefs.Preferences
的用法示例。
在下文中一共展示了Preferences.putInt方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: persist
import org.osgi.service.prefs.Preferences; //导入方法依赖的package包/类
/**
* Persists table column widths. Users of this class should have already
* added some mappings before calling this method.
*/
public void persist() {
final Preferences node = getPreferencesNode(key);
for (final Iterator it = mappings.keySet().iterator(); it.hasNext();) {
final String columnKey = (String) it.next();
final int ix = getIndexForKey(columnKey);
if (ix == -1) {
continue;
}
final int width = tableColumnWidths[ix];
if (width > 0) {
node.putInt(columnKey, width);
}
}
try {
node.flush();
} catch (final BackingStoreException e) {
log.warn("can't flush prefs node", e); //$NON-NLS-1$
return;
}
}
示例2: performOk
import org.osgi.service.prefs.Preferences; //导入方法依赖的package包/类
public boolean performOk() {
MergeFileAssociation[] currentAssociations = getMergeFileAssociations();
for (int i = 0; i < currentAssociations.length; i++) {
currentAssociations[i].remove();
}
for (int i = 0; i < mergeFileAssociations.length; i++) {
Preferences prefs = MergeFileAssociation.getParentPreferences().node(mergeFileAssociations[i].getFileType());
if (mergeFileAssociations[i].getMergeProgram() == null) prefs.put("mergeProgram", ""); //$NON-NLS-1$ //$NON-NLS-1$ //$NON-NLS-2$
else prefs.put("mergeProgram", mergeFileAssociations[i].getMergeProgram()); //$NON-NLS-1$
if (mergeFileAssociations[i].getParameters() == null)prefs.put("parameters", ""); //$NON-NLS-1$ //$NON-NLS-1$ //$NON-NLS-2$
else prefs.put("parameters", mergeFileAssociations[i].getParameters()); //$NON-NLS-1$
prefs.putInt("type", mergeFileAssociations[i].getType()); //$NON-NLS-1$
try {
prefs.flush();
} catch (BackingStoreException e) {}
}
return super.performOk();
}
示例3: initializeDefaultPreferences
import org.osgi.service.prefs.Preferences; //导入方法依赖的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);
}
示例4: initializeDefaultPreferences
import org.osgi.service.prefs.Preferences; //导入方法依赖的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);
}
示例5: initializeDefaultPreferences
import org.osgi.service.prefs.Preferences; //导入方法依赖的package包/类
@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);
}
示例6: writeConfig
import org.osgi.service.prefs.Preferences; //导入方法依赖的package包/类
public static void writeConfig(ArrayList<Group> groups) throws BackingStoreException {
IEclipsePreferences pref = getPreferences();
pref.clear();
for(Group g: groups) {
Preferences prefG = pref.node(GROUPID + g.getGroupID());
ArrayList<String> members = g.getGroupMembers();
prefG.putInt(MEMBERCOUNT, members.size());
for(int i = 0; i < members.size(); ++i) {
prefG.put(MEMBER + i, members.get(i));
}
}
pref.flush();
}
示例7: initializeDefaultPreferences
import org.osgi.service.prefs.Preferences; //导入方法依赖的package包/类
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);
}
示例8: initializeDefaultPreferences
import org.osgi.service.prefs.Preferences; //导入方法依赖的package包/类
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);
}
示例9: initializeDefaultPreferences
import org.osgi.service.prefs.Preferences; //导入方法依赖的package包/类
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);
}
示例10: initializeDefaultPreferences
import org.osgi.service.prefs.Preferences; //导入方法依赖的package包/类
@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)));
}
示例11: initializeDefaultPreferences
import org.osgi.service.prefs.Preferences; //导入方法依赖的package包/类
@Override
public void initializeDefaultPreferences() {
Preferences node = DefaultScope.INSTANCE.getNode(DEFAULT_SCOPE);
node.putBoolean(USE_KEYWORDS_CODE_COMPLETION, DEFAULT_USE_KEYWORDS_CODE_COMPLETION);
node.putBoolean(ADD_SPACE_WHEN_NEEDED, DEFAULT_ADD_SPACES_WHEN_NEEDED);
node.putBoolean(ADD_SPACE_AND_COLON_WHEN_NEEDED, DEFAULT_ADD_SPACES_AND_COLON_WHEN_NEEDED);
node.putBoolean(FORCE_PY3K_PRINT_ON_PY2, DEFAULT_FORCE_PY3K_PRINT_ON_PY2);
node.put(KEYWORDS_CODE_COMPLETION, DEFAULT_KEYWORDS_CODE_COMPLETION);
node.putInt(CHARS_FOR_CTX_INSENSITIVE_MODULES_COMPLETION, DEFAULT_CHARS_FOR_CTX_INSENSITIVE_MODULES_COMPLETION);
node.putInt(CHARS_FOR_CTX_INSENSITIVE_TOKENS_COMPLETION, DEFAULT_CHARS_FOR_CTX_INSENSITIVE_TOKENS_COMPLETION);
}
示例12: initializeDefaultPreferences
import org.osgi.service.prefs.Preferences; //导入方法依赖的package包/类
@Override
public void initializeDefaultPreferences() {
Preferences node = DefaultScope.INSTANCE.getNode(InteractiveConsolePlugin.PLUGIN_ID);
//console history
node.putInt(ScriptConsoleUIConstants.INTERACTIVE_CONSOLE_PERSISTENT_HISTORY_MAXIMUM_ENTRIES,
ScriptConsoleUIConstants.DEFAULT_INTERACTIVE_CONSOLE_PERSISTENT_HISTORY_MAXIMUM_ENTRIES);
}
示例13: initializeDefaultPreferences
import org.osgi.service.prefs.Preferences; //导入方法依赖的package包/类
@Override
public void initializeDefaultPreferences() {
Preferences node = DefaultScope.INSTANCE.getNode(PydevPlugin.DEFAULT_PYDEV_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);
}
示例14: initializeDefaultPreferences
import org.osgi.service.prefs.Preferences; //导入方法依赖的package包/类
@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(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();
}
示例15: initializeDefaultPreferences
import org.osgi.service.prefs.Preferences; //导入方法依赖的package包/类
@Override
public void initializeDefaultPreferences() {
Preferences node = DefaultScope.INSTANCE.getNode(PydevPlugin.DEFAULT_PYDEV_SCOPE);
//use?
node.putBoolean(PyCodeCompletionPreferencesPage.USE_CODECOMPLETION,
PyCodeCompletionPreferencesPage.DEFAULT_USE_CODECOMPLETION);
node.putBoolean(PyCodeCompletionPreferencesPage.USE_CODE_COMPLETION_ON_DEBUG_CONSOLES,
PyCodeCompletionPreferencesPage.DEFAULT_USE_CODE_COMPLETION_ON_DEBUG_CONSOLES);
node.putBoolean(PyCodeCompletionPreferencesPage.MATCH_BY_SUBSTRING_IN_CODE_COMPLETION,
PyCodeCompletionPreferencesPage.DEFAULT_MATCH_BY_SUBSTRING_IN_CODE_COMPLETION);
//Request
node.putBoolean(PyCodeCompletionPreferencesPage.AUTOCOMPLETE_ON_DOT,
PyCodeCompletionPreferencesPage.DEFAULT_AUTOCOMPLETE_ON_DOT);
node.putBoolean(PyCodeCompletionPreferencesPage.USE_AUTOCOMPLETE,
PyCodeCompletionPreferencesPage.DEFAULT_USE_AUTOCOMPLETE);
node.putBoolean(PyCodeCompletionPreferencesPage.AUTOCOMPLETE_ON_PAR,
PyCodeCompletionPreferencesPage.DEFAULT_AUTOCOMPLETE_ON_PAR);
node.putBoolean(PyCodeCompletionPreferencesPage.AUTOCOMPLETE_ON_ALL_ASCII_CHARS,
PyCodeCompletionPreferencesPage.DEFAULT_AUTOCOMPLETE_ON_ALL_ASCII_CHARS);
node.putInt(PyCodeCompletionPreferencesPage.MAX_MILLIS_FOR_COMPLETION,
PyCodeCompletionPreferencesPage.DEFAULT_MAX_MILLIS_FOR_COMPLETION);
//When to apply
node.putBoolean(PyCodeCompletionPreferencesPage.APPLY_COMPLETION_ON_DOT,
PyCodeCompletionPreferencesPage.DEFAULT_APPLY_COMPLETION_ON_DOT);
node.putBoolean(PyCodeCompletionPreferencesPage.APPLY_COMPLETION_ON_LPAREN,
PyCodeCompletionPreferencesPage.DEFAULT_APPLY_COMPLETION_ON_LPAREN);
node.putBoolean(PyCodeCompletionPreferencesPage.APPLY_COMPLETION_ON_RPAREN,
PyCodeCompletionPreferencesPage.DEFAULT_APPLY_COMPLETION_ON_RPAREN);
//others
node.putInt(PyCodeCompletionPreferencesPage.ATTEMPTS_CODECOMPLETION,
PyCodeCompletionPreferencesPage.DEFAULT_ATTEMPTS_CODECOMPLETION);
node.putInt(PyCodeCompletionPreferencesPage.AUTOCOMPLETE_DELAY,
PyCodeCompletionPreferencesPage.DEFAULT_AUTOCOMPLETE_DELAY);
node.putInt(PyCodeCompletionPreferencesPage.ARGUMENTS_DEEP_ANALYSIS_N_CHARS,
PyCodeCompletionPreferencesPage.DEFAULT_ARGUMENTS_DEEP_ANALYSIS_N_CHARS);
node.putBoolean(PyCodeCompletionPreferencesPage.PUT_LOCAL_IMPORTS_IN_TOP_OF_METHOD,
PyCodeCompletionPreferencesPage.DEFAULT_PUT_LOCAL_IMPORTS_IN_TOP_OF_METHOD);
//Debug
node.putBoolean(PyLoggingPreferencesPage.DEBUG_CODE_COMPLETION,
PyLoggingPreferencesPage.DEFAULT_DEBUG_CODE_COMPLETION);
node.putBoolean(PyLoggingPreferencesPage.DEBUG_ANALYSIS_REQUESTS,
PyLoggingPreferencesPage.DEFAULT_DEBUG_ANALYSIS_REQUESTS);
node.putBoolean(PyLoggingPreferencesPage.DEBUG_INTERPRETER_AUTO_UPDATE,
PyLoggingPreferencesPage.DEFAULT_DEBUG_INTERPRETER_AUTO_UPDATE);
}