Examples of childrenNames()


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

    {
        Preferences prefs = Preferences.userRoot();
        // Test without children.
        try
        {
            String[] childrenNames = prefs.childrenNames();
            if (childrenNames.length > 0)
            {
                assertTrue("expected no children, " + childrenNames.length + ", " + childrenNames[0],
                        childrenNames.length == 0);
            }
View Full Code Here

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

        removeNode.removeNode();
        assertFalse(prefs.nodeExists(test_node));

        try
        {
            removeNode.childrenNames();
            assertFalse("An IllegalStateException should have been thrown by the AbtractPreferences class", true);
        }
        catch (IllegalStateException e)
        {
View Full Code Here

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

            in = PreferencesTest.class
                    .getResourceAsStream("/prefs/java/util/prefs/userprefs.xml");
            Preferences.importPreferences(in);

            prefs = Preferences.userNodeForPackage(PreferencesTest.class);
            assertEquals(1, prefs.childrenNames().length);
            assertTrue(prefs.nodeExists("mock/child/grandson"));
            assertEquals("newvalue", prefs.get("prefskey", null));
            assertEquals("oldvalue2", prefs.get("prefskey2", null));
            assertEquals("newvalue3", prefs.get("prefskey3", null));
View Full Code Here

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

        checkException();
        Preferences p = parent();
        if (p instanceof MockAbstractPreferences) {
            ((MockAbstractPreferences) p).childs.remove(name());
        } else {
            String[] children = p.childrenNames();
            for (String child : children) {
                p.node(child).removeNode();
            }
        }
    }
View Full Code Here

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

        final Preferences favouritesNode = prefs.node(FAVOURITES_NODE);
       
        // Get all favourites
        String favouriteNodeNames[] =new String[0];
        try {
            favouriteNodeNames = favouritesNode.childrenNames();
        } catch (final BackingStoreException ex) {
            ex.printStackTrace();
        }
       
        // Copy for each connection data into Favourite array
View Full Code Here

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

            prefs.put("prefskey2", "oldvalue2");
            in = PreferencesTest.class.getResourceAsStream("/prefs/java/util/prefs/userprefs.xml");
            Preferences.importPreferences(in);

            prefs = Preferences.userNodeForPackage(PreferencesTest.class);
            assertEquals(1, prefs.childrenNames().length);
            assertTrue(prefs.nodeExists("mock/child/grandson"));
            assertEquals("newvalue", prefs.get("prefskey", null));
            assertEquals("oldvalue2", prefs.get("prefskey2", null));
            assertEquals("newvalue3", prefs.get("prefskey3", null));
View Full Code Here

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

    public void testAbstractMethods() {
        Preferences p = new MockPreferences();
        p.absolutePath();
        try {
            p.childrenNames();
        } catch (BackingStoreException e4) {
        }
        try {
            p.clear();
        } catch (BackingStoreException e5) {
View Full Code Here

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

    protected Collection<Matrix> read(Preferences pref) throws BackingStoreException {
        ArrayList<Matrix> arr = new ArrayList<Matrix>();
        for (String cluster : pref.childrenNames()) {
            Preferences clusterNode = pref.node(cluster);
            for (String reason : clusterNode.childrenNames()) {
                Preferences reasonNode = clusterNode.node(reason);
                int countTrue = reasonNode.getInt(Boolean.TRUE.toString(), 0);
                int countFalse = reasonNode.getInt(Boolean.FALSE.toString(), 0);

                if (countTrue > 0) {
View Full Code Here

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

        try {

            Preferences implementations = Preferences.userRoot().node(applicationName).node(pluginInterfaceName);

            for (String currentPluginImplementationId : implementations.childrenNames())
                if (implementations.node(currentPluginImplementationId).get("value", "local:").equals(pluginImplementationAddress)) {
                    implementations.node(currentPluginImplementationId).removeNode();
                    break;
                }
View Full Code Here

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

        try {

            Preferences implementations = Preferences.userRoot().node(applicationName).node(pluginInterfaceName);

            for (String currentPluginImplementationId : implementations.childrenNames())
                if (implementations.node(currentPluginImplementationId).get("value", "local:").equals(pluginImplementationAddress))
                    return true;

        } catch (BackingStoreException ex) {
            Logger.getLogger(JavaPreferencesPersistenceDriver.class.getName()).log(Level.SEVERE, null, 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.