| 1 |
|
|
| 2 |
|
|
| 3 |
|
|
| 4 |
|
|
| 5 |
|
|
| 6 |
|
|
| 7 |
|
|
| 8 |
|
|
| 9 |
|
|
| 10 |
|
|
| 11 |
|
|
| 12 |
|
|
| 13 |
|
|
| 14 |
|
|
| 15 |
|
|
| 16 |
|
package org.fest.swing.driver; |
| 17 |
|
|
| 18 |
|
import static org.fest.swing.edt.GuiActionRunner.execute; |
| 19 |
|
|
| 20 |
|
import javax.swing.JComboBox; |
| 21 |
|
|
| 22 |
|
import org.fest.swing.annotation.RunsInEDT; |
| 23 |
|
import org.fest.swing.cell.JComboBoxCellReader; |
| 24 |
|
import org.fest.swing.edt.GuiQuery; |
| 25 |
|
import org.fest.swing.util.TextMatcher; |
| 26 |
|
|
| 27 |
|
|
| 28 |
|
@link |
| 29 |
|
|
| 30 |
|
@author |
| 31 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (12) |
Complexity: 4 |
Complexity Density: 0.67 |
|
| 32 |
|
final class JComboBoxMatchingItemQuery { |
| 33 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 34 |
16
|
@RunsInEDT... |
| 35 |
|
static int matchingItemIndex(final JComboBox comboBox, final TextMatcher matcher, final JComboBoxCellReader cellReader) { |
| 36 |
16
|
return execute(new GuiQuery<Integer>() { |
|
|
|
| 100% |
Uncovered Elements: 0 (9) |
Complexity: 3 |
Complexity Density: 0.6 |
|
| 37 |
16
|
protected Integer executeInEDT() {... |
| 38 |
16
|
int itemCount = comboBox.getItemCount(); |
| 39 |
44
|
for (int i = 0; i < itemCount; i++) |
| 40 |
13
|
if (matcher.isMatching(cellReader.valueAt(comboBox, i))) return i; |
| 41 |
3
|
return -1; |
| 42 |
|
} |
| 43 |
|
}); |
| 44 |
|
} |
| 45 |
|
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
| 46 |
|
private JComboBoxMatchingItemQuery() {}... |
| 47 |
|
} |