本文整理汇总了Java中org.eclipse.core.runtime.preferences.IEclipsePreferences.putInt方法的典型用法代码示例。如果您正苦于以下问题:Java IEclipsePreferences.putInt方法的具体用法?Java IEclipsePreferences.putInt怎么用?Java IEclipsePreferences.putInt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.core.runtime.preferences.IEclipsePreferences
的用法示例。
在下文中一共展示了IEclipsePreferences.putInt方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: performOk
import org.eclipse.core.runtime.preferences.IEclipsePreferences; //导入方法依赖的package包/类
/**
* @see org.eclipse.jface.preference.IPreferencePage#performOk()
*/
public boolean performOk() {
IEclipsePreferences prefs = MsgEditorPreferences.getEclipsePreferenceStore();
prefs.putInt(MsgEditorPreferences.REPORT_MISSING_VALUES_LEVEL, reportMissingVals.getSelectionIndex());
prefs.putInt(MsgEditorPreferences.REPORT_DUPL_VALUES_LEVEL, reportDuplVals.getSelectionIndex());
prefs.putInt(MsgEditorPreferences.REPORT_SIM_VALUES_LEVEL, reportSimVals.getSelectionIndex());
prefs.putBoolean(MsgEditorPreferences.REPORT_SIM_VALUES_WORD_COMPARE,reportSimValsMode[0].getSelection());
prefs.putBoolean(MsgEditorPreferences.REPORT_SIM_VALUES_LEVENSTHEIN, reportSimValsMode[1].getSelection());
double precision = 0.75d;
try{
double textPrecision = Double.parseDouble(reportSimPrecision.getText());
precision = textPrecision;
} catch (NumberFormatException ex){}
prefs.putDouble(MsgEditorPreferences.REPORT_SIM_VALUES_PRECISION, precision);
try {
prefs.flush();
} catch (BackingStoreException e) {
e.printStackTrace();
}
refreshEnabledStatuses();
return super.performOk();
}
示例2: initializeDefaultPreferences
import org.eclipse.core.runtime.preferences.IEclipsePreferences; //导入方法依赖的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() );
}
}
}
}
示例3: updateInitialPerspectiveVersion
import org.eclipse.core.runtime.preferences.IEclipsePreferences; //导入方法依赖的package包/类
private void updateInitialPerspectiveVersion()
{
// updates the initial stored version so that user won't get a prompt on a new workspace
boolean hasStartedBefore = Platform.getPreferencesService().getBoolean(PLUGIN_ID,
IPreferenceConstants.IDE_HAS_LAUNCHED_BEFORE, false, null);
if (!hasStartedBefore)
{
IEclipsePreferences prefs = (EclipseUtil.instanceScope()).getNode(PLUGIN_ID);
prefs.putInt(IPreferenceConstants.PERSPECTIVE_VERSION, WebPerspectiveFactory.VERSION);
prefs.putBoolean(IPreferenceConstants.IDE_HAS_LAUNCHED_BEFORE, true);
try
{
prefs.flush();
}
catch (BackingStoreException e)
{
IdeLog.logError(getDefault(), Messages.UIPlugin_ERR_FailToSetPref, e);
}
}
}
示例4: setPluginDefaults
import org.eclipse.core.runtime.preferences.IEclipsePreferences; //导入方法依赖的package包/类
/**
* This method re-applies the plugin defaults for the spaces for tabs and tab width preferences from the default
* scope of the plugin preference store. The default values are taken from getDefaultTabWidth() and
* getDefaultSpacesForTabs(). The default scope getDefaultPluginPreferenceStore() is used.
*/
protected void setPluginDefaults()
{
IEclipsePreferences store = getDefaultPluginPreferenceStore();
if (store == null)
{
return;
}
store.putBoolean(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_SPACES_FOR_TABS,
getDefaultSpacesForTabs());
store.putInt(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_TAB_WIDTH, getDefaultTabWidth());
try
{
store.flush();
}
catch (BackingStoreException e)
{
IdeLog.logError(CommonEditorPlugin.getDefault(), e);
}
}
示例5: saveChoosedPage
import org.eclipse.core.runtime.preferences.IEclipsePreferences; //导入方法依赖的package包/类
protected void saveChoosedPage(int selectionIndex) {
IEclipsePreferences node = InstanceScope.INSTANCE.getNode(PrefEditorPlugin.PLUGIN_ID);
node.putInt(CHOOSED_PAGE_PREF, selectionIndex);
try {
node.flush();
} catch (BackingStoreException e) {
PrefEditorPlugin.log(e);
}
}
示例6: createPreferences
import org.eclipse.core.runtime.preferences.IEclipsePreferences; //导入方法依赖的package包/类
public void createPreferences() {
IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(GlobalSettings.get("AnalysisProject"));
IScopeContext projectScope = new ProjectScope(project);
IEclipsePreferences pref = projectScope.getNode(Activator.PLUGIN_ID);
for (String stmt : getStatementTypes()) {
// pref.putInt(stmt, -16743169);
pref.putInt(stmt, -6037505);
}
try {
pref.flush();
} catch (BackingStoreException e) {
e.printStackTrace();
}
}
示例7: updateColorPreferences
import org.eclipse.core.runtime.preferences.IEclipsePreferences; //导入方法依赖的package包/类
public void updateColorPreferences(String stmtType, int color) {
IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(GlobalSettings.get("AnalysisProject"));
IScopeContext projectScope = new ProjectScope(project);
IEclipsePreferences pref = projectScope.getNode(Activator.PLUGIN_ID);
pref.putInt(stmtType, color);
try {
pref.flush();
} catch (BackingStoreException e) {
e.printStackTrace();
}
}
示例8: initializeSeverities
import org.eclipse.core.runtime.preferences.IEclipsePreferences; //导入方法依赖的package包/类
private void initializeSeverities(final IEclipsePreferences preferences) {
preferences.putInt("COM.AVALOQ.TOOLS.DDK.CHECK.VALIDATION.LIBRARYCHECKSISSUECODES.CHECK.CATALOG.IS.ACTIVE$SEVERITY", 1);
preferences.putInt("COM.AVALOQ.TOOLS.DDK.CHECK.VALIDATION.LIBRARYCHECKSISSUECODES.CACHE.INJECTION.FAILED$SEVERITY", 0);
preferences.putInt("COM.AVALOQ.TOOLS.DDK.CHECK.VALIDATION.LIBRARYCHECKSISSUECODES.CACHE.DOESNT.WORK$SEVERITY", 0);
preferences.putInt("COM.AVALOQ.TOOLS.DDK.CHECK.VALIDATION.LIBRARYCHECKSISSUECODES.FORMAL.PARAMETERS$SEVERITY", 0);
}
示例9: initializeEditorFormatOptions
import org.eclipse.core.runtime.preferences.IEclipsePreferences; //导入方法依赖的package包/类
private void initializeEditorFormatOptions(IEclipsePreferences node) {
node.putBoolean(TypeScriptCorePreferenceConstants.EDITOR_OPTIONS_CONVERT_TABS_TO_SPACES,
TypeScriptCorePreferenceConstants.EDITOR_OPTIONS_CONVERT_TABS_TO_SPACES_DEFAULT);
node.putInt(TypeScriptCorePreferenceConstants.EDITOR_OPTIONS_INDENT_SIZE,
TypeScriptCorePreferenceConstants.EDITOR_OPTIONS_INDENT_SIZE_DEFAULT);
node.putInt(TypeScriptCorePreferenceConstants.EDITOR_OPTIONS_TAB_SIZE,
TypeScriptCorePreferenceConstants.EDITOR_OPTIONS_TAB_SIZE_DEFAULT);
node.putBoolean(TypeScriptCorePreferenceConstants.FORMAT_OPTIONS_INSERT_SPACE_AFTER_COMMA_DELIMITER,
TypeScriptCorePreferenceConstants.FORMAT_OPTIONS_INSERT_SPACE_AFTER_COMMA_DELIMITER_DEFAULT);
node.putBoolean(TypeScriptCorePreferenceConstants.FORMAT_OPTIONS_INSERT_SPACE_AFTER_SEMICOLON_IN_FOR_STATEMENTS,
TypeScriptCorePreferenceConstants.FORMAT_OPTIONS_INSERT_SPACE_AFTER_SEMICOLON_IN_FOR_STATEMENTS_DEFAULT);
node.putBoolean(TypeScriptCorePreferenceConstants.FORMAT_OPTIONS_INSERT_SPACE_BEFORE_AND_AFTER_BINARY_OPERATORS,
TypeScriptCorePreferenceConstants.FORMAT_OPTIONS_INSERT_SPACE_BEFORE_AND_AFTER_BINARY_OPERATORS_DEFAULT);
node.putBoolean(
TypeScriptCorePreferenceConstants.FORMAT_OPTIONS_INSERT_SPACE_AFTER_KEYWORDS_IN_CONTROL_FLOW_STATEMENTS,
TypeScriptCorePreferenceConstants.FORMAT_OPTIONS_INSERT_SPACE_AFTER_KEYWORDS_IN_CONTROL_FLOW_STATEMENTS_DEFAULT);
node.putBoolean(
TypeScriptCorePreferenceConstants.FORMAT_OPTIONS_INSERT_SPACE_AFTER_FUNCTION_KEYWORD_FOR_ANONYMOUS_FUNCTIONS,
TypeScriptCorePreferenceConstants.FORMAT_OPTIONS_INSERT_SPACE_AFTER_FUNCTION_KEYWORD_FOR_ANONYMOUS_FUNCTIONS_DEFAULT);
node.putBoolean(
TypeScriptCorePreferenceConstants.FORMAT_OPTIONS_INSERT_SPACE_AFTER_OPENING_AND_BEFORE_CLOSING_NONEMPTY_PARENTHESIS,
TypeScriptCorePreferenceConstants.FORMAT_OPTIONS_INSERT_SPACE_AFTER_OPENING_AND_BEFORE_CLOSING_NONEMPTY_PARENTHESIS_DEFAULT);
node.putBoolean(
TypeScriptCorePreferenceConstants.FORMAT_OPTIONS_INSERT_SPACE_AFTER_OPENING_AND_BEFORE_CLOSING_NONEMPTY_BRACKETS,
TypeScriptCorePreferenceConstants.FORMAT_OPTIONS_INSERT_SPACE_AFTER_OPENING_AND_BEFORE_CLOSING_NONEMPTY_BRACKETS_DEFAULT);
node.putBoolean(TypeScriptCorePreferenceConstants.FORMAT_OPTIONS_PLACE_OPEN_BRACE_ON_NEW_LINE_FOR_FUNCTIONS,
TypeScriptCorePreferenceConstants.FORMAT_OPTIONS_PLACE_OPEN_BRACE_ON_NEW_LINE_FOR_FUNCTIONS_DEFAULT);
node.putBoolean(
TypeScriptCorePreferenceConstants.FORMAT_OPTIONS_PLACE_OPEN_BRACE_ON_NEW_LINE_FOR_CONTROL_BLOCKS,
TypeScriptCorePreferenceConstants.FORMAT_OPTIONS_PLACE_OPEN_BRACE_ON_NEW_LINE_FOR_CONTROL_BLOCKS_DEFAULT);
}
示例10: initializeDefaultPreferences
import org.eclipse.core.runtime.preferences.IEclipsePreferences; //导入方法依赖的package包/类
@Override
public void initializeDefaultPreferences() {
IEclipsePreferences node = DefaultScope.INSTANCE.getNode(ResourcesPlugin.PI_RESOURCES);
// auto-refresh default
node.putBoolean(ResourcesPlugin.PREF_AUTO_REFRESH, PREF_AUTO_REFRESH_DEFAULT);
node.putBoolean(
ResourcesPlugin.PREF_LIGHTWEIGHT_AUTO_REFRESH, PREF_LIGHTWEIGHT_AUTO_REFRESH_DEFAULT);
// linked resources default
node.putBoolean(ResourcesPlugin.PREF_DISABLE_LINKING, PREF_DISABLE_LINKING_DEFAULT);
// build manager defaults
node.putBoolean(ResourcesPlugin.PREF_AUTO_BUILDING, PREF_AUTO_BUILDING_DEFAULT);
node.put(ResourcesPlugin.PREF_BUILD_ORDER, PREF_BUILD_ORDER_DEFAULT);
node.putInt(ResourcesPlugin.PREF_MAX_BUILD_ITERATIONS, PREF_MAX_BUILD_ITERATIONS_DEFAULT);
node.putBoolean(ResourcesPlugin.PREF_DEFAULT_BUILD_ORDER, PREF_DEFAULT_BUILD_ORDER_DEFAULT);
// history store defaults
node.putBoolean(
ResourcesPlugin.PREF_APPLY_FILE_STATE_POLICY, PREF_APPLY_FILE_STATE_POLICY_DEFAULT);
node.putLong(ResourcesPlugin.PREF_FILE_STATE_LONGEVITY, PREF_FILE_STATE_LONGEVITY_DEFAULT);
node.putLong(ResourcesPlugin.PREF_MAX_FILE_STATE_SIZE, PREF_MAX_FILE_STATE_SIZE_DEFAULT);
node.putInt(ResourcesPlugin.PREF_MAX_FILE_STATES, PREF_MAX_FILE_STATES_DEFAULT);
// save manager defaults
node.putLong(ResourcesPlugin.PREF_SNAPSHOT_INTERVAL, PREF_SNAPSHOT_INTERVAL_DEFAULT);
node.putInt(PREF_OPERATIONS_PER_SNAPSHOT, PREF_OPERATIONS_PER_SNAPSHOT_DEFAULT);
node.putLong(PREF_DELTA_EXPIRATION, PREF_DELTA_EXPIRATION_DEFAULT);
// encoding defaults
node.put(ResourcesPlugin.PREF_ENCODING, PREF_ENCODING_DEFAULT);
}
示例11: setSourceViewerServerPort
import org.eclipse.core.runtime.preferences.IEclipsePreferences; //导入方法依赖的package包/类
/**
* Sets the port number to use for the SourceViewerServer.
*
* @param port the port number to save
*/
public static void setSourceViewerServerPort(int port) {
IEclipsePreferences workspacePreferences = getEclipsePreferences();
workspacePreferences.putInt(SOURCE_VIEWER_SERVER_PORT, port);
try {
workspacePreferences.flush();
} catch (BackingStoreException e) {
CorePluginLog.logError(e);
}
}
示例12: performOk
import org.eclipse.core.runtime.preferences.IEclipsePreferences; //导入方法依赖的package包/类
/**
* @see org.eclipse.jface.preference.IPreferencePage#performOk()
*/
public boolean performOk() {
IEclipsePreferences prefs = MsgEditorPreferences.getEclipsePreferenceStore();
prefs.putBoolean(MsgEditorPreferences.SHOW_SUPPORT_ENABLED, showGeneratedBy.getSelection());
prefs.putBoolean(MsgEditorPreferences.UNICODE_ESCAPE_ENABLED, convertUnicodeToEncoded.getSelection());
prefs.putBoolean(MsgEditorPreferences.UNICODE_ESCAPE_UPPERCASE,convertUnicodeUpperCase.getSelection());
prefs.putBoolean(MsgEditorPreferences.ALIGN_EQUALS_ENABLED, alignEqualSigns.getSelection());
prefs.putBoolean(MsgEditorPreferences.SPACES_AROUND_EQUALS_ENABLED,ensureSpacesAroundEquals.getSelection());
prefs.putBoolean(MsgEditorPreferences.GROUP_KEYS_ENABLED,groupKeys.getSelection());
prefs.put(MsgEditorPreferences.GROUP_LEVEL_DEEP, groupLevelDeep.getText());
prefs.put(MsgEditorPreferences.GROUP_SEP_BLANK_LINE_COUNT,groupLineBreaks.getText());
prefs.putBoolean(MsgEditorPreferences.GROUP_ALIGN_EQUALS_ENABLED, groupAlignEqualSigns.getSelection());
prefs.putBoolean(MsgEditorPreferences.WRAP_LINES_ENABLED, wrapLines.getSelection());
prefs.put(MsgEditorPreferences.WRAP_LINE_LENGTH,wrapCharLimit.getText());
prefs.putBoolean(MsgEditorPreferences.WRAP_ALIGN_EQUALS_ENABLED,wrapAlignEqualSigns.getSelection());
prefs.put(MsgEditorPreferences.WRAP_INDENT_LENGTH, wrapIndentSpaces.getText());
prefs.putBoolean(MsgEditorPreferences.NEW_LINE_NICE, wrapNewLine.getSelection());
prefs.putBoolean(MsgEditorPreferences.FORCE_NEW_LINE_TYPE, newLineTypeForce.getSelection());
for (int i = 0; i < newLineTypes.length; i++) {
if (newLineTypes[i].getSelection()) {
prefs.putInt(MsgEditorPreferences.NEW_LINE_STYLE, i + 1);
}
}
prefs.putBoolean(MsgEditorPreferences.KEEP_EMPTY_FIELDS,keepEmptyFields.getSelection());
prefs.putBoolean(MsgEditorPreferences.SORT_KEYS, sortKeys.getSelection());
try {
prefs.flush();
} catch (BackingStoreException e) {
e.printStackTrace();
}
refreshEnabledStatuses();
return super.performOk();
}
示例13: initializeDefaultPreferences
import org.eclipse.core.runtime.preferences.IEclipsePreferences; //导入方法依赖的package包/类
@Override
public void initializeDefaultPreferences()
{
IEclipsePreferences store = EclipseUtil.defaultScope().getNode(XMLFormatterPlugin.PLUGIN_ID);
store.put(XMLFormatterConstants.FORMATTER_TAB_CHAR, CodeFormatterConstants.EDITOR);
store.put(XMLFormatterConstants.FORMATTER_TAB_SIZE,
Integer.toString(EditorUtil.getSpaceIndentSize(XMLPlugin.getDefault().getBundle().getSymbolicName())));
store.put(XMLFormatterConstants.FORMATTER_INDENTATION_SIZE, "4"); //$NON-NLS-1$
store.putBoolean(XMLFormatterConstants.WRAP_COMMENTS, false);
store.putInt(XMLFormatterConstants.WRAP_COMMENTS_LENGTH, 80);
// No excluded tags by default
store.put(XMLFormatterConstants.INDENT_EXCLUDED_TAGS, StringUtil.EMPTY);
store.put(XMLFormatterConstants.NEW_LINES_EXCLUDED_TAGS, StringUtil.EMPTY);
store.putBoolean(XMLFormatterConstants.NEW_LINES_EXCLUDED_ON_TEXT_NODES, true);
store.putInt(XMLFormatterConstants.LINES_AFTER_ELEMENTS, 0);
store.putInt(XMLFormatterConstants.LINES_AFTER_NON_XML_ELEMENTS, 1);
store.putInt(XMLFormatterConstants.LINES_BEFORE_NON_XML_ELEMENTS, 1);
store.putInt(XMLFormatterConstants.PRESERVED_LINES, 1);
store.putBoolean(XMLFormatterConstants.FORMATTER_OFF_ON_ENABLED, false);
store.put(XMLFormatterConstants.FORMATTER_ON, XMLFormatterConstants.DEFAULT_FORMATTER_ON);
store.put(XMLFormatterConstants.FORMATTER_OFF, XMLFormatterConstants.DEFAULT_FORMATTER_OFF);
try
{
store.flush();
}
catch (BackingStoreException e)
{
IdeLog.logError(XMLFormatterPlugin.getDefault(), e, IDebugScopes.DEBUG);
}
}
示例14: initializeDefaultPreferences
import org.eclipse.core.runtime.preferences.IEclipsePreferences; //导入方法依赖的package包/类
@Override
public void initializeDefaultPreferences()
{
IEclipsePreferences pref = EclipseUtil.defaultScope().getNode(CSSFormatterPlugin.PLUGIN_ID);
pref.put(CSSFormatterConstants.FORMATTER_TAB_CHAR, CodeFormatterConstants.EDITOR);
pref.put(CSSFormatterConstants.FORMATTER_TAB_SIZE,
Integer.toString(EditorUtil.getSpaceIndentSize(CSSPlugin.getDefault().getBundle().getSymbolicName())));
pref.put(CSSFormatterConstants.FORMATTER_INDENTATION_SIZE, "4"); //$NON-NLS-1$
pref.putBoolean(CSSFormatterConstants.WRAP_COMMENTS, false);
pref.putInt(CSSFormatterConstants.WRAP_COMMENTS_LENGTH, 80);
pref.put(CSSFormatterConstants.NEW_LINES_BEFORE_BLOCKS, CodeFormatterConstants.SAME_LINE);
pref.putInt(CSSFormatterConstants.LINES_AFTER_ELEMENTS, 0);
pref.putInt(CSSFormatterConstants.LINES_AFTER_DECLARATION, 0);
pref.putInt(CSSFormatterConstants.PRESERVED_LINES, 1);
pref.putInt(CSSFormatterConstants.SPACES_BEFORE_COMMAS, 0);
pref.putInt(CSSFormatterConstants.SPACES_AFTER_COMMAS, 1);
pref.putInt(CSSFormatterConstants.SPACES_BEFORE_SEMICOLON, 0);
pref.putInt(CSSFormatterConstants.SPACES_AFTER_SEMICOLON, 0);
pref.putInt(CSSFormatterConstants.SPACES_BEFORE_PARENTHESES, 1);
pref.putInt(CSSFormatterConstants.SPACES_AFTER_PARENTHESES, 1);
pref.putInt(CSSFormatterConstants.SPACES_BEFORE_COLON, 0);
pref.putInt(CSSFormatterConstants.SPACES_AFTER_COLON, 1);
pref.putInt(CSSFormatterConstants.SPACES_BEFORE_CHILD_COMBINATOR, 1);
pref.putInt(CSSFormatterConstants.SPACES_AFTER_CHILD_COMBINATOR, 1);
pref.putBoolean(CSSFormatterConstants.FORMATTER_OFF_ON_ENABLED, false);
pref.put(CSSFormatterConstants.FORMATTER_ON, CSSFormatterConstants.DEFAULT_FORMATTER_ON);
pref.put(CSSFormatterConstants.FORMATTER_OFF, CSSFormatterConstants.DEFAULT_FORMATTER_OFF);
try
{
pref.flush();
}
catch (BackingStoreException e)
{
IdeLog.logError(CSSFormatterPlugin.getDefault(), e, IDebugScopes.DEBUG);
}
}
示例15: setPreferences
import org.eclipse.core.runtime.preferences.IEclipsePreferences; //导入方法依赖的package包/类
private void setPreferences(IEclipsePreferences prefs, Map<String, ? extends Object> preferences)
{
if (CollectionsUtil.isEmpty(preferences))
{
return;
}
for (Map.Entry<String, ? extends Object> entry : preferences.entrySet())
{
Object value = entry.getValue();
if (value instanceof Boolean)
{
prefs.putBoolean(entry.getKey(), (Boolean) value);
}
else if (value instanceof Long)
{
prefs.putLong(entry.getKey(), (Long) value);
}
else if (value instanceof Integer)
{
prefs.putInt(entry.getKey(), (Integer) value);
}
else if (value instanceof Double)
{
prefs.putDouble(entry.getKey(), (Double) value);
}
else if (value != null)
{
prefs.put(entry.getKey(), value.toString());
}
}
}