public static void setFontSize(int fontSize) { prefs.putInt(PREF_FONT_SIZE, fontSize); }
public static void setHistorySize(int historySize) { prefs.putInt(PREF_HISTORY_SIZE, historySize); }
public static void setMaxMatches(int maxMatches) { prefs.putInt(PREF_MAX_MATCHES, maxMatches); }
public static void setTreeColor(Color treeColor) { prefs.putInt(PREF_TREE_COLOR, treeColor.getRGB()); }
public static void setHighlightColor(Color highlightColor) { prefs.putInt(PREF_HIGHLIGHT_COLOR, highlightColor.getRGB()); }
public static void setMatchedColor(Color matchedColor) { prefs.putInt(PREF_MATCHED_COLOR, matchedColor.getRGB()); }
/** * Set the header width. This is the default value to use for {@link #margin} for next {@link * Log4JFormatter} to be created. * * @param margin the size of the margin to set. */ static void setHeaderWidth(final int margin) { Preferences.userNodeForPackage(Log4JFormatter.class).putInt("logging.header", margin); }
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)); } } }
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()); }
/** * {@inheritDoc} * * @see at.aschauer.commons.pentaho.plugin.PluginProperty#saveToPreferences(java.util.prefs.Preferences) */ public void saveToPreferences( final Preferences node ) { node.putInt( this.getKey(), this.getValue() ); }
Object val = get(key); if (val instanceof Integer) { prefs.putInt("I_" + key, (Integer) val); } else if (val instanceof Float) { prefs.putFloat("F_" + key, (Float) val);
@Override public synchronized void putByte(String key, byte value) { this.preferences.putInt(key, value); }
@Override public synchronized void putInt(String key, int value) { this.preferences.putInt(key, value); }
@Override public void setLatestImportantNewsSeen(int id) { Preferences.userRoot().node(NEWS_PATH).putInt(LATEST_IMPORTANT_NEWS_ID, id); LOG.trace("Latest important news id stored"); }
/** * Set the default value for indentation. * * @throws SecurityException if a security manager is present and it denies <code> * RuntimePermission("preferences")</code>. */ static void setIndentation(final int indentation) throws SecurityException { Preferences.userNodeForPackage(Formattable.class).putInt(INDENTATION, indentation); }
@Override public void setLatestNewsSeen(int id) { Preferences.userRoot().node(NEWS_PATH).putInt(LATEST_NEWS_ID, id); LOG.trace("Latest news id stored"); }
@Override public void setIntegerPreference(IntUserPreference pref, int value) { prefs.putInt(pref.toString(), value); }
public static void setServerPort(int port) { prefs().putInt(KEY_SERVER_PORT, port); }
private void writeHistoryToPref(Queue<String> filePaths) { if (filePaths.isEmpty()) { return; } Preferences node = pref.node(KEY); node.putInt(HISTORY_LENGTH, filePaths.size()); int fileCount = 1; for (String path : filePaths) { String[] pieces = breakString(path); node.putInt(String.format(PIECES_LENGTH_KEY, fileCount), pieces.length); for (int i = 0; i < pieces.length; i++) { node.put(String.format(PATH_KEY, fileCount, i), pieces[i]); } fileCount++; } }
private static void save(Preferences prefs, KeyBindButton button) { int code = button.getKeyCode(); String key = button.getKey(); prefs.putInt(key, code); updateCache(key, Integer.toString(code)); }