/** * Returns the default value for the integer-valued property * with the given name. * Returns the default-default value (<code>0</code>) if there * is no default property with the given name, or if the default * value cannot be treated as an integer. * * @param name the name of the property * @return the default value of the named property */ @Override public int getDefaultInt(String name) { return getDefaultPreferences().getInt(name, INT_DEFAULT_DEFAULT); }
/** * Returns the current value of the integer-valued property with the * given name. * Returns the default-default value (<code>0</code>) if there * is no property with the given name, or if the current value * cannot be treated as an integter. * * @param name the name of the property * @return the int-valued property */ @Override public int getInt(String name) { return getPluginPreferences(true).getInt(name, getDefaultPreferences().getInt(name, INT_DEFAULT_DEFAULT)); }
/** * 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. */ private 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 byte[]) return defaults.getByteArray(key, BYTE_ARRAY_DEFAULT_DEFAULT); else if (obj instanceof Boolean) return defaults.getBoolean(key, BOOLEAN_DEFAULT_DEFAULT) ? Boolean.TRUE : Boolean.FALSE; else return null; }
/** * {@inheritDoc} */ public int getInt(String name) { return getNode().getInt(name, INT_DEFAULT_DEFAULT); }
@Override public int getInt(String name) { return getNode().getInt(name, INT_DEFAULT_DEFAULT); }
/** * Returns the default integer value stored in the {@link DefaultScope} for the given key * or the specified default value if the key does not appear in the {@link DefaultScope} * @param qualifier the preference qualifier * @param key the preference key * @param defaultvalue the default value * * @return the integer value set in the {@link DefaultScope} for the given key, or the specified default value. */ public static synchronized int getDefaultInt(String qualifier, String key, int defaultvalue) { return contexts[DEFAULT_CONTEXT].getNode(qualifier).getInt(key, defaultvalue); }
@Override public int getInt(String name) { return getNode().getInt(name, INT_DEFAULT_DEFAULT); }
@Override public int getInt(String name) { return getNode().getInt(name, INT_DEFAULT_DEFAULT); }
int getMissingNatureSeverity(final IProject project) { int severity = PreferenceInitializer.PREF_MISSING_NATURE_MARKER_SEVERITY_DEFAULT; IEclipsePreferences node = InstanceScope.INSTANCE.getNode(ResourcesPlugin.PI_RESOURCES); if (node != null) { severity = node.getInt(ResourcesPlugin.PREF_MISSING_NATURE_MARKER_SEVERITY, PreferenceInitializer.PREF_MISSING_NATURE_MARKER_SEVERITY_DEFAULT); } return severity; }
/** * {@inheritDoc} */ public int getInt(String name) { return getNode().getInt(name, INT_DEFAULT_DEFAULT); }
public int getDefaultInt(String name) { return getDefaultPreferences().getInt(name, INT_DEFAULT_DEFAULT); }
@Override public int getInt(String name) { return getNode().getInt(name, INT_DEFAULT_DEFAULT); }
@Override public int getDefaultInt(String name) { return getDefaultPreferences().getInt(name, INT_DEFAULT_DEFAULT); }
private int getRebuildCount() { return fManager.getWorkingCopy(DefaultScope.INSTANCE.getNode(JavaUI.ID_PLUGIN)).getInt(REBUILD_COUNT_KEY, 0); }
private int getRebuildCount() { return fManager.getWorkingCopy(DefaultScope.INSTANCE.getNode(JavaUI.ID_PLUGIN)).getInt(REBUILD_COUNT_KEY, 0); }
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); }
@Override public void loadDefault() { setStringValue(Integer.toString(DefaultScope.INSTANCE.getNode(AntLaunching.getUniqueIdentifier()).getInt(key, defaultvalue))); } }
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); }
/** * Returns the specified attribute. * * @param globalFallback true to fallback to the global definition * @param name the name of the attribute * @param defaultValue the default value * @return the value of the attribute, the default one if not found. * @throws CoreException on occasion */ protected int getAttribute(boolean globalFallback, String name, int defaultValue) throws CoreException { return configuration.getAttribute(name, (globalFallback) ? JettyPlugin.getDefaultScope().getNode(JettyPlugin.PLUGIN_ID).getInt(name, defaultValue) : defaultValue); }
public static Map<String, String> getProjectSettings(IJavaProject javaProject) { Map<String, String> options= new HashMap<>(javaProject.getOptions(true)); ProfileVersioner versioner= new ProfileVersioner(); IEclipsePreferences prefs= new ProjectScope(javaProject.getProject()).getNode(JavaUI.ID_PLUGIN); if (prefs == null) return options; int profileVersion= prefs.getInt(FORMATTER_SETTINGS_VERSION, versioner.getCurrentVersion()); if (profileVersion == versioner.getCurrentVersion()) return options; CustomProfile profile= new CustomProfile(null, options, profileVersion, null); versioner.update(profile); return profile.getSettings(); }