| 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 |
|
|
| 18 |
|
@link |
| 19 |
|
|
| 20 |
|
@author |
| 21 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (5) |
Complexity: 1 |
Complexity Density: 0.25 |
|
| 22 |
|
final class JTreeToggleExpandStateTask { |
| 23 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (4) |
Complexity: 1 |
Complexity Density: 0.25 |
|
| 24 |
1
|
@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 |
|
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
| 32 |
|
private JTreeToggleExpandStateTask() {}... |
| 33 |
|
} |