/** * Returns the default value for the long-valued property * with the given name. * Returns the default-default value (<code>0L</code>) if there * is no default property with the given name, or if the default * value cannot be treated as a long. * * @param name the name of the property * @return the default value of the named property */ @Override public long getDefaultLong(String name) { return getDefaultPreferences().getLong(name, LONG_DEFAULT_DEFAULT); }
/** * Returns the current value of the long-valued property with the * given name. * Returns the default-default value (<code>0L</code>) if there * is no property with the given name, or if the current value * cannot be treated as a long. * * @param name the name of the property * @return the long-valued property */ @Override public long getLong(String name) { return getPluginPreferences(true).getLong(name, getDefaultPreferences().getLong(name, LONG_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 long getLong(String name) { return getNode().getLong(name, LONG_DEFAULT_DEFAULT); }
/** * {@inheritDoc} */ public long getLong(String name) { return getNode().getLong(name, LONG_DEFAULT_DEFAULT); }
@Override public long getDefaultLong(String name) { return getDefaultPreferences().getLong(name, LONG_DEFAULT_DEFAULT); }
@Override public long getLong(String name) { return getNode().getLong(name, LONG_DEFAULT_DEFAULT); }
/** * Returns the default long 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 long value set in the {@link DefaultScope} for the given key, or the specified default value. */ public static synchronized long getDefaultLong(String qualifier, String key, long defaultvalue) { return contexts[DEFAULT_CONTEXT].getNode(qualifier).getLong(key, defaultvalue); }
@Override public long getLong(String name) { return getNode().getLong(name, LONG_DEFAULT_DEFAULT); }
@Override public long getLong(String name) { return getNode().getLong(name, LONG_DEFAULT_DEFAULT); }
@Override public long getLong(String name) { return getNode().getLong(name, LONG_DEFAULT_DEFAULT); }
/** * Returns the default value for the long-valued property * with the given name. * Returns the default-default value (<code>0L</code>) if there * is no default property with the given name, or if the default * value cannot be treated as a long. * * @param name the name of the property * @return the default value of the named property */ @Override public long getDefaultLong(String name) { return getDefaultPreferences().getLong(name, LONG_DEFAULT_DEFAULT); }
public long getDefaultLong(String name) { return getDefaultPreferences().getLong(name, LONG_DEFAULT_DEFAULT); }
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); }
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); }
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); parallelBuildsCount = node.getInt(ResourcesPlugin.PREF_MAX_CONCURRENT_BUILDS, PreferenceInitializer.PREF_MAX_CONCURRENT_BUILDS_DEFAULT); }
/** * Returns the current value of the long-valued property with the * given name. * Returns the default-default value (<code>0L</code>) if there * is no property with the given name, or if the current value * cannot be treated as a long. * * @param name the name of the property * @return the long-valued property */ @Override public long getLong(String name) { return getPluginPreferences(true).getLong(name, getDefaultPreferences().getLong(name, LONG_DEFAULT_DEFAULT)); }
return Float.valueOf(defaults.getFloat(key, FLOAT_DEFAULT_DEFAULT)); } else if (obj instanceof Long) { return Long.valueOf(defaults.getLong(key, LONG_DEFAULT_DEFAULT)); } else if (obj instanceof Boolean) { return defaults.getBoolean(key, BOOLEAN_DEFAULT_DEFAULT) ? Boolean.TRUE
/** * 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 Integer.valueOf(defaults.getInt(key, INT_DEFAULT_DEFAULT)); } else if (obj instanceof Double) { return Double.valueOf(defaults.getDouble(key, DOUBLE_DEFAULT_DEFAULT)); } else if (obj instanceof Float) { return Float.valueOf(defaults.getFloat(key, FLOAT_DEFAULT_DEFAULT)); } else if (obj instanceof Long) { return Long.valueOf(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; } }
/** * 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 Integer.valueOf(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; }