Package java.util.prefs

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


    {
        try
        {
            Preferences descNode = prefNode.node("description");
          
            String[] keys = descNode.keys();
            ArrayList descs = new ArrayList(keys.length);
            for(int i=0; i < keys.length; i++)
            {
                PreferenceDescriptionImpl desc = new PreferenceDescriptionImpl();
                String localeKey = keys[i];
View Full Code Here


      Map userInfo = new HashMap();
      User user =  userManager.getUser(username);
    if(user != null)
    {
          Preferences userPrefs = user.getUserAttributes();
          String[] userPrefKeys = userPrefs.keys();
       
          for(int i = 0; i<userPrefKeys.length; i++)
          {
            userInfo.put(userPrefKeys[i], userPrefs.get(userPrefKeys[i], "No value"));                   
          }
View Full Code Here

        // No property has been defined nor added to the node. This should return
        // the property value
        Preferences pref0 = Preferences.userRoot();
        try
        {
            String[] propertyKeys = pref0.keys();
            if (propertyKeys.length > 0)
            {
                assertTrue("expected no children, " + propertyKeys.length + ", " + propertyKeys[0],
                        propertyKeys.length == 0);
            }
View Full Code Here

        assertTrue("expected prop1 == true, " + prop1, prop1.equals("true"));

        // There should be 1 property under pref1.
        try
        {
            String[] propertyKeys = pref1.keys();
            assertEquals("expected 1 child, ", 1, propertyKeys.length);
        }
        catch (BackingStoreException bse)
        {
            assertTrue("backing store exception: " + bse, false);
View Full Code Here

                // Loading the userinfo
                User user = userManager.getUser(principal.getName());
                if(user != null)
                {
                  Preferences prefs = user.getUserAttributes();
                  String[] prefKeys = prefs.keys();
                  Map prefsSet = new HashMap();
                  for(int i = 0; i<prefKeys.length; i++)
                  {
                    prefsSet.put(prefKeys[i], prefs.get(prefKeys[i], "No value"));                   
                  }
View Full Code Here

        Collection details = new ArrayList<String>();
        String[] keys = null;

        try {
            keys = classLoaderPreference.keys();
        }
        catch (BackingStoreException e) {
            // do nothing
        }
View Full Code Here

    public static List<String> getLastProjFiles() {
        Preferences filesPrefs = getLastProjFilesPref();
        ArrayList<String> arrayLastProjFiles = new ArrayList<String>();
        String[] keys = null;
        try {
            keys = filesPrefs.keys();
        }
        catch (BackingStoreException e) {
            logObj.warn("Error reading preferences file.", e);
        }
        if (keys != null) {
View Full Code Here

        assertEquals("8value", mock1.get("/K/E\\Y\\abc~@!#$%^&*(\\", null));
        assertNull(mock1.get("/k/e/y", null));
        assertEquals("7value", mock1.get("/K/E/Y", null));
        assertEquals("1value", mock1.get("key", null));

        String[] keys = mock1.keys();
        assertEquals(4, keys.length);
        for (int i = 0; i < keys.length; i++) {
            String key = keys[i];
            assertTrue("key".equals(key) || "KEY".equals(key)
                    || "/K/E/Y".equals(key)
View Full Code Here

        }
      }
      Preferences forModule = NbPreferences.forModule(FavouritesPanel.class);
      try
      {
        for(String key : forModule.keys())
        {
          if(forModule.get(key, "").equals(selectedValue.getLink()))
          {
            forModule.remove(key);
          }
View Full Code Here

  {
    PageListModel model = new PageListModel();
    Preferences forModule = NbPreferences.forModule(FavouritesPanel.class);
    try
    {
      for(String key : forModule.keys())
      {
        model.addElement(new Page(forModule.get(key, "")));
      }
    }
    catch(BackingStoreException ex)
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.