Class FileChooser

java.lang.Object
VASSAL.tools.filechooser.FileChooser

public abstract class FileChooser extends Object
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 Details

  • Constructor Details

  • Method Details

    • createFileChooser

      public static FileChooser createFileChooser(Component parent)
    • createFileChooser

      public static FileChooser createFileChooser(Component parent, DirectoryConfigurer prefs)
    • createFileChooser

      public static FileChooser createFileChooser(Component parent, DirectoryConfigurer prefs, int mode)
      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

      public abstract File getCurrentDirectory()
    • setCurrentDirectory

      public abstract void setCurrentDirectory(File dir)
    • rescanCurrentDirectory

      public abstract void rescanCurrentDirectory()
    • getSelectedFile

      public abstract File getSelectedFile()
    • setSelectedFile

      public abstract void setSelectedFile(File file)
    • getDialogTitle

      public abstract String getDialogTitle()
    • setDialogTitle

      public abstract void setDialogTitle(String title)
    • showOpenDialog

      public abstract int showOpenDialog(Component parent)
    • showSaveDialog

      public abstract int showSaveDialog(Component parent)
    • getFileFilter

      public abstract FileFilter getFileFilter()
    • setFileFilter

      public abstract void setFileFilter(FileFilter filter)
    • addChoosableFileFilter

      public abstract void addChoosableFileFilter(FileFilter filter)
    • removeChoosableFileFilter

      public abstract boolean removeChoosableFileFilter(FileFilter filter)
    • resetChoosableFileFilters

      public abstract void resetChoosableFileFilters()
    • selectDotSavFile

      public void selectDotSavFile()
      Selects filename.vsav if filename.foo is selected.
    • showOpenDialog

      public int showOpenDialog()
      Same as showOpenDialog(Component), but uses the parent set on creation of this FileDialog.
    • showSaveDialog

      public int showSaveDialog()
      Same as showSaveDialog(Component), but uses the parent set on creation of this FileDialog.
    • updateDirectoryPreference

      protected void updateDirectoryPreference()