Search in sources :

Example 1 with Children

use of org.openide.nodes.Children in project ACS by ACS-Community.

the class MultiListExplorer method selectNthChildren.

protected static void selectNthChildren(ExplorerManager explorerManager, int n) {
    Node exploredNode = explorerManager.getExploredContext();
    if (exploredNode == null)
        return;
    Children children = exploredNode.getChildren();
    try {
        if (children == null || children.getNodesCount() == 0) {
            explorerManager.setSelectedNodes(new Node[0]);
        } else {
            if (n >= children.getNodesCount()) {
                explorerManager.setSelectedNodes(new Node[] { children.getNodes()[0] });
            } else {
                explorerManager.setSelectedNodes(new Node[] { children.getNodes()[n] });
            }
        }
    } catch (java.beans.PropertyVetoException e) {
        GPManager.notify(GPManager.WARNING, e);
    }
}
Also used : GPNode(cern.gp.nodes.GPNode) Node(org.openide.nodes.Node) Children(org.openide.nodes.Children)

Aggregations

GPNode (cern.gp.nodes.GPNode)1 Children (org.openide.nodes.Children)1 Node (org.openide.nodes.Node)1