List of utility methods to do JTree Collapse
void | collapseAll(JTree tree) collapse All expandAll(tree, false); |
void | collapseAllNodes(JTree tree) collapse All Nodes int row = tree.getRowCount() - 1; while (row >= 0) { tree.collapseRow(row); row--; tree.expandRow(0); row = tree.getRowCount() - 1; while (row >= 0) { ... |
void | collapseAllRows(JTree tree) collapse All Rows for (int i = tree.getRowCount() - 1; i >= 0; i--) { tree.collapseRow(i); |
void | collapseTree(JTree tree) Collapses all nodes in a tree. for (int i = tree.getRowCount() - 1; i > 0; i--) { tree.collapseRow(i); tree.setSelectionRow(0); |
void | collapseTree(JTree tree) Collapse the tree final DefaultTreeModel model = (DefaultTreeModel) tree.getModel(); final DefaultMutableTreeNode root = (DefaultMutableTreeNode) model.getRoot(); collapseSubTree(tree, root, model); |
void | fullSelectionCollapse(JTree tree) full Selection Collapse int startRow = tree.getLeadSelectionRow(); int stopRow = getStopRow(tree, startRow); for (int i = stopRow - 1; i >= startRow; --i) { tree.collapseRow(i); |
Icon | getTreeSelectedCollapsedIcon() get Tree Selected Collapsed Icon return getTreeCollapsedIcon();
|
void | setCollapsedIcon(JTree tree, Icon icon) Set's the collapsed icon to use for the given JTree if that tree's UI delegate exetends from BasicTreeUI . if (tree.getUI() instanceof BasicTreeUI) { ((BasicTreeUI) tree.getUI()).setCollapsedIcon(icon); |