Package java.util.prefs

Examples of java.util.prefs.Preferences


        keyStoreTextField.setText(prefs.get("keyStore", System.getProperty("com.sun.grid.jgdi.keyStore")));
    }

    public void saveInPrefs() {

        Preferences prefs = Preferences.userNodeForPackage(ConnectDialog.class);

        prefs.put("username", getUsername());
        prefs.putInt("port", getPort());
        prefs.put("host", getHost());

        if (useSSL) {
            prefs.put("caTop", getCaTop());
            prefs.put("keyStore", getKeystore());
        }
    }
View Full Code Here


                new DefaultComboBoxModel(AudioQuality.values()));
        //audioQualityComboBox.setSelectedItem(wcc.getAudioQuality());

        AudioQuality audioQuality = AudioQuality.VPN;

        Preferences prefs =
                Preferences.userNodeForPackage(LoginOptionsFrame.class);

        String s = prefs.get("org.jdesktop.wonderland.modules.audiomanager." +
                "client.AUDIO_QUALITY", null);

        if (s != null) {
            AudioQuality[] audioQualityValues = AudioQuality.values();
View Full Code Here

    // store the audio quality
    //wcc.setAudioQuality((AudioQuality) audioQualityComboBox.getSelectedItem());
    AudioQuality audioQuality =
            (AudioQuality) audioQualityComboBox.getSelectedItem();
    Preferences prefs = Preferences.userNodeForPackage(LoginOptionsFrame.class);
    prefs.put(
            "org.jdesktop.wonderland.modules.audiomanager.client.AUDIO_QUALITY",
            audioQuality.toString());

    SoftphoneControlImpl.getInstance().setAudioQuality(audioQuality);
View Full Code Here

    /**
     * Get the current desired framerate
     * @return the current framerate
     */
    static int getDesiredFrameRate() {
        Preferences prefs = Preferences.userNodeForPackage(JmeClientMain.class);
       
        // first try a preference
        String requestedFPS = null;
        try {
            if (prefs.node(prefs.absolutePath()).get("fps", null) != null) {
                requestedFPS = prefs.get("fps", DESIRED_FPS_DEFAULT);
            }
        } catch (Exception e) {
        }
       
        // if the preference was not set, use a system property
View Full Code Here

    /**
     * Set the current desired framerate
     * @param frameRate the current desired framerate
     */
    static void setDesiredFrameRate(int frameRate) {
        Preferences prefs = Preferences.userNodeForPackage(JmeClientMain.class);
        prefs.put("fps", String.valueOf(frameRate));
    }
View Full Code Here

        if (userDir != null) {
            return userDir;
        }

        // first try the preference set up in the login dialog
        Preferences prefs = Preferences.userNodeForPackage(ClientContext.class);
        String userDirName = prefs.get(USERDIR_PROP, null);
        if (userDirName != null) {
            // if the user has set a preference for a directory, but that
            // directory doesn't exist, don't create it, just fall back to
            // what we would have used otherwise. This covers the case of
            // removable drives, etc
View Full Code Here

     * @param userDirectory the user directory to use
     * @param save if true, save this value in a preference for future use
     */
    public static void setUserDirectory(File userDir, boolean save) {
        if (save) {
            Preferences prefs = Preferences.userNodeForPackage(ClientContext.class);
            prefs.put(USERDIR_PROP, userDir.getPath());
        }

        ClientContext.userDir = userDir;
    }
View Full Code Here

    /**
     * @InternalAPI
     * Reset the user directory by removing the preference.
     */
    public static void resetUserDirectory() {
        Preferences prefs = Preferences.userNodeForPackage(ClientContext.class);
        prefs.remove(USERDIR_PROP);

        // reset the user directory to the default value
        ClientContext.userDir = null;
        ClientContext.userDir = getUserDirectory();
    }
View Full Code Here

                addRow(new Object[]{e.getKey(), e.getValue()});
            }
        }

        public void save() {
            Preferences prefs = Preferences.userNodeForPackage(LogViewerFrame.class);
            prefs = prefs.node("loggerTable");

            try {
                prefs.clear();
            } catch (BackingStoreException ex) {
                logger.log(Level.WARNING, "Error clearing preferences", ex);
            }

            for (int i = 0; i < getRowCount(); i++) {
                String loggerName = (String) getValueAt(i, 0);
                Level level = (Level) getValueAt(i, 1);

                if (loggerName != null && level != null) {
                    Logger.getLogger(loggerName).setLevel(level);
                    prefs.put(loggerName, level.getName());
                    origLevels.remove(loggerName);
                }
            }

            // any values left in origLevels need to be reset to the
View Full Code Here

                createdLoggers.remove(removeLogger);
            }
        }

        public void restore() {
            Preferences prefs = Preferences.userNodeForPackage(LoggerTableModel.class);
            prefs = prefs.node("loggerTable");

            try {
                for (String loggerName : prefs.keys()) {
                    Level level = Level.parse(prefs.get(loggerName, "WARNING"));
                    Logger createLogger = Logger.getLogger(loggerName);
                    createLogger.setLevel(level);

                    // OWF issue #130: hold a strong reference to the created
                    // logger, to make sure it isn't garbage collected
View Full Code Here

TOP

Related Classes of java.util.prefs.Preferences

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.