| 1 |
|
|
| 2 |
|
|
| 3 |
|
|
| 4 |
|
|
| 5 |
|
|
| 6 |
|
|
| 7 |
|
|
| 8 |
|
|
| 9 |
|
|
| 10 |
|
|
| 11 |
|
|
| 12 |
|
|
| 13 |
|
|
| 14 |
|
|
| 15 |
|
|
| 16 |
|
package org.fest.swing.keystroke; |
| 17 |
|
|
| 18 |
|
import static org.fest.swing.keystroke.KeyStrokeMappingProviderNames.generateNamesFrom; |
| 19 |
|
|
| 20 |
|
import java.util.Locale; |
| 21 |
|
|
| 22 |
|
import org.fest.swing.util.OSFamily; |
| 23 |
|
import org.fest.util.VisibleForTesting; |
| 24 |
|
|
| 25 |
|
|
| 26 |
|
@link |
| 27 |
|
|
| 28 |
|
@author |
| 29 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (12) |
Complexity: 4 |
Complexity Density: 0.57 |
|
| 30 |
|
class KeyStrokeMappingProviderPicker { |
| 31 |
|
|
| 32 |
|
private final KeyStrokeMappingProviderFactory factory; |
| 33 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 34 |
25
|
KeyStrokeMappingProviderPicker() {... |
| 35 |
25
|
this(new KeyStrokeMappingProviderFactory()); |
| 36 |
|
} |
| 37 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 38 |
27
|
@VisibleForTesting... |
| 39 |
|
KeyStrokeMappingProviderPicker(KeyStrokeMappingProviderFactory factory) { |
| 40 |
27
|
this.factory = factory; |
| 41 |
|
} |
| 42 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (7) |
Complexity: 2 |
Complexity Density: 0.4 |
|
| 43 |
27
|
KeyStrokeMappingProvider providerFor(OSFamily osFamily, Locale locale) {... |
| 44 |
27
|
for (String name : generateNamesFrom(osFamily, locale)) { |
| 45 |
79
|
KeyStrokeMappingProvider provider = factory.createProvider(name); |
| 46 |
26
|
if (provider != null) return provider; |
| 47 |
|
} |
| 48 |
1
|
return new KeyStrokeMappingProvider_en(); |
| 49 |
|
} |
| 50 |
|
} |