Package VASSAL.tools.filechooser
Class FileChooser
java.lang.Object
VASSAL.tools.filechooser.FileChooser
FileChooser provides a wrapper for
JFileChooser and
FileDialog, selecting whichever is preferred on the
user's OS. FileChooser's methods mirror those of
JFileChooser.- Author:
- Joel Uckelman
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final intstatic final intprotected Componentprotected DirectoryConfigurer -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract voidaddChoosableFileFilter(FileFilter filter) static FileChoosercreateFileChooser(Component parent) static FileChoosercreateFileChooser(Component parent, DirectoryConfigurer prefs) static FileChoosercreateFileChooser(Component parent, DirectoryConfigurer prefs, int mode) Creates a FileChooser appropriate for the user's OS.abstract Fileabstract Stringabstract FileFilterabstract Fileabstract booleanremoveChoosableFileFilter(FileFilter filter) abstract voidabstract voidvoidSelects filename.vsav if filename.foo is selected.abstract voidsetCurrentDirectory(File dir) abstract voidsetDialogTitle(String title) abstract voidsetFileFilter(FileFilter filter) abstract voidsetSelectedFile(File file) intSame asshowOpenDialog(Component), but uses the parent set on creation of this FileDialog.abstract intshowOpenDialog(Component parent) intSame asshowSaveDialog(Component), but uses the parent set on creation of this FileDialog.abstract intshowSaveDialog(Component parent) protected void
-
Field Details
-
parent
-
prefs
-
APPROVE_OPTION
public static final int APPROVE_OPTION- See Also:
-
CANCEL_OPTION
public static final int CANCEL_OPTION- See Also:
-
ERROR_OPTION
public static final int ERROR_OPTION- See Also:
-
FILES_ONLY
public static final int FILES_ONLY- See Also:
-
DIRECTORIES_ONLY
public static final int DIRECTORIES_ONLY- See Also:
-
-
Constructor Details
-
FileChooser
-
-
Method Details
-
createFileChooser
-
createFileChooser
-
createFileChooser
Creates a FileChooser appropriate for the user's OS.- Parameters:
parent- The Component over which the FileChooser should appear.prefs- A FileConfigure that stores the preferred starting directory of the FileChooser in preferences
-
getCurrentDirectory
-
setCurrentDirectory
-
rescanCurrentDirectory
public abstract void rescanCurrentDirectory() -
getSelectedFile
-
setSelectedFile
-
getDialogTitle
-
setDialogTitle
-
showOpenDialog
-
showSaveDialog
-
getFileFilter
-
setFileFilter
-
addChoosableFileFilter
-
removeChoosableFileFilter
-
resetChoosableFileFilters
public abstract void resetChoosableFileFilters() -
selectDotSavFile
public void selectDotSavFile()Selects filename.vsav if filename.foo is selected. -
showOpenDialog
public int showOpenDialog()Same asshowOpenDialog(Component), but uses the parent set on creation of this FileDialog. -
showSaveDialog
public int showSaveDialog()Same asshowSaveDialog(Component), but uses the parent set on creation of this FileDialog. -
updateDirectoryPreference
protected void updateDirectoryPreference()
-