コード例 #1
0
ファイル: TreeUtil.java プロジェクト: jexp/idea2
  /**
   * @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));
  }
コード例 #2
0
ファイル: TreeUtil.java プロジェクト: jexp/idea2
 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);
 }
コード例 #3
0
 @Override
 public boolean isModified(CodeStyleSettings settings) {
   TreeModel treeModel = myTreeTable.getTree().getModel();
   TreeNode root = (TreeNode) treeModel.getRoot();
   if (isModified(root, settings)) {
     return true;
   }
   return false;
 }
コード例 #4
0
 @Override
 protected void resetImpl(final CodeStyleSettings settings) {
   TreeModel treeModel = myTreeTable.getTree().getModel();
   TreeNode root = (TreeNode) treeModel.getRoot();
   resetNode(root, settings);
 }
コード例 #5
0
 @Override
 public void apply(CodeStyleSettings settings) {
   TreeModel treeModel = myTreeTable.getTree().getModel();
   TreeNode root = (TreeNode) treeModel.getRoot();
   applyNode(root, settings);
 }
コード例 #6
0
 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;
 }