public static void setMatchPortionOnly(boolean matchPortionOnly) { prefs.putBoolean(PREF_MATCH_PORTION_ONLY, matchPortionOnly); }
public static void setEnableTsurgeon(boolean enableTsurgeon) { prefs.putBoolean(PREF_ENABLE_TSURGEON, enableTsurgeon); }
private void zoomFit() { final boolean selectedZoom = zoomFitButt.isSelected(); final boolean selectedWidth = widthFitButt.isSelected(); prefs.putBoolean(KEY_ZOOM_FIT, selectedZoom); prefs.putBoolean(KEY_WIDTH_FIT, selectedWidth); zoomFactor = 0; if (selectedZoom) { sizeMode = SizeMode.ZOOM_FIT; } else if (selectedWidth) { sizeMode = SizeMode.WIDTH_FIT; } else { sizeMode = SizeMode.FULL_SIZE; } refreshImage(false); }
private void saveLuytenPreferences(Preferences prefs) throws Exception { for (Field field : LuytenPreferences.class.getDeclaredFields()) { if (Modifier.isStatic(field.getModifiers())) continue; field.setAccessible(true); String prefId = field.getName(); Object value = field.get(luytenPreferences); if (field.getType() == String.class) { prefs.put(prefId, (String) (value == null ? "" : value)); } else if (field.getType() == Boolean.class || field.getType() == boolean.class) { prefs.putBoolean(prefId, (Boolean) (value == null ? new Boolean(false) : value)); } else if (field.getType() == Integer.class || field.getType() == int.class) { prefs.putInt(prefId, (Integer) (value == null ? new Integer(0) : value)); } } }
/** * {@inheritDoc} * * @see at.aschauer.commons.pentaho.plugin.PluginProperty#saveToPreferences(java.util.prefs.Preferences) */ public void saveToPreferences( final Preferences node ) { node.putBoolean( this.getKey(), this.getValue() ); }
private void saveWindowPosition(Preferences prefs, String windowIdPrefix, WindowPosition windowPosition) { prefs.putBoolean(windowIdPrefix + WINDOW_IS_FULL_SCREEN_ID, windowPosition.isFullScreen()); prefs.putInt(windowIdPrefix + WINDOW_WIDTH_ID, windowPosition.getWindowWidth()); prefs.putInt(windowIdPrefix + WINDOW_HEIGHT_ID, windowPosition.getWindowHeight()); prefs.putInt(windowIdPrefix + WINDOW_X_ID, windowPosition.getWindowX()); prefs.putInt(windowIdPrefix + WINDOW_Y_ID, windowPosition.getWindowY()); }
public void saveConfig() { // Registry path on Windows Xp: // HKEY_CURRENT_USER/Software/JavaSoft/Prefs/us/deathmarine/luyten try { Preferences prefs = Preferences.userNodeForPackage(ConfigSaver.class); prefs.putBoolean(FLATTEN_SWITCH_BLOCKS_ID, decompilerSettings.getFlattenSwitchBlocks()); prefs.putBoolean(FORCE_EXPLICIT_IMPORTS_ID, decompilerSettings.getForceExplicitImports()); prefs.putBoolean(SHOW_SYNTHETIC_MEMBERS_ID, decompilerSettings.getShowSyntheticMembers()); prefs.putBoolean(EXCLUDE_NESTED_TYPES_ID, decompilerSettings.getExcludeNestedTypes()); prefs.putBoolean(FORCE_EXPLICIT_TYPE_ARGUMENTS_ID, decompilerSettings.getForceExplicitTypeArguments()); prefs.putBoolean(RETAIN_REDUNDANT_CASTS_ID, decompilerSettings.getRetainRedundantCasts()); prefs.putBoolean(INCLUDE_ERROR_DIAGNOSTICS_ID, decompilerSettings.getIncludeErrorDiagnostics()); prefs.putBoolean(UNICODE_REPLACE_ENABLED_ID, decompilerSettings.isUnicodeOutputEnabled()); prefs.put(LANGUAGE_NAME_ID, decompilerSettings.getLanguage().getName()); saveWindowPosition(prefs, MAIN_WINDOW_ID_PREFIX, mainWindowPosition); saveWindowPosition(prefs, FIND_WINDOW_ID_PREFIX, findWindowPosition); saveLuytenPreferences(prefs); } catch (Exception e) { Luyten.showExceptionDialog("Exception!", e); } }
public void set(ControlPanelTypes type, boolean newValue) throws Exception { cache.put(type, newValue); preferences.putBoolean(makeKey(type), newValue); preferences.flush(); }
prefs.put("S_" + key, (String) val); } else if (val instanceof Boolean) { prefs.putBoolean("B_" + key, (Boolean) val);
/** * Adds an OnCloseRequest handle to the window which will store the position, * size and maximized status of the window. * * @param stage the stage to read settings from * @param name the name under which we store the settings */ public static void applySaveOnCloseMethod(Stage stage, String name){ stage.setOnCloseRequest( ev -> { try { Preferences stagePreferences = PREFERENCES.node(name); if( stage.isMaximized() ){ stagePreferences.putBoolean(WINDOW_MAXIMIZED, true); } else { stagePreferences.putBoolean(WINDOW_MAXIMIZED, false); stagePreferences.putDouble(WINDOW_X_POS, stage.getX()); stagePreferences.putDouble(WINDOW_Y_POS, stage.getY()); stagePreferences.putDouble(WINDOW_WIDTH, stage.getWidth()); stagePreferences.putDouble(WINDOW_HEIGHT, stage.getHeight()); } stagePreferences.flush(); } catch (final BackingStoreException ex) { LOGGER.error(ex, "Could not flush preferences for window " + name); } }); }
@Override public synchronized void putBoolean(String key, boolean value) { this.preferences.putBoolean(key, value); }
@Override public void setBooleanPreference(BooleanUserPreference pref, boolean value) { prefs.putBoolean(pref.toString(), value); }
public static void setAutoConnect(boolean autoConnect) { prefs().putBoolean(KEY_AUTO_CONNECT, autoConnect); }
public static void addIgnoredUser(String serverAddress, String username) { ignoreListNode(serverAddress).putBoolean(username, true); }
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)); } }
); prefs.putBoolean(HelperUi.BINARY_VISIBLE, false); prefs.putBoolean(HelperUi.CHUNK_VISIBLE, false); prefs.putBoolean(HelperUi.NETWORK_VISIBLE, false); prefs.putBoolean(HelperUi.JAVA_VISIBLE, false); prefs.putBoolean(HelperUi.BINARY_VISIBLE, true); } else if ("CONSOLE_CHUNK_LABEL".equals(MediatorGui.tabConsoles().getTabComponentAt(i).getName())) { prefs.putBoolean(HelperUi.CHUNK_VISIBLE, true); } else if ("CONSOLE_NETWORK_LABEL".equals(MediatorGui.tabConsoles().getTabComponentAt(i).getName())) { prefs.putBoolean(HelperUi.NETWORK_VISIBLE, true); } else if ("CONSOLE_JAVA_LABEL".equals(MediatorGui.tabConsoles().getTabComponentAt(i).getName())) { prefs.putBoolean(HelperUi.JAVA_VISIBLE, true);
preferences.putBoolean("isDigestAuthentication", AuthenticationUtil.isAuthentication); preferences.put("usernameDigest", AuthenticationUtil.usernameAuthentication); preferences.put("passwordDigest", AuthenticationUtil.passwordAuthentication); preferences.putBoolean("enableKerberos", AuthenticationUtil.isKerberos); preferences.put("kerberosKrb5Conf", AuthenticationUtil.pathKerberosKrb5); preferences.put("kerberosLoginConf", AuthenticationUtil.pathKerberosLogin);
prefs.putBoolean("isUsingProxy", ProxyUtil.isUsingProxy()); prefs.put("proxyAddress", ProxyUtil.getProxyAddress()); prefs.put("proxyPort", ProxyUtil.getProxyPort()); prefs.putBoolean("isUsingProxyHttps", ProxyUtil.isUsingProxyHttps()); prefs.put("proxyAddressHttps", ProxyUtil.getProxyAddressHttps()); prefs.put("proxyPortHttps", ProxyUtil.getProxyPortHttps());
preferences.putBoolean("isCheckingUpdate", PreferencesUtil.isCheckUpdateActivated()); preferences.putBoolean("isReportingBugs", PreferencesUtil.isReportingBugs()); preferences.putBoolean("isEvading", PreferencesUtil.isEvasionEnabled()); preferences.putBoolean("isFollowingRedirection", PreferencesUtil.isFollowingRedirection()); preferences.putBoolean("isNotInjectingMetadata", PreferencesUtil.isNotInjectingMetadata()); preferences.putBoolean("isCheckingAllParam", PreferencesUtil.isCheckingAllParam()); preferences.putBoolean("isCheckingAllURLParam", PreferencesUtil.isCheckingAllURLParam()); preferences.putBoolean("isCheckingAllRequestParam", PreferencesUtil.isCheckingAllRequestParam()); preferences.putBoolean("isCheckingAllHeaderParam", PreferencesUtil.isCheckingAllHeaderParam()); preferences.putBoolean("isCheckingAllJSONParam", PreferencesUtil.isCheckingAllJSONParam()); preferences.putBoolean("isCheckingAllCookieParam", PreferencesUtil.isCheckingAllCookieParam()); preferences.putBoolean("isCheckingAllSOAPParam", PreferencesUtil.isCheckingAllSOAPParam()); preferences.putBoolean("isParsingForm", PreferencesUtil.isParsingForm()); preferences.putBoolean("isNotTestingConnection", PreferencesUtil.isNotTestingConnection()); preferences.putBoolean("isProcessingCookies", PreferencesUtil.isProcessingCookies()); preferences.putBoolean("isProcessingCsrf", PreferencesUtil.isProcessingCsrf()); preferences.putBoolean("isTamperingBase64", PreferencesUtil.isTamperingBase64()); preferences.putBoolean("isTamperingEqualToLike", PreferencesUtil.isTamperingEqualToLike()); preferences.putBoolean("isTamperingVersionComment", PreferencesUtil.isTamperingVersionComment()); preferences.putBoolean("isTamperingFunctionComment", PreferencesUtil.isTamperingFunctionComment()); preferences.putBoolean("isTamperingRandomCase", PreferencesUtil.isTamperingRandomCase()); preferences.putBoolean("isTamperingEval", PreferencesUtil.isTamperingEval()); preferences.putBoolean("isTamperingSpaceToDashComment", PreferencesUtil.isTamperingSpaceToDashComment()); preferences.putBoolean("isTamperingSpaceToMultlineComment", PreferencesUtil.isTamperingSpaceToMultlineComment()); preferences.putBoolean("isTamperingSpaceToSharpComment", PreferencesUtil.isTamperingSpaceToSharpComment());
/** * @param wrap * See {@link #getWrap} */ public static void setWrap(boolean wrap) { if (getWrap() == wrap) return; getPreferences().putBoolean(PROP_WRAP, wrap); }