Java Code Examples for org.openide.nodes.Node.getNewTypes()

The following are Jave code examples for showing how to use getNewTypes() of the org.openide.nodes.Node class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: incubator-netbeans   File: NewAction.java   Source Code and License Vote up 6 votes
private NewType[] newTypes() {
    if (lookup != null) {
        java.util.Collection c = lookup.lookupResult(Node.class).allItems();

        if (c.size() == 1) {
            java.util.Iterator it = c.iterator();

            while (it.hasNext()) {
                Lookup.Item item = (Lookup.Item) it.next();
                Node n = (Node) item.getInstance();

                if (n != null) {
                    if (n == prevNode && prevTypes != null) {
                        return prevTypes;
                    }
                    prevNode = n;
                    prevTypes = n.getNewTypes();
                    return prevTypes;
                }
            }
        }
    }

    return getNewTypes();
}
 
Example 2
Project: incubator-netbeans   File: AsynchronousTest.java   Source Code and License Vote up 5 votes
private void inspectNode(Node n) {
    n.getDisplayName();
    n.getHtmlDisplayName();
    n.getShortDescription();
    n.getIcon(BeanInfo.ICON_COLOR_16x16);
    n.canCopy();
    n.canCut();
    n.canRename();
    n.getNewTypes();
    n.getActions(true);
    n.getPreferredAction();
    inspectProperties(n);
}