public static boolean getMatchPortionOnly() { return prefs.getBoolean(PREF_MATCH_PORTION_ONLY, DEFAULT_MATCH_PORTION_ONLY); } public static void setMatchPortionOnly(boolean matchPortionOnly) { prefs.putBoolean(PREF_MATCH_PORTION_ONLY, matchPortionOnly); }
public static boolean getEnableTsurgeon() { return prefs.getBoolean(PREF_ENABLE_TSURGEON, DEFAULT_ENABLE_TSURGEON); } public static void setEnableTsurgeon(boolean enableTsurgeon) { prefs.putBoolean(PREF_ENABLE_TSURGEON, enableTsurgeon); }
@Override public Boolean load(ControlPanelTypes type) throws Exception { return preferences.getBoolean(makeKey(type), true); } }
public static boolean getShowLastResult() { return STORE.getBoolean(SHOW_LAST_RESULT_KEY, true); }
public static boolean getSanitizeStackTrace() { return STORE.getBoolean(SANITIZE_STACK_TRACE_KEY, true); }
private LuytenPreferences loadLuytenPreferences(Preferences prefs) throws Exception { LuytenPreferences newLuytenPrefs = new LuytenPreferences(); for (Field field : LuytenPreferences.class.getDeclaredFields()) { if (Modifier.isStatic(field.getModifiers())) continue; field.setAccessible(true); String prefId = field.getName(); Object defaultVal = field.get(newLuytenPrefs); if (field.getType() == String.class) { String defaultStr = (String) (defaultVal == null ? "" : defaultVal); field.set(newLuytenPrefs, prefs.get(prefId, defaultStr)); } else if (field.getType() == Boolean.class || field.getType() == boolean.class) { Boolean defaultBool = (Boolean) (defaultVal == null ? new Boolean(false) : defaultVal); field.setBoolean(newLuytenPrefs, prefs.getBoolean(prefId, defaultBool)); } else if (field.getType() == Integer.class || field.getType() == int.class) { Integer defaultInt = (Integer) (defaultVal == null ? new Integer(0) : defaultVal); field.setInt(newLuytenPrefs, prefs.getInt(prefId, defaultInt)); } } return newLuytenPrefs; }
private WindowPosition loadWindowPosition(Preferences prefs, String windowIdPrefix) { WindowPosition windowPosition = new WindowPosition(); windowPosition.setFullScreen(prefs.getBoolean(windowIdPrefix + WINDOW_IS_FULL_SCREEN_ID, false)); windowPosition.setWindowWidth(prefs.getInt(windowIdPrefix + WINDOW_WIDTH_ID, 0)); windowPosition.setWindowHeight(prefs.getInt(windowIdPrefix + WINDOW_HEIGHT_ID, 0)); windowPosition.setWindowX(prefs.getInt(windowIdPrefix + WINDOW_X_ID, 0)); windowPosition.setWindowY(prefs.getInt(windowIdPrefix + WINDOW_Y_ID, 0)); return windowPosition; }
/** * {@inheritDoc} * * @see at.aschauer.commons.pentaho.plugin.PluginProperty#readFromPreferences(java.util.prefs.Preferences) */ public void readFromPreferences( final Preferences node ) { this.setValue( node.getBoolean( this.getKey(), this.getValue() ) ); }
break; case 'B': put(key.substring(2), prefs.getBoolean(key, (Boolean) false)); break; default: put(key, prefs.get(key, (String) defaultValue)); } else if (defaultValue instanceof Boolean) { put(key, prefs.getBoolean(key, (Boolean) defaultValue));
final boolean zoomChecked = prefs.getBoolean(KEY_ZOOM_FIT, false); zoomFitButt.setSelected(zoomChecked); if (zoomChecked) { sizeMode = SizeMode.ZOOM_FIT; final boolean widthZoomChecked = prefs.getBoolean(KEY_WIDTH_FIT, false); widthFitButt.setSelected(widthZoomChecked); if (widthZoomChecked) {
prefs.getBoolean(FLATTEN_SWITCH_BLOCKS_ID, decompilerSettings.getFlattenSwitchBlocks())); decompilerSettings.setForceExplicitImports( prefs.getBoolean(FORCE_EXPLICIT_IMPORTS_ID, decompilerSettings.getForceExplicitImports())); decompilerSettings.setShowSyntheticMembers( prefs.getBoolean(SHOW_SYNTHETIC_MEMBERS_ID, decompilerSettings.getShowSyntheticMembers())); decompilerSettings.setExcludeNestedTypes( prefs.getBoolean(EXCLUDE_NESTED_TYPES_ID, decompilerSettings.getExcludeNestedTypes())); decompilerSettings.setForceExplicitTypeArguments(prefs.getBoolean(FORCE_EXPLICIT_TYPE_ARGUMENTS_ID, decompilerSettings.getForceExplicitTypeArguments())); decompilerSettings.setRetainRedundantCasts( prefs.getBoolean(RETAIN_REDUNDANT_CASTS_ID, decompilerSettings.getRetainRedundantCasts())); decompilerSettings.setIncludeErrorDiagnostics( prefs.getBoolean(INCLUDE_ERROR_DIAGNOSTICS_ID, decompilerSettings.getIncludeErrorDiagnostics())); decompilerSettings.setLanguage( findLanguageByName(prefs.get(LANGUAGE_NAME_ID, decompilerSettings.getLanguage().getName()))); decompilerSettings.setUnicodeOutputEnabled(prefs.getBoolean(UNICODE_REPLACE_ENABLED_ID, false));
/** * Retrieves data about he window settings from the previous session and applies * them to the stage. These settings include window size, position and if * it was maximized or not. * * @param stage the stage to apply these settings to * @param name the name under which we stored the settings */ public static void applyStoredDisplaySettings(Stage stage, String name){ try { if( PREFERENCES.nodeExists(name) ){ Preferences stagePreferences = PREFERENCES.node(name); boolean wasMaximized = stagePreferences.getBoolean(WINDOW_MAXIMIZED, false); if( wasMaximized ){ stage.setMaximized(true); } else { stage.setX( stagePreferences.getDouble(WINDOW_X_POS, DEFUALT_X)); stage.setY( stagePreferences.getDouble(WINDOW_Y_POS, DEFUALT_Y)); stage.setWidth( stagePreferences.getDouble(WINDOW_WIDTH, DEFUALT_WIDTH)); stage.setHeight(stagePreferences.getDouble(WINDOW_HEIGHT, DEFUALT_HEIHGT)); } } } catch (BackingStoreException ex) { LOGGER.error(ex, "Could not access preferences for window " + name); } }
@Override public boolean isFetchPremiumModules() { return prefs.getBoolean(BooleanUserPreference.PREMIUM_MODULES.toString(), Boolean.valueOf(System.getProperty(FETCH_PREMIUM_MODULES_PROP, Boolean.TRUE.toString()))); }
@Override public boolean isCheckForUpdates() { return prefs.getBoolean(BooleanUserPreference.CHECK_UPDATES.toString(), Boolean.valueOf(System.getProperty(CHECK_FOR_UPDATES_PROP, Boolean.TRUE.toString()))); }
@Override public boolean isPlaySounds() { return prefs.getBoolean(BooleanUserPreference.PLAY_SOUNDS.toString(), Boolean.valueOf(System.getProperty(PLAY_SOUNDS_PROP, Boolean.TRUE.toString()))); }
@Override public boolean isCheckForNews() { return prefs.getBoolean(BooleanUserPreference.CHECK_FOR_NEWS.toString(), Boolean.valueOf(System.getProperty(CHECK_FOR_NEWS_PROP, Boolean.TRUE.toString()))); }
@Override public boolean isDonationNotification() { return prefs.getBoolean(BooleanUserPreference.DONATION_NOTIFICATION.toString(), Boolean.valueOf(System.getProperty(DONATE_NOTIFICATION_PROP, Boolean.TRUE.toString()))); }
@Override public boolean isUseSmartOutput() { return prefs.getBoolean(BooleanUserPreference.SMART_OUTPUT.toString(), Boolean.TRUE); }
public static boolean removeIgnoredUser(String serverAddress, String username) { Preferences ignoreList = ignoreListNode(serverAddress); boolean exists = ignoreList.getBoolean(username, false); if (exists) { ignoreList.remove(username); } return exists; }
private void togglePreferencesSelected() { String key = (String) getValue(PREFERENCES_KEY); Preferences prefs = prefs(); if (key != null && prefs != null) { Object defaultValue = getValue(PREFERENCES_DEFAULT); prefs.putBoolean(key, !prefs.getBoolean(key, defaultValue instanceof Boolean ? (Boolean) defaultValue : false)); } }