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);
}
}