本文整理汇总了Java中org.eclipse.core.runtime.preferences.IEclipsePreferences.getInt方法的典型用法代码示例。如果您正苦于以下问题:Java IEclipsePreferences.getInt方法的具体用法?Java IEclipsePreferences.getInt怎么用?Java IEclipsePreferences.getInt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.core.runtime.preferences.IEclipsePreferences
的用法示例。
在下文中一共展示了IEclipsePreferences.getInt方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getDefault
import org.eclipse.core.runtime.preferences.IEclipsePreferences; //导入方法依赖的package包/类
/**
* Does its best at determining the default value for the given key. Checks
* the given object's type and then looks in the list of defaults to see if
* a value exists. If not or if there is a problem converting the value, the
* default default value for that type is returned.
*
* @param key
* the key to search
* @param obj
* the object who default we are looking for
* @return Object or <code>null</code>
*/
Object getDefault(String key, Object obj) {
IEclipsePreferences defaults = getDefaultPreferences();
if (obj instanceof String) {
return defaults.get(key, STRING_DEFAULT_DEFAULT);
} else if (obj instanceof Integer) {
return new Integer(defaults.getInt(key, INT_DEFAULT_DEFAULT));
} else if (obj instanceof Double) {
return new Double(defaults.getDouble(key, DOUBLE_DEFAULT_DEFAULT));
} else if (obj instanceof Float) {
return new Float(defaults.getFloat(key, FLOAT_DEFAULT_DEFAULT));
} else if (obj instanceof Long) {
return new Long(defaults.getLong(key, LONG_DEFAULT_DEFAULT));
} else if (obj instanceof Boolean) {
return defaults.getBoolean(key, BOOLEAN_DEFAULT_DEFAULT) ? Boolean.TRUE
: Boolean.FALSE;
} else {
return null;
}
}
示例2: computeOneXmlIndentString
import org.eclipse.core.runtime.preferences.IEclipsePreferences; //导入方法依赖的package包/类
private String computeOneXmlIndentString() {
char indentChar = ' ';
IEclipsePreferences prefs = InstanceScope.INSTANCE.getNode(XMLCorePlugin.DEFAULT_CATALOG_ID);
String indentCharPref = prefs.get(XMLCorePreferenceNames.INDENTATION_CHAR, null);
if (XMLCorePreferenceNames.TAB.equals(indentCharPref)) {
indentChar = '\t';
}
int indentationWidth = prefs.getInt(XMLCorePreferenceNames.INDENTATION_SIZE, 0);
StringBuilder indent = new StringBuilder();
for (int i = 0; i < indentationWidth; i++) {
indent.append(indentChar);
}
return indent.toString();
}
示例3: WorkspaceDescription
import org.eclipse.core.runtime.preferences.IEclipsePreferences; //导入方法依赖的package包/类
public WorkspaceDescription(String name) {
super(name);
// initialize based on the values in the default preferences
IEclipsePreferences node = DefaultScope.INSTANCE.getNode(ResourcesPlugin.PI_RESOURCES);
autoBuilding =
node.getBoolean(
ResourcesPlugin.PREF_AUTO_BUILDING, PreferenceInitializer.PREF_AUTO_BUILDING_DEFAULT);
maxBuildIterations =
node.getInt(
ResourcesPlugin.PREF_MAX_BUILD_ITERATIONS,
PreferenceInitializer.PREF_MAX_BUILD_ITERATIONS_DEFAULT);
applyFileStatePolicy =
node.getBoolean(
ResourcesPlugin.PREF_APPLY_FILE_STATE_POLICY,
PreferenceInitializer.PREF_APPLY_FILE_STATE_POLICY_DEFAULT);
fileStateLongevity =
node.getLong(
ResourcesPlugin.PREF_FILE_STATE_LONGEVITY,
PreferenceInitializer.PREF_FILE_STATE_LONGEVITY_DEFAULT);
maxFileStates =
node.getInt(
ResourcesPlugin.PREF_MAX_FILE_STATES,
PreferenceInitializer.PREF_MAX_FILE_STATES_DEFAULT);
maxFileStateSize =
node.getLong(
ResourcesPlugin.PREF_MAX_FILE_STATE_SIZE,
PreferenceInitializer.PREF_MAX_FILE_STATE_SIZE_DEFAULT);
snapshotInterval =
node.getLong(
ResourcesPlugin.PREF_SNAPSHOT_INTERVAL,
PreferenceInitializer.PREF_SNAPSHOT_INTERVAL_DEFAULT);
operationsPerSnapshot =
node.getInt(
PreferenceInitializer.PREF_OPERATIONS_PER_SNAPSHOT,
PreferenceInitializer.PREF_OPERATIONS_PER_SNAPSHOT_DEFAULT);
deltaExpiration =
node.getLong(
PreferenceInitializer.PREF_DELTA_EXPIRATION,
PreferenceInitializer.PREF_DELTA_EXPIRATION_DEFAULT);
}
示例4: loadChoosedPage
import org.eclipse.core.runtime.preferences.IEclipsePreferences; //导入方法依赖的package包/类
protected int loadChoosedPage() {
IEclipsePreferences node = InstanceScope.INSTANCE.getNode(PrefEditorPlugin.PLUGIN_ID);
return node.getInt(CHOOSED_PAGE_PREF, 0);
}
示例5: getColorForNode
import org.eclipse.core.runtime.preferences.IEclipsePreferences; //导入方法依赖的package包/类
public Integer getColorForNode(String node) {
IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(GlobalSettings.get("AnalysisProject"));
IScopeContext projectScope = new ProjectScope(project);
IEclipsePreferences pref = projectScope.getNode(Activator.PLUGIN_ID);
return pref.getInt(node, 0);
}
示例6: getProjectMigratorVersion
import org.eclipse.core.runtime.preferences.IEclipsePreferences; //导入方法依赖的package包/类
public static int getProjectMigratorVersion(IProject project) {
IEclipsePreferences instancePrefs = getInstancePreferences();
return instancePrefs.getInt(PROJECT_MIGRATOR_VERSION + project.getName(), 0);
}