| 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 |
|
@link |
| 16 |
|
|
| 17 |
|
|
| 18 |
|
@author |
| 19 |
|
|
| 20 |
|
@see |
| 21 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (12) |
Complexity: 5 |
Complexity Density: 0.71 |
|
| 22 |
|
final class JTreeMatchingPathQuery { |
| 23 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 24 |
58
|
@RunsInEDT... |
| 25 |
|
static TreePath verifyJTreeIsReadyAndFindMatchingPath(final JTree tree, final String path, |
| 26 |
|
final JTreePathFinder pathFinder) { |
| 27 |
58
|
return execute(new GuiQuery<TreePath>() { |
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
| 28 |
58
|
protected TreePath executeInEDT() {... |
| 29 |
58
|
validateIsEnabledAndShowing(tree); |
| 30 |
38
|
return matchingPathWithRootIfInvisible(tree, path, pathFinder); |
| 31 |
|
} |
| 32 |
|
}); |
| 33 |
|
} |
| 34 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 35 |
11
|
@RunsInEDT... |
| 36 |
|
static TreePath matchingPathFor(final JTree tree, final String path, final JTreePathFinder pathFinder) { |
| 37 |
11
|
return execute(new GuiQuery<TreePath>() { |
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 38 |
11
|
protected TreePath executeInEDT() {... |
| 39 |
11
|
return matchingPathWithRootIfInvisible(tree, path, pathFinder); |
| 40 |
|
} |
| 41 |
|
}); |
| 42 |
|
} |
| 43 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
| 44 |
58
|
@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 |
|
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
| 50 |
|
private JTreeMatchingPathQuery() {}... |
| 51 |
|
} |