Clover Coverage Report - FEST Swing 1.2
Coverage timestamp: Tue Jun 1 2010 15:19:25 PDT
../../../../img/srcFileCovDistChart10.png 0% of files have more coverage
3   30   2   1.5
0   17   0.67   2
2     1  
1    
16.7% of code in this file is excluded from these metrics.
 
  JTreeChildOfPathCountQuery       Line # 17 3 16.7% 2 0 100% 1.0
 
No Tests
 
1    package org.fest.swing.driver;
2   
3    import static org.fest.swing.edt.GuiActionRunner.execute;
4   
5    import javax.swing.JTree;
6    import javax.swing.tree.TreePath;
7   
8    import org.fest.swing.annotation.RunsInEDT;
9    import org.fest.swing.edt.GuiQuery;
10   
11    /**
12    * Understands an action, executed in the event dispatch thread, that returns how many children a node in a
13    * <code>{@link JTree}</code> has.
14    *
15    * @author Alex Ruiz
16    */
 
17    final class JTreeChildOfPathCountQuery {
18   
 
19  57 toggle @RunsInEDT
20    static int childCount(final JTree tree, final TreePath path) {
21  57 return execute(new GuiQuery<Integer>() {
 
22  57 toggle protected Integer executeInEDT() {
23  57 Object lastPathComponent = path.getLastPathComponent();
24  57 return tree.getModel().getChildCount(lastPathComponent);
25    }
26    });
27    }
28   
 
29    toggle private JTreeChildOfPathCountQuery() {}
30    }