Examples of TreePathParser


Examples of abbot.script.parsers.TreePathParser

    }

    public void testParsePath() {
        JTreeLocation loc = new JTreeLocation();
        String parse = "[root, parent, child]";
        TreePath path = (TreePath)new TreePathParser().parse(parse);
        JTreeLocation loc2 = new JTreeLocation(path);
        assertEquals("Badly parsed: " + parse,
                     loc2, loc.parse("\"" + parse + "\""));
        assertEquals("Wrong path-based toString",
                     "\"" + parse + "\"", loc.toString());
View Full Code Here

Examples of abbot.script.parsers.TreePathParser

    public void testParsePathHiddenRoot() {
        JTreeLocation loc = new JTreeLocation();
        String parse = "[null, parent, child]";
        assertEquals("Badly parsed: " + parse,
                     new JTreeLocation((TreePath)new TreePathParser().
                         parse(parse)),
                     loc.parse("\"" + parse + "\""));
    }
View Full Code Here

Examples of abbot.script.parsers.TreePathParser

        tree.setRootVisible(false);
        Object root = tree.getModel().getRoot();
        Object parent = tree.getModel().getChild(root, 0);
        Object child = tree.getModel().getChild(parent, 0);
        TreePath p1 = (TreePath)
            new TreePathParser().parse("[null, parent, child]");
        TreePath p2 = JTreeLocation.findMatchingPath(tree, p1);
        assertTrue("Got a null path", p2 != null);
        assertEquals("Wrong root", root, p2.getPathComponent(0));
        assertEquals("Wrong parent", parent, p2.getPathComponent(1));
        assertEquals("Wrong child", child, p2.getPathComponent(2));

        p1 = (TreePath)new TreePathParser().parse("[parent, child]");
        p2 = JTreeLocation.findMatchingPath(tree, p1);
        assertTrue("Got a null path", p2 != null);
        assertEquals("Wrong root", root, p2.getPathComponent(0));
        assertEquals("Wrong parent", parent, p2.getPathComponent(1));
        assertEquals("Wrong child", child, p2.getPathComponent(2));
View Full Code Here

Examples of abbot.script.parsers.TreePathParser

            inExpansion = true;
            encoded = encoded.substring(1);
        }
        if (encoded.startsWith("\"") && encoded.endsWith("\"")) {
            String path = encoded.substring(1, encoded.length()-1);
            treePath = (TreePath)new TreePathParser().parse(path);
            return this;
        }
        else if (encoded.startsWith("[") && encoded.endsWith("]")) {
            String num = encoded.substring(1, encoded.length()-1).trim();
            try {
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.