Package java.util.prefs

Examples of java.util.prefs.Preferences.clear()


        {
            // Expected
        }

        Preferences prefs = Preferences.userNodeForPackage(TestFeedDisplayModeManager.class);
        prefs.clear();

        // Put invalid records
        prefs.put("cdmm.", "test1");
        prefs.put("cdmm.a", "test2");
        prefs.put("cdmm.1", "test3");
View Full Code Here


        return monitor;
    }

    public static void clear() {
        Preferences p = getPrefs(true);
        try { p.clear(); } catch (BackingStoreException e) { }
    }

    static Preferences getPrefs() {
        return getPrefs(false);
    }
View Full Code Here

        if (prefs == null) {
            synchronized(AppPreferences.class) {
                if (prefs == null) {
                    Preferences p = Preferences.userNodeForPackage(Main.class);
                    if (shouldClear) {
                        try { p.clear(); } catch (BackingStoreException e) { }
                    }
                    myListener = new MyListener();
                    p.addPreferenceChangeListener(myListener);
                    prefs = p;
View Full Code Here

        Preferences prefs = Preferences.userRoot().node(preferencesKey);

        // Clear any previous settings set before saving, this will
        // purge any other parameters set in older versions of the app, so
        // that they don't leak onto the AppSettings of newer versions.
        prefs.clear();

        for (String key : keySet()) {
            Object val = get(key);
            if (val instanceof Integer) {
                prefs.putInt("I_" + key, (Integer) val);
View Full Code Here

     * preferences.
     */
    private void storeFileNames() {
        Preferences p = Preferences.userNodeForPackage(this.getClass());
        try {
            p.clear();
            p.flush();
            p = Preferences.userNodeForPackage(this.getClass());
            int itemCount = dirName.getItemCount();
            int selected = dirName.getSelectedIndex();
            p.put("dirName0", (String) dirName.getItemAt(selected));
View Full Code Here

                        while (arr.size() > ModelerPreferences.LAST_PROJ_FILES_SIZE) {
                            arr.remove(arr.size() - 1);
                        }

                        frefLastProjFiles.clear();
                        int size = arr.size();

                        for (int i = 0; i < size; i++) {
                            frefLastProjFiles.put(String.valueOf(i), arr
                                    .get(i)
View Full Code Here

        while (arr.size() > ModelerPreferences.LAST_PROJ_FILES_SIZE) {
            arr.remove(arr.size() - 1);
        }

        try {
            frefLastProjFiles.clear();
        }
        catch (BackingStoreException e) {
            // ignore exception
        }
        int size = arr.size();
View Full Code Here

        while (arr.size() > ModelerPreferences.LAST_PROJ_FILES_SIZE) {
            arr.remove(arr.size() - 1);
        }

        try {
            frefLastProjFiles.clear();
        }
        catch (BackingStoreException e) {
            // ignore exception
        }
        int size = arr.size();
View Full Code Here

        try {
            p.childrenNames();
        } catch (BackingStoreException e4) {
        }
        try {
            p.clear();
        } catch (BackingStoreException e5) {
        }
        try {
            p.exportNode(null);
        } catch (IOException e6) {
View Full Code Here

        Preferences romPref = prefs.node(String.valueOf(nextRomIndex));

        for (int i = 0; i < DeviceContext.SAMPLE_ROM_SIZE; i++) {
            if (sampleNames[i] == null) {
                romPref.clear();
                return;
            }
            romPref.put(String.valueOf(i), sampleNames[i]);
        }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.