| 1 |
|
|
| 2 |
|
|
| 3 |
|
|
| 4 |
|
|
| 5 |
|
|
| 6 |
|
|
| 7 |
|
|
| 8 |
|
|
| 9 |
|
|
| 10 |
|
|
| 11 |
|
|
| 12 |
|
|
| 13 |
|
|
| 14 |
|
|
| 15 |
|
|
| 16 |
|
package org.fest.swing.format; |
| 17 |
|
|
| 18 |
|
import static java.lang.String.valueOf; |
| 19 |
|
import static javax.swing.JFileChooser.*; |
| 20 |
|
import static org.fest.util.Strings.concat; |
| 21 |
|
import static org.fest.util.Strings.quote; |
| 22 |
|
|
| 23 |
|
import java.awt.Component; |
| 24 |
|
|
| 25 |
|
import javax.swing.JFileChooser; |
| 26 |
|
|
| 27 |
|
|
| 28 |
|
@link |
| 29 |
|
|
| 30 |
|
@author |
| 31 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (7) |
Complexity: 3 |
Complexity Density: 0.75 |
|
| 32 |
|
public class JFileChooserFormatter extends ComponentFormatterTemplate { |
| 33 |
|
|
| 34 |
|
private static final IntEnum DIALOG_TYPES = new IntEnum(); |
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 35 |
324
|
static {... |
| 36 |
324
|
DIALOG_TYPES.put(OPEN_DIALOG, "OPEN_DIALOG") |
| 37 |
|
.put(SAVE_DIALOG, "SAVE_DIALOG") |
| 38 |
|
.put(CUSTOM_DIALOG, "CUSTOM_DIALOG"); |
| 39 |
|
} |
| 40 |
|
|
| 41 |
|
|
| 42 |
|
@link |
| 43 |
|
@link |
| 44 |
|
@param |
| 45 |
|
@return |
| 46 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
| 47 |
11
|
protected String doFormat(Component c) {... |
| 48 |
11
|
JFileChooser fileChooser = (JFileChooser)c; |
| 49 |
11
|
return concat( |
| 50 |
|
fileChooser.getClass().getName(), "[", |
| 51 |
|
"name=", quote(fileChooser.getName()), ", ", |
| 52 |
|
"dialogTitle=", quote(fileChooser.getDialogTitle()), ", ", |
| 53 |
|
"dialogType=", DIALOG_TYPES.get(fileChooser.getDialogType()), ", ", |
| 54 |
|
"currentDirectory=", fileChooser.getCurrentDirectory(), ", ", |
| 55 |
|
"enabled=", valueOf(fileChooser.isEnabled()), ", ", |
| 56 |
|
"visible=", valueOf(fileChooser.isVisible()), ", ", |
| 57 |
|
"showing=", valueOf(fileChooser.isShowing()), |
| 58 |
|
"]" |
| 59 |
|
); |
| 60 |
|
} |
| 61 |
|
|
| 62 |
|
|
| 63 |
|
@link |
| 64 |
|
@return |
| 65 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 66 |
335
|
public Class<? extends Component> targetType() {... |
| 67 |
335
|
return JFileChooser.class; |
| 68 |
|
} |
| 69 |
|
} |