/** * Returns the default value for the boolean-valued property * with the given name. * Returns the default-default value (<code>false</code>) if there * is no default property with the given name, or if the default * value cannot be treated as a boolean. * * @param name the name of the property * @return the default value of the named property */ @Override public boolean getDefaultBoolean(String name) { return getDefaultPreferences().getBoolean(name, BOOLEAN_DEFAULT_DEFAULT); }
/** * Returns the current value of the boolean-valued property with the * given name. * Returns the default-default value (<code>false</code>) if there * is no property with the given name, or if the current value * cannot be treated as a boolean. * * @param name the name of the property * @return the boolean-valued property */ @Override public boolean getBoolean(String name) { return getPluginPreferences(true).getBoolean(name, getDefaultPreferences().getBoolean(name, BOOLEAN_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; }
/** * Returns whether the profiler is enabled or not. * * @return <code>true</code> if the profiler is enabled, <code>false</code> otherwise. */ public static boolean isProfilerEnabled() { return PREFERENCES_SCOPE.getBoolean(PREFERENCE_KEY_ENABLE_PROFILER, DEFAULT_ENABLE_PROFILER); }
/** * Returns whether the notifications are enabled or not. * * @return <code>true</code> if the notifications are enabled, <code>false</code> otherwise. * @since 3.2 */ public static boolean areNotificationsEnabled() { return PREFERENCES_SCOPE .getBoolean(PREFERENCE_KEY_ENABLE_NOTIFICATIONS, DEFAULT_ENABLE_NOTIFICATIONS); }
/** * Returns whether the warning notifications are enabled or not. * * @return <code>true</code> if the warning notifications are enabled, <code>false</code> otherwise. * @since 3.2 */ public static boolean areWarningNotificationsEnabled() { return PREFERENCES_SCOPE.getBoolean(PREFERENCE_KEY_ENABLE_NOTIFICATIONS_WARNING, DEFAULT_ENABLE_NOTIFICATIONS_TYPE); }
public void propertyChange(String property) { if (APPEARANCE_MEMBER_SORT_ORDER.equals(property)) { fCategoryOffsets= null; } else if (APPEARANCE_VISIBILITY_SORT_ORDER.equals(property)) { fVisibilityOffsets= null; } else if (APPEARANCE_ENABLE_VISIBILITY_SORT_ORDER.equals(property)) { String key= APPEARANCE_ENABLE_VISIBILITY_SORT_ORDER; boolean defaultValue= fDefaultPreferenceStore.getBoolean(key, false); fSortByVisibility= fPreferences.getBoolean(key, defaultValue); } }
/** * Gets the preference "show most recently used tabs" (MRU tabs) * * @return Returns the enableMRU. */ private static boolean isMruEnabled() { IEclipsePreferences preferences = InstanceScope.INSTANCE.getNode(ORG_ECLIPSE_E4_UI_WORKBENCH_RENDERERS_SWT); boolean initialMRUValue = preferences.getBoolean(StackRenderer.MRU_KEY_DEFAULT, StackRenderer.MRU_DEFAULT); boolean enableMRU = preferences.getBoolean(StackRenderer.MRU_KEY, initialMRUValue); return enableMRU; }
@Override public void preferenceChange(PreferenceChangeEvent event) { boolean mruControlledByCSS = preferences.getBoolean(MRU_CONTROLLED_BY_CSS_KEY, MRU_CONTROLLED_BY_CSS_DEFAULT); CSSPropertyMruVisibleSWTHandler.setMRUControlledByCSS(mruControlledByCSS); }
@Override public void run() { boolean checked = junitPreferences.getBoolean( PREF_SHOW_ON_ERROR_ONLY, false ); junitPreferences.putBoolean( PREF_SHOW_ON_ERROR_ONLY, !checked ); } }
/** * Returns the default boolean 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 boolean value set in the {@link DefaultScope} for the given key, or the specified default value. */ public static synchronized boolean getDefaultBoolean(String qualifier, String key, boolean defaultvalue) { return contexts[DEFAULT_CONTEXT].getNode(qualifier).getBoolean(key, defaultvalue); }
public ActivateJUnitViewOnFailureAction( IEclipsePreferences junitPreferences ) { super( "Activate JUnit View on Failure Only", IAction.AS_CHECK_BOX ); this.junitPreferences = requireNonNull( junitPreferences ); setChecked( junitPreferences.getBoolean( PREF_SHOW_ON_ERROR_ONLY, false ) ); }
private boolean showWizard() { IEclipsePreferences instanceNode= InstanceScope.INSTANCE.getNode(JavaUI.ID_PLUGIN); if (instanceNode.get(CleanUpConstants.SHOW_CLEAN_UP_WIZARD, null) != null) return instanceNode.getBoolean(CleanUpConstants.SHOW_CLEAN_UP_WIZARD, true); IEclipsePreferences defaultNode= DefaultScope.INSTANCE.getNode(JavaUI.ID_PLUGIN); return defaultNode.getBoolean(CleanUpConstants.SHOW_CLEAN_UP_WIZARD, true); }
public static boolean isUsingProjectSettings(IProject project) { IScopeContext projectScope = new ProjectScope(project); IEclipsePreferences projectNode = projectScope .getNode(AspectJPlugin.PLUGIN_ID); if (projectNode == null) { return false; } return projectNode.getBoolean(OPTION_UseProjectSettings, false); }
@Override public ISchedulingRule getRule(int kind, Map<String, String> args) { if (InstanceScope.INSTANCE.getNode(JavaCore.PLUGIN_ID).getBoolean(PREF_NULL_SCHEDULING_RULE, false)) { return null; } return super.getRule(kind, args); } }
@Override public boolean isEnabled(IScopeContext context) { IEclipsePreferences node; if (hasSettingsInScope(context)) { node= context.getNode(JavaUI.ID_PLUGIN); } else { node= InstanceScope.INSTANCE.getNode(JavaUI.ID_PLUGIN); } IEclipsePreferences defaultNode= DefaultScope.INSTANCE.getNode(JavaUI.ID_PLUGIN); String key= getPreferenceKey(); return node.getBoolean(key, defaultNode.getBoolean(key, false)); }
private boolean showWizard() { InstanceScope instanceScope= new InstanceScope(); IEclipsePreferences instanceNode= instanceScope.getNode(JavaUI.ID_PLUGIN); if (instanceNode.get(CleanUpConstants.SHOW_CLEAN_UP_WIZARD, null) != null) return instanceNode.getBoolean(CleanUpConstants.SHOW_CLEAN_UP_WIZARD, true); DefaultScope defaultScope= new DefaultScope(); IEclipsePreferences defaultNode= defaultScope.getNode(JavaUI.ID_PLUGIN); return defaultNode.getBoolean(CleanUpConstants.SHOW_CLEAN_UP_WIZARD, true); }
public void install() { fPreferences= InstanceScope.INSTANCE.getNode(JavaManipulation.getPreferenceNodeId()); fDefaultPreferenceStore= DefaultScope.INSTANCE.getNode(JavaManipulation.getPreferenceNodeId()); fVisibilityOffsets= null; boolean defaultValue= fDefaultPreferenceStore.getBoolean(APPEARANCE_ENABLE_VISIBILITY_SORT_ORDER, false); fSortByVisibility= fPreferences.getBoolean(APPEARANCE_ENABLE_VISIBILITY_SORT_ORDER, defaultValue); JavaManipulationPlugin.getDefault().setMembersOrderPreferenceCacheCommon(this); }
private void doShowCleanUpWizard(boolean showWizard) { IEclipsePreferences preferences= fCurrContext.getNode(JavaUI.ID_PLUGIN); if (preferences.get(CleanUpConstants.SHOW_CLEAN_UP_WIZARD, null) != null && preferences.getBoolean(CleanUpConstants.SHOW_CLEAN_UP_WIZARD, true) == showWizard) return; preferences.putBoolean(CleanUpConstants.SHOW_CLEAN_UP_WIZARD, showWizard); }
private void doShowCleanUpWizard(boolean showWizard) { IEclipsePreferences preferences= fCurrContext.getNode(JavaUI.ID_PLUGIN); if (preferences.get(CleanUpConstants.SHOW_CLEAN_UP_WIZARD, null) != null && preferences.getBoolean(CleanUpConstants.SHOW_CLEAN_UP_WIZARD, true) == showWizard) return; preferences.putBoolean(CleanUpConstants.SHOW_CLEAN_UP_WIZARD, showWizard); }