Package java.util.prefs

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


    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

    try {
      p.childrenNames();
    } catch (BackingStoreException e4) {
    }
    try {
      p.clear();
    } catch (BackingStoreException e5) {
    }
    try {
      p.exportNode(null);
    } catch (IOException e6) {
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

        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

     */
    public void testStorePreferences()
        throws BackingStoreException
    {
        Preferences prefs = Preferences.userNodeForPackage(TestFeedDisplayModeManager.class);
        prefs.clear();

        manager.clear();
        manager.setColor(FeedClass.INVALID, Color.GRAY);
        manager.setColor(FeedClass.LOW_RATED, null);

View Full Code Here

     */
    public void testRestorePreferences()
        throws BackingStoreException
    {
        Preferences prefs = Preferences.userNodeForPackage(TestFeedDisplayModeManager.class);
        prefs.clear();

        prefs.put("cdmm." + FeedClass.INVALID, "#00ff00");
        prefs.put("cdmm." + FeedClass.READ, "");

        manager.clear();
View Full Code Here

    {
        manager.clear();
        manager.setColor(FeedClass.INVALID, Color.RED);

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

        manager.restorePreferences(prefs);

        assertEquals("Wrong or missing color.", Color.RED, manager.getColor(FeedClass.INVALID));
    }
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.