private boolean openNode(TreeNode node, TreePlace place) { int childCount = node.getChildCount(); for (int i = 0; i < childCount; i++) { if (node.getChildValue(i).equals(place)) { //node.setChildOpen(i, true, true); return true; } else if (!node.isChildLeaf(i)) { boolean wasOpen = node.isChildOpen(i); TreeNode child = node.setChildOpen(i, true); if (child != null && openNode(child, place)) { return true; } else if (!wasOpen) { node.setChildOpen(i, false); } } } return false; }
/** * Sets the node that will be selected when the CellTree gains keyboard focus. * * @param parentNode a node in the tree that is currently open * @param childIndex the index of the child to select * @param stealFocus if true, also change keyboard focus to this CellTree. */ public void setKeyboardSelectedTreeNode(TreeNode parentNode, int childIndex, boolean stealFocus) { CellTreeNodeView nodeView = getCellTreeNodeView(parentNode); // Just to ensure necessary checks are done, e.g. // assertNotDestroyed();checkChildBounds(childIndex);flush(); nodeView.getTreeNode().getChildValue(childIndex); keyboardSelect(nodeView.getChildNode(childIndex), stealFocus); }
/** * Sets the node that will be selected when the CellTree gains keyboard focus. * * @param parentNode a node in the tree that is currently open * @param childIndex the index of the child to select * @param stealFocus if true, also change keyboard focus to this CellTree. */ public void setKeyboardSelectedTreeNode(TreeNode parentNode, int childIndex, boolean stealFocus) { CellTreeNodeView nodeView = getCellTreeNodeView(parentNode); // Just to ensure necessary checks are done, e.g. // assertNotDestroyed();checkChildBounds(childIndex);flush(); nodeView.getTreeNode().getChildValue(childIndex); keyboardSelect(nodeView.getChildNode(childIndex), stealFocus); }
/** * Sets the node that will be selected when the CellTree gains keyboard focus. * * @param parentNode a node in the tree that is currently open * @param childIndex the index of the child to select * @param stealFocus if true, also change keyboard focus to this CellTree. */ public void setKeyboardSelectedTreeNode(TreeNode parentNode, int childIndex, boolean stealFocus) { CellTreeNodeView nodeView = getCellTreeNodeView(parentNode); // Just to ensure necessary checks are done, e.g. // assertNotDestroyed();checkChildBounds(childIndex);flush(); nodeView.getTreeNode().getChildValue(childIndex); keyboardSelect(nodeView.getChildNode(childIndex), stealFocus); }