/** * @param tree JTree to collect expanded paths from. * @param paths output parameter. */ public static void collectExpandedPaths( @NotNull final JTree tree, @NotNull final List<TreePath> paths) { final TreeModel model = tree.getModel(); final Object root = model.getRoot(); LOG.assertTrue(root != null); collectExpandedPathsImpl(tree, paths, new TreePath(root)); }
public static ActionCallback selectFirstNode(final JTree tree) { final TreeModel model = tree.getModel(); final Object root = model.getRoot(); TreePath selectionPath = new TreePath(root); if (!tree.isRootVisible() && model.getChildCount(root) > 0) selectionPath = selectionPath.pathByAddingChild(model.getChild(root, 0)); return selectPath(tree, selectionPath); }
@Override public boolean isModified(CodeStyleSettings settings) { TreeModel treeModel = myTreeTable.getTree().getModel(); TreeNode root = (TreeNode) treeModel.getRoot(); if (isModified(root, settings)) { return true; } return false; }
@Override protected void resetImpl(final CodeStyleSettings settings) { TreeModel treeModel = myTreeTable.getTree().getModel(); TreeNode root = (TreeNode) treeModel.getRoot(); resetNode(root, settings); }
@Override public void apply(CodeStyleSettings settings) { TreeModel treeModel = myTreeTable.getTree().getModel(); TreeNode root = (TreeNode) treeModel.getRoot(); applyNode(root, settings); }
private String getFilterStatus(TreeModel displayModel, TreeModel originalModel) { int count = displayModel.getChildCount(displayModel.getRoot()); String text = count + " out of " + originalModel.getChildCount(originalModel.getRoot()) + " files"; return text; }