Package org.openide.nodes

Examples of org.openide.nodes.Node


                    if (rootNode == null) {
                        continue;
                    }
                    DataFolder folder = getFolder(rootNode);
                    if (folder != null) {
                        Node mvcNode = new MVCNode(folder, null, rootNode.getName());
                        list.add(mvcNode);
                    }
                }
                return list;
            }
View Full Code Here


        SwingUtilities.invokeAndWait(new Runnable() {
            @Override
            public void run() {
                LogicalViewProvider view = project.getLookup().lookup(LogicalViewProvider.class);
                Node root = view.createLogicalView();

                Node[] children = root.getChildren().getNodes();
                for (Node child: children) {
                    if (child instanceof JavaDependenciesNode) {
                        fail("Dependencies node must not be present.");
                    }
                }
View Full Code Here

        SwingUtilities.invokeAndWait(new Runnable() {
            @Override
            public void run() {
                LogicalViewProvider view = project.getLookup().lookup(LogicalViewProvider.class);
                Node root = view.createLogicalView();

                verifyNoJavaActions(root.getActions(false));
                verifyNoJavaActions(root.getActions(true));
            }
        });
    }
View Full Code Here

        SwingUtilities.invokeAndWait(new Runnable() {
            @Override
            public void run() {
                LogicalViewProvider view = project.getLookup().lookup(LogicalViewProvider.class);
                Node root = view.createLogicalView();

                Lookup children = Lookups.fixed((Object[])root.getChildren().getNodes());
                JavaDependenciesNode dependenciesNode = children.lookup(JavaDependenciesNode.class);
                BuildScriptsNode buildScriptsNode = children.lookup(BuildScriptsNode.class);

                assertNotNull("Must have a dependencies node", dependenciesNode);
                assertNotNull("Must have a build scripts node", buildScriptsNode);
View Full Code Here

        SwingUtilities.invokeAndWait(new Runnable() {
            @Override
            public void run() {
                LogicalViewProvider view = project.getLookup().lookup(LogicalViewProvider.class);
                Node root = view.createLogicalView();

                verifyJavaDocActionIsAdded(root.getActions(false));
                verifyJavaDocActionIsAdded(root.getActions(true));
            }
        });
    }
View Full Code Here

        if (target instanceof FileObject) {
            FileObject fileObject = (FileObject)target;

            Node[] nodes = root.getChildren().getNodes(false);
            for (Node child: nodes) {
                Node found = PackageView.findPath(child, fileObject);
                if (found != null) {
                    return found;
                }
            }
            for (Node node: nodes) {
                for (Node childNode: node.getChildren().getNodes(false)) {
                    Node result = PackageView.findPath(childNode, fileObject);
                    if (result != null) {
                        return result;
                    }
                    Node found = findNodeByFileDataObject(childNode, fileObject);
                    if (found != null) {
                        return found;
                    }
                }
            }
View Full Code Here

                while (strtok.hasMoreTokens()) {
                    String token = strtok.nextToken();
                    path.add(token);
                }
                try {
                    Node folderNode = folder.equals(xfo) ? node : NodeOp.findPath(node, Collections.enumeration(path));
                    if (fo.isFolder()) {
                        return folderNode;
                    }
                    else {
                        Node[] childs = folderNode.getChildren().getNodes(false);
                        for (Node child: childs) {
                            DataObject dobj = child.getLookup().lookup(DataObject.class);
                            if (dobj != null && dobj.getPrimaryFile().getNameExt().equals(fo.getNameExt())) {
                                return child;
                            }
View Full Code Here

    private static class FolderIconHolder {
        public static final Image IMAGE = loadIcon();

        private static Image loadIcon() {
            Node n = DataFolder.findFolder(FileUtil.getConfigRoot()).getNodeDelegate();
            ImageIcon original = new ImageIcon(n.getIcon(BeanInfo.ICON_COLOR_16x16));
            Image result = original.getImage();
            if (result == null) {
                LOGGER.warning("Failed to load the folder icon.");
            }
            return result;
View Full Code Here

        @Override
        public Node createNode() {
            DataObject fileObject = getProjectDirObj();

            Node baseNode = fileObject != null
                    ? fileObject.getNodeDelegate()
                    : Node.EMPTY;

            // TODO: Update the created node if the underlying project is reloaded.
            return new FilterNode(baseNode.cloneNode()) {
                @Override
                public Image getIcon(int type) {
                    return NbIcons.getGradleIcon();
                }
View Full Code Here

            DataFolder TextDataObject =
                    DataFolder.findFolder(Text);

            //Get its default node—we'll wrap our node around it to change the
            //display name, icon, etc.
            Node realTextFolderNode = TextDataObject.getNodeDelegate();

            //This FilterNode will be our project node
            return new TextNode(realTextFolderNode, project);

        } catch (DataObjectNotFoundException donfe) {
View Full Code Here

TOP

Related Classes of org.openide.nodes.Node

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.