Package java.util.prefs

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


        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


        recentWorkspaces.clear();

        TreeMap<Integer, String> numberToFile = new TreeMap<Integer, String>();
        Preferences recentNode = preferences.node(SETTINGS_RECENT_WORKSPACES);
        try {
            String[] keys = recentNode.keys();
            for (String key : keys) {
                String fileName = recentNode.get(key, null);
                if (fileName != null) {
                    numberToFile.put(new Integer(key), fileName);
                }
View Full Code Here

        assertEquals(node.getInt("threshold", 999), 3000);
        assertEquals(node.getDouble("pi", Math.PI), Math.PI);
        node = config.node("origins/filters");
        assertEquals("/origins/filters", node.absolutePath());
        node = config.node("/request");
        assertTrue(Arrays.asList(node.keys()).contains("routerId"));
        assertFalse(Arrays.asList(node.keys()).contains("missingThing"));

        /* Ensure that comments are being ignored */
        assertEquals(config.childrenNames().length, 4);
        assertEquals(config.keys().length, 3);
View Full Code Here

        assertEquals(node.getDouble("pi", Math.PI), Math.PI);
        node = config.node("origins/filters");
        assertEquals("/origins/filters", node.absolutePath());
        node = config.node("/request");
        assertTrue(Arrays.asList(node.keys()).contains("routerId"));
        assertFalse(Arrays.asList(node.keys()).contains("missingThing"));

        /* Ensure that comments are being ignored */
        assertEquals(config.childrenNames().length, 4);
        assertEquals(config.keys().length, 3);

View Full Code Here

                        String notePath = "/com/sun/media/sound/softsynthesizer";
                        try {
                            Preferences prefroot = Preferences.userRoot();
                            if (prefroot.nodeExists(notePath)) {
                                Preferences prefs = prefroot.node(notePath);
                                String[] prefs_keys = prefs.keys();
                                for (String prefs_key : prefs_keys) {
                                    String val = prefs.get(prefs_key, null);
                                    if (val != null)
                                        p.setProperty(prefs_key, val);
                                }
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

    {
        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

            String newPassword = admin.generatePassword();

            String urlGUID = makeGUID(userName, newPassword);

            Preferences pref = user.getUserAttributes();
            String[] keys = pref.keys();
            Map userAttributes = new HashMap();
            if (keys != null)
            {
                for (int ix = 0; ix < keys.length; ix++)
                {
View Full Code Here

                        wktText.setText(wkt);
                        Preferences node = findNode(matcher.group(1));
                        if (node != null) {
                            Preferences kn = node.node(ALIASES_ID);
                            try {
                                String[] keywords = kn.keys();
                                if (keywords.length > 0) {
                                    StringBuffer buffer = new StringBuffer();
                                    for( String string : keywords ) {
                                        buffer.append(", "); //$NON-NLS-1$
                                        buffer.append(string);
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.