psmith      2003/10/09 20:13:20

  Modified:    src/java/org/apache/log4j/chainsaw LoggerNameTreePanel.java
  Log:
  Fixed Collapse action, was a little too collapsy for it's own good
  and was collapsing everything rather than stopping at
  the currently selected node.
  
  Also removed the limition on expanding all nodes under the
  root.  The original rationale was that the tree could be huge
  and so ignored root expansion, but this seems less of a worry.
  
  Revision  Changes    Path
  1.15      +14 -17    
jakarta-log4j/src/java/org/apache/log4j/chainsaw/LoggerNameTreePanel.java
  
  Index: LoggerNameTreePanel.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-log4j/src/java/org/apache/log4j/chainsaw/LoggerNameTreePanel.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- LoggerNameTreePanel.java  9 Oct 2003 22:07:12 -0000       1.14
  +++ LoggerNameTreePanel.java  10 Oct 2003 03:13:20 -0000      1.15
  @@ -693,18 +693,12 @@
           DefaultMutableTreeNode child =
             (DefaultMutableTreeNode) enumeration.nextElement();
   
  -        if (child.getParent() != null) {
  +        if (child.getParent() != null && child!=node) {
             TreeNode[] nodes =
               ((DefaultMutableTreeNode) child.getParent()).getPath();
   
             TreePath treePath = new TreePath(nodes);
  -
  -          while ((treePath != null) && (treePath.getPathCount() > 0)) {
  -            DefaultMutableTreeNode potentialRoot =
  -              (DefaultMutableTreeNode) treePath.getPathComponent(0);
  -            logTree.collapsePath(treePath);
  -            treePath = treePath.getParentPath();
  -          }
  +          logTree.collapsePath(treePath);
           }
         }
       }
  @@ -729,15 +723,18 @@
       for (int i = 0; i < paths.length; i++) {
         TreePath path = paths[i];
   
  -      /**
  -       * Handle an expansion of the Root node by only doing the first level.
  -       * Safe...
  -       */
  -      if (path.getPathCount() == 1) {
  -        logTree.expandPath(path);
  -
  -        return;
  -      }
  +/**
  + * TODO this is commented out, right now it expands all nodes including the root, 
so if there is a large tree..... look out.
  + */
  +//      /**
  +//       * Handle an expansion of the Root node by only doing the first level.
  +//       * Safe...
  +//       */
  +//      if (path.getPathCount() == 1) {
  +//        logTree.expandPath(path);
  +//
  +//        return;
  +//      }
   
         DefaultMutableTreeNode treeNode =
           (DefaultMutableTreeNode) path.getLastPathComponent();
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to