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
6   58   4   1.5
0   28   0.67   4
4     1  
1    
9.1% of code in this file is excluded from these metrics.
 
  JTreeNodeTextQuery       Line # 34 6 9.1% 4 0 100% 1.0
 
No Tests
 
1    /*
2    * Created on Mar 10, 2010
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5    * in compliance with the License. You may obtain a copy of the License at
6    *
7    * http://www.apache.org/licenses/LICENSE-2.0
8    *
9    * Unless required by applicable law or agreed to in writing, software distributed under the License
10    * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
11    * or implied. See the License for the specific language governing permissions and limitations under
12    * the License.
13    *
14    * Copyright @2010 the original author or authors.
15    */
16    package org.fest.swing.driver;
17   
18    import static org.fest.swing.driver.JTreeMatchingPathQuery.matchingPathWithRootIfInvisible;
19    import static org.fest.swing.edt.GuiActionRunner.execute;
20   
21    import javax.swing.JTree;
22    import javax.swing.tree.TreePath;
23   
24    import org.fest.swing.annotation.RunsInEDT;
25    import org.fest.swing.edt.GuiQuery;
26   
27    /**
28    * Understands a query that returns the text of a node in a <code>{@link JTree}</code>.
29    *
30    * @author Alex Ruiz
31    *
32    * @since 1.2
33    */
 
34    final class JTreeNodeTextQuery {
35   
 
36  2 toggle @RunsInEDT
37    static String nodeText(final JTree tree, final int row, final JTreeLocation location, final JTreePathFinder pathFinder) {
38  2 return execute(new GuiQuery<String>() {
 
39  2 toggle protected String executeInEDT() {
40  2 TreePath matchingPath = location.pathFor(tree, row);
41  1 return pathFinder.cellReader().valueAt(tree, matchingPath.getLastPathComponent());
42    }
43    });
44    }
45   
 
46  2 toggle @RunsInEDT
47    static String nodeText(final JTree tree, final String path, final JTreePathFinder pathFinder) {
48  2 return execute(new GuiQuery<String>() {
 
49  2 toggle protected String executeInEDT() {
50  2 TreePath matchingPath = matchingPathWithRootIfInvisible(tree, path, pathFinder);
51  1 return pathFinder.cellReader().valueAt(tree, matchingPath.getLastPathComponent());
52    }
53    });
54    }
55   
56   
 
57    toggle private JTreeNodeTextQuery() {}
58    }