| 1 |
|
|
| 2 |
|
|
| 3 |
|
|
| 4 |
|
|
| 5 |
|
|
| 6 |
|
|
| 7 |
|
|
| 8 |
|
|
| 9 |
|
|
| 10 |
|
|
| 11 |
|
|
| 12 |
|
|
| 13 |
|
|
| 14 |
|
|
| 15 |
|
|
| 16 |
|
package org.fest.swing.core; |
| 17 |
|
|
| 18 |
|
import java.awt.Component; |
| 19 |
|
import java.awt.Container; |
| 20 |
|
|
| 21 |
|
import org.fest.swing.annotation.RunsInCurrentThread; |
| 22 |
|
|
| 23 |
|
|
| 24 |
|
|
| 25 |
|
|
| 26 |
|
@author |
| 27 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (13) |
Complexity: 4 |
Complexity Density: 0.5 |
|
| 28 |
|
class HierarchyBasedFocusOwnerFinder implements FocusOwnerFinderStrategy { |
| 29 |
|
|
| 30 |
|
private final ContainerFocusOwnerFinder delegate; |
| 31 |
|
private final HierarchyRootsSource rootsSource; |
| 32 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 33 |
60
|
HierarchyBasedFocusOwnerFinder() {... |
| 34 |
60
|
this(new ContainerFocusOwnerFinder(), new HierarchyRootsSource()); |
| 35 |
|
} |
| 36 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
| 37 |
63
|
HierarchyBasedFocusOwnerFinder(ContainerFocusOwnerFinder newDelegate, HierarchyRootsSource newRootsSource) {... |
| 38 |
63
|
delegate = newDelegate; |
| 39 |
63
|
rootsSource = newRootsSource; |
| 40 |
|
} |
| 41 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (7) |
Complexity: 2 |
Complexity Density: 0.4 |
|
| 42 |
5
|
@RunsInCurrentThread... |
| 43 |
|
public Component focusOwner() { |
| 44 |
5
|
for (Container c : rootsSource.existingHierarchyRoots()) { |
| 45 |
4
|
Component focus = delegate.focusOwnerOf(c); |
| 46 |
3
|
if (focus != null) return focus; |
| 47 |
|
} |
| 48 |
2
|
return null; |
| 49 |
|
} |
| 50 |
|
} |