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   33   1   4
0   19   0.25   1
1     1  
1    
16.7% of code in this file is excluded from these metrics.
 
  JTreeToggleExpandStateTask       Line # 22 4 16.7% 1 0 100% 1.0
 
No Tests
 
1    package org.fest.swing.driver;
2   
3    import static org.fest.assertions.Assertions.assertThat;
4    import static org.fest.reflect.core.Reflection.method;
5   
6    import java.awt.Point;
7   
8    import javax.swing.JTree;
9    import javax.swing.plaf.TreeUI;
10    import javax.swing.plaf.basic.BasicTreeUI;
11    import javax.swing.text.JTextComponent;
12    import javax.swing.tree.TreePath;
13   
14    import org.fest.swing.annotation.RunsInCurrentThread;
15   
16    /**
17    * Understands a task that uses reflection to toggle the "expand state" of a node in a given
18    * <code>{@link JTextComponent}</code>. This task is executed in the event dispatch thread.
19    *
20    * @author Yvonne Wang
21    */
 
22    final class JTreeToggleExpandStateTask {
23   
 
24  1 toggle @RunsInCurrentThread
25    static void toggleExpandState(final JTree tree, final Point pathLocation) {
26  1 TreePath path = tree.getPathForLocation(pathLocation.x, pathLocation.y);
27  1 TreeUI treeUI = tree.getUI();
28  1 assertThat(treeUI).isInstanceOf(BasicTreeUI.class);
29  1 method("toggleExpandState").withParameterTypes(TreePath.class).in(treeUI).invoke(path);
30    }
31   
 
32    toggle private JTreeToggleExpandStateTask() {}
33    }