Package adams.gui.chooser
Class DirectoryChooserFactory
- java.lang.Object
-
- adams.gui.chooser.DirectoryChooserFactory
-
public class DirectoryChooserFactory extends Object
Factor for instantiating directory choosers.- Author:
- fracpete (fracpete at waikato dot ac dot nz)
-
-
Field Summary
Fields Modifier and Type Field Description static int
APPROVE_OPTION
Return value if approve (yes, ok) is chosen.static String
APPROVE_SELECTION
Instruction to approve the current selection (same as pressing yes or ok).static int
CANCEL_OPTION
Return value if cancel is chosen.static String
CANCEL_SELECTION
Instruction to cancel the current selection.static int
DIRECTORIES_ONLY
Instruction to display only directories.static int
ERROR_OPTION
Return value if an error occurred.static int
FILES_AND_DIRECTORIES
Instruction to display both files and directories.static int
FILES_ONLY
Instruction to display only files.static String
TYPE_JFILECHOOSER
static String
TYPE_SIMPLE
-
Constructor Summary
Constructors Constructor Description DirectoryChooserFactory()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static FileChooser
createChooser()
Returns a directory chooser instance with the user's default directory as initial directory.static FileChooser
createChooser(File initialDir)
Returns a directory chooser instance with the specified initial directory.static FileChooser
createChooser(String initialDir)
Returns a directory chooser instance with the specified initial directory.static PlaceholderDirectory
getSelectedDirectory(FileChooser chooser)
Retrieves the current directory as PlaceholderDirectory from the chooser.
-
-
-
Field Detail
-
CANCEL_OPTION
public static final int CANCEL_OPTION
Return value if cancel is chosen.- See Also:
- Constant Field Values
-
APPROVE_OPTION
public static final int APPROVE_OPTION
Return value if approve (yes, ok) is chosen.- See Also:
- Constant Field Values
-
ERROR_OPTION
public static final int ERROR_OPTION
Return value if an error occurred.- See Also:
- Constant Field Values
-
FILES_ONLY
public static final int FILES_ONLY
Instruction to display only files.- See Also:
- Constant Field Values
-
DIRECTORIES_ONLY
public static final int DIRECTORIES_ONLY
Instruction to display only directories.- See Also:
- Constant Field Values
-
FILES_AND_DIRECTORIES
public static final int FILES_AND_DIRECTORIES
Instruction to display both files and directories.- See Also:
- Constant Field Values
-
CANCEL_SELECTION
public static final String CANCEL_SELECTION
Instruction to cancel the current selection.- See Also:
- Constant Field Values
-
APPROVE_SELECTION
public static final String APPROVE_SELECTION
Instruction to approve the current selection (same as pressing yes or ok).- See Also:
- Constant Field Values
-
TYPE_JFILECHOOSER
public static final String TYPE_JFILECHOOSER
- See Also:
- Constant Field Values
-
TYPE_SIMPLE
public static final String TYPE_SIMPLE
- See Also:
- Constant Field Values
-
-
Method Detail
-
createChooser
public static FileChooser createChooser()
Returns a directory chooser instance with the user's default directory as initial directory.- Returns:
- the chooser
-
createChooser
public static FileChooser createChooser(String initialDir)
Returns a directory chooser instance with the specified initial directory.- Parameters:
initialDir
- the initial directory to use- Returns:
- the chooser
-
createChooser
public static FileChooser createChooser(File initialDir)
Returns a directory chooser instance with the specified initial directory.- Parameters:
initialDir
- the initial directory to use- Returns:
- the chooser
-
getSelectedDirectory
public static PlaceholderDirectory getSelectedDirectory(FileChooser chooser)
Retrieves the current directory as PlaceholderDirectory from the chooser.- Parameters:
chooser
- the chooser to obtain the current dir from- Returns:
- the dir, null if not available
-
-