Package com.python.pydev.ui.hierarchy

Examples of com.python.pydev.ui.hierarchy.HierarchyNodeModel


                    request.communicateWork(com.aptana.shared_core.string.StringUtils.format("Found: %s parents for: %s", definitions.size(), d.value));

                    //and add a parent for each definition found (this will make up what the next search we will do)
                    for (IDefinition def : definitions) {
                        Definition definition = (Definition) def;
                        HierarchyNodeModel model2 = createHierarhyNodeFromClassDef(definition);
                        if (model2 != null) {
                            if (allFound.containsKey(model2) == false) {
                                allFound.put(model2, model2);
                                toFindOnRound.parents.add(model2);
                                foundOnRound.add(model2);
                            } else {
                                model2 = allFound.get(model2);
                                Assert.isNotNull(model2);
                                toFindOnRound.parents.add(model2);
                            }
                        } else {
                            withoutAstDefinitions.add(definition.value);
                        }
                    }

                    for (String def : withoutAstDefinitions) {
                        toFindOnRound.parents.add(new HierarchyNodeModel(def));
                    }
                }
            }
        } finally {
            request.getMonitor().done();
View Full Code Here


                ASTEntry entry = entries.next();
                //we're checking for those that have model.name as a parent
                ClassDef def = (ClassDef) entry.node;
                List<String> parentNames = NodeUtils.getParentNames(def, true);
                if (parentNames.contains(toFindOnRound.name)) {
                    HierarchyNodeModel newNode = new HierarchyNodeModel(module, def);
                    if (allFound.containsKey(newNode) == false) {
                        toFindOnRound.children.add(newNode);
                        allFound.put(newNode, newNode);
                        foundOnRound.add(newNode);
                    } else {
View Full Code Here

            }

            if (pointers.length == 1) {
                //ok, this is the default one.
                Definition d = pointers[0].definition;
                HierarchyNodeModel model;
                try {
                    request.pushMonitor(new SubProgressMonitor(request.getMonitor(), 5));
                    model = createHierarhyNodeFromClassDef(d);
                } finally {
                    request.popMonitor().done();
View Full Code Here

     * @param d
     * @param model
     * @return
     */
    private HierarchyNodeModel createHierarhyNodeFromClassDef(Definition d) {
        HierarchyNodeModel model = null;
        if (d.ast instanceof ClassDef) {
            model = new HierarchyNodeModel(d.module, (ClassDef) d.ast);
        }
        return model;
    }
View Full Code Here

                    new Document(barDoc), grammarVersionProvider, true);

            Module astTest = (Module) moduleTest.getAst();
            Module astBar = (Module) moduleBar.getAst();

            HierarchyNodeModel testModel = new HierarchyNodeModel("test", (ClassDef) astTest.body[2]);
            HierarchyNodeModel barModel = new HierarchyNodeModel("bar", (ClassDef) astBar.body[0]);
            testModel.parents.add(barModel);

            HashMap<SimpleNode, HierarchyNodeModel> nodeToModel = new HashMap<SimpleNode, HierarchyNodeModel>();
            nodeToModel.put((ClassDef) astTest.body[2], testModel);
View Full Code Here

        final int line = 9;
        final int col = 8;

        RefactoringRequest request = setUpFooModule(line, col, str);

        HierarchyNodeModel node = refactorer.findClassHierarchy(request, false);
        assertEquals("Bla", node.name);
        assertTrue(node.moduleName.startsWith("foo"));

        HierarchyNodeModel foo = assertIsIn("Foo", node.moduleName, node.parents);
        assertEquals(0, foo.parents.size());

    }
View Full Code Here

        RefactoringRequest request;
        request = setUpModule(line, col, str2, "fooIn2", nature2);
        request = setUpModule(line, col, str, "fooIn1", nature);

        HierarchyNodeModel node = refactorer.findClassHierarchy(request, false);
        assertEquals("FooIn1", node.name);
        assertTrue(node.moduleName.startsWith("fooIn1"));

        HierarchyNodeModel foo = assertIsIn("FooIn2", "fooIn2", node.children);
        assertEquals(0, foo.parents.size());
    }
View Full Code Here

        setUpModule(0, 0, fooIn1Original, "fooIn1Original", nature);
        setUpModule(0, 0, fooIn1Dep, "fooIn1Dep", nature);
        RefactoringRequest request;
        request = setUpModule(line, col, fooIn2, "fooIn2", nature);

        HierarchyNodeModel node = refactorer.findClassHierarchy(request, false);
        assertEquals("FooIn2", node.name);
        assertTrue(node.moduleName.startsWith("fooIn2"));

        assertEquals(node.parents.size(), 1);

        HierarchyNodeModel foo = node.parents.get(0);
        assertNotNull(foo.ast);
    }
View Full Code Here

        try {
            //            RefactorerFinds.DEBUG = true;
            //            AbstractAdditionalDependencyInfo.DEBUG = true;

            HierarchyNodeModel node = refactorer.findClassHierarchy(request, false);
            assertEquals("Bar", node.name);
            assertTrue(node.moduleName.startsWith("foo"));

            assertIsIn("Pickler", "pickle", node.parents);
            assertIsIn("Foo", node.moduleName, node.children);
View Full Code Here

        final int line = 3;
        final int col = 9;

        RefactoringRequest request = setUpFooModule(line, col);

        HierarchyNodeModel node = refactorer.findClassHierarchy(request, false);
        assertEquals("Foo", node.name);
        assertTrue(node.moduleName.startsWith("foo"));

        HierarchyNodeModel model = assertIsIn("Bar", node.moduleName, node.parents);
        assertIsIn("Pickler", "pickle", model.parents);

    }
View Full Code Here

TOP

Related Classes of com.python.pydev.ui.hierarchy.HierarchyNodeModel

Copyright © 2018 www.massapicom. 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.