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
7   51   5   1.4
0   34   0.71   5
5     1  
1    
7.7% of code in this file is excluded from these metrics.
 
  JTreeMatchingPathQuery       Line # 22 7 7.7% 5 0 100% 1.0
 
No Tests
 
1    package org.fest.swing.driver;
2   
3    import static org.fest.swing.driver.ComponentStateValidator.validateIsEnabledAndShowing;
4    import static org.fest.swing.driver.JTreeAddRootIfInvisibleTask.addRootIfInvisible;
5    import static org.fest.swing.edt.GuiActionRunner.execute;
6   
7    import javax.swing.JTree;
8    import javax.swing.tree.TreePath;
9   
10    import org.fest.swing.annotation.RunsInCurrentThread;
11    import org.fest.swing.annotation.RunsInEDT;
12    import org.fest.swing.edt.GuiQuery;
13   
14    /**
15    * Understands an action, executed in the event dispatch thread, that finds a path in a <code>{@link JTree}</code>
16    * that matches a given <code>String</code>.
17    *
18    * @author Alex Ruiz
19    *
20    * @see JTreePathFinder
21    */
 
22    final class JTreeMatchingPathQuery {
23   
 
24  58 toggle @RunsInEDT
25    static TreePath verifyJTreeIsReadyAndFindMatchingPath(final JTree tree, final String path,
26    final JTreePathFinder pathFinder) {
27  58 return execute(new GuiQuery<TreePath>() {
 
28  58 toggle protected TreePath executeInEDT() {
29  58 validateIsEnabledAndShowing(tree);
30  38 return matchingPathWithRootIfInvisible(tree, path, pathFinder);
31    }
32    });
33    }
34   
 
35  11 toggle @RunsInEDT
36    static TreePath matchingPathFor(final JTree tree, final String path, final JTreePathFinder pathFinder) {
37  11 return execute(new GuiQuery<TreePath>() {
 
38  11 toggle protected TreePath executeInEDT() {
39  11 return matchingPathWithRootIfInvisible(tree, path, pathFinder);
40    }
41    });
42    }
43   
 
44  58 toggle @RunsInCurrentThread
45    static TreePath matchingPathWithRootIfInvisible(JTree tree, String path, JTreePathFinder pathFinder) {
46  58 TreePath matchingPath = pathFinder.findMatchingPath(tree, path);
47  44 return addRootIfInvisible(tree, matchingPath);
48    }
49   
 
50    toggle private JTreeMatchingPathQuery() {}
51    }