Package java.util.prefs

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


        String path = CayennePreference.filePathToPrefereceNodePath(descriptor
                .getConfigurationSource()
                .getURL()
                .getPath());
        Preferences pref = getPreferencesNode(getProject().getClass(), "");
        return pref.node(pref.absolutePath() + path);
    }

    /**
     * Returns a new instance of CodeTemplateManager.
     */
 
View Full Code Here


                    ".xml",
                    "");
            String oldName = oldPath.replace(".xml", "");

            Preferences oldPref = getProjectController().getPreferenceForProject();
            String projPath = oldPref.absolutePath().replace(oldName, "");
            Preferences newPref = getProjectController().getPreferenceForProject().node(
                    projPath + newName);
            RenamedPreferences.copyPreferences(newPref, getProjectController()
                    .getPreferenceForProject(), false);
        }
View Full Code Here

                // get old preference
                Preferences childNode = pref.node(child);

                if (!equalsPath(oldNode, childNode)) {
                    // path to node
                    String path = childNode.absolutePath().replace(oldPath, newPath);

                    // copy all preferences in this node
                    String[] names = childNode.keys();
                    Preferences newPref = Preferences.userRoot().node(path);
                    for (int i = 0; i < names.length; i++) {
View Full Code Here

    private static boolean equalsPath(List<Preferences> listPref, Preferences pref) {
        if (listPref != null) {
            Iterator<Preferences> it = listPref.iterator();
            while (it.hasNext()) {
                Preferences next = it.next();
                String pathInList = (String) next.absolutePath();
                String path = (String) pref.absolutePath();
                if (pathInList.equals(path)) {
                    return true;
                }
            }
View Full Code Here

        if (getApplication().getProject() == null) {
            return getApplication().getPreferencesNode(getView().getClass(), "");
        }

        Preferences pref = getApplication().getMainPreferenceForProject();
        String pathToProject = pref.absolutePath();
        String path = pathToProject
                + "/"
                + getView().getClass().getName().replace(".", "/");

        return pref.node(path);
View Full Code Here

            p = Preferences.systemNodeForPackage(Object.class);
        } catch (SecurityException e) {
            // may be caused by absence of privileges on the underlying OS
            return;
        }
        assertEquals("/java/lang", p.absolutePath());
        assertTrue(p instanceof AbstractPreferences);
        Preferences root = Preferences.systemRoot();
        Preferences parent = root.node("java");
        assertSame(parent, p.parent());
        assertFalse(p.isUserNode());
View Full Code Here

    }

    public void testSystemRoot() throws BackingStoreException {
        Preferences p = Preferences.systemRoot();
        assertTrue(p instanceof AbstractPreferences);
        assertEquals("/", p.absolutePath());
        assertSame(null, p.parent());
        assertFalse(p.isUserNode());
        assertEquals("", p.name());
        assertEquals("System Preference Node: " + p.absolutePath(), p
                .toString());
View Full Code Here

        assertTrue(p instanceof AbstractPreferences);
        assertEquals("/", p.absolutePath());
        assertSame(null, p.parent());
        assertFalse(p.isUserNode());
        assertEquals("", p.name());
        assertEquals("System Preference Node: " + p.absolutePath(), p
                .toString());
        // assertEquals(0, p.childrenNames().length);
        // assertEquals(0, p.keys().length);
    }
View Full Code Here

        assertEquals(8192, Preferences.MAX_VALUE_LENGTH);
    }

    public void testUserNodeForPackage() throws BackingStoreException {
        Preferences p = Preferences.userNodeForPackage(Object.class);
        assertEquals("/java/lang", p.absolutePath());
        assertTrue(p instanceof AbstractPreferences);
        Preferences root = Preferences.userRoot();
        Preferences parent = root.node("java");
        assertSame(parent, p.parent());
        assertTrue(p.isUserNode());
View Full Code Here

    }

    public void testUserRoot() throws BackingStoreException {
        Preferences p = Preferences.userRoot();
        assertTrue(p instanceof AbstractPreferences);
        assertEquals("/", p.absolutePath());
        assertSame(null, p.parent());
        assertTrue(p.isUserNode());
        assertEquals("", p.name());
        assertEquals("User Preference Node: " + p.absolutePath(), p.toString());
        // assertEquals(0, p.childrenNames().length);
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.