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
4   49   3   2
2   18   0.75   2
2     1.5  
1    
11.1% of code in this file is excluded from these metrics.
 
  JTreeExpandPathTask       Line # 36 4 11.1% 3 0 100% 1.0
 
No Tests
 
1    /*
2    * Created on Aug 19, 2008
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 @2008-2010 the original author or authors.
15    */
16    package org.fest.swing.driver;
17   
18    import static org.fest.swing.driver.JTreeAddRootIfInvisibleTask.addRootIfInvisible;
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.GuiTask;
26   
27    /**
28    * Understands a task that ensures that the node identified by the specified path is expanded and viewable. This action
29    * is executed in the event dispatch thread.
30    * @see JTree#isExpanded(TreePath)
31    * @see JTree#expandPath(TreePath)
32    *
33    * @author Yvonne Wang
34    * @author Alex Ruiz
35    */
 
36    final class JTreeExpandPathTask {
37   
 
38  58 toggle @RunsInEDT
39    static void expandTreePath(final JTree tree, final TreePath path) {
40  58 execute(new GuiTask() {
 
41  58 toggle protected void executeInEDT() {
42  58 TreePath realPath = addRootIfInvisible(tree, path);
43  32 if (!tree.isExpanded(path)) tree.expandPath(realPath);
44    }
45    });
46    }
47   
 
48    toggle private JTreeExpandPathTask() {}
49    }