Class ImportAction

All Implemented Interfaces:
ActionListener, Serializable, Cloneable, EventListener, Action

public final class ImportAction extends EditModuleAction
Action for importing foreign modules into VASSAL. To add more capabilities, see the static fields DESCRIPTIONS, EXTENSIONS, and IMPORTERS.
Since:
3.1.0
Author:
Michael Kiefte
See Also:
Serialized Form
  • Constructor Details

    • ImportAction

      public ImportAction(Component comp)
  • Method Details

    • getFileChooser

      public static FileChooser getFileChooser(Component c)
    • getImporterClass

      public static Class<?> getImporterClass(File f) throws IOException
      Throws:
      IOException
    • performAction

      public void performAction(ActionEvent e) throws IOException
      Overrides:
      performAction in class LoadModuleAction
      Throws:
      IOException
    • loadModule

      public void loadModule(File f) throws IOException
      Overrides:
      loadModule in class EditModuleAction
      Throws:
      IOException
    • getCaseInsensitiveFile

      public File getCaseInsensitiveFile(File f, File base, boolean queryIfNotFound, FileFilter filter)
      Find case-insensitive, cross-platform match for a given file specified for a Windows directory structure.
      Parameters:
      f - File to search for formatted for Windows. E.g., "C:Dir\File.txt". The method will first check to see if the file exists as formatted. It will then search the path that this file is in if that exists.
      base - If unable to find the file, will look in the directory of base which be localised to the current OS. Typically this is some default directory to look for files. This must be a full file name -- not just the path. The file name itself doesn't matter. In the case of importing files, if a base file requires another file, base is typically the base file under the assumption that the files on which it depends are found in the same directory. If base is null, this will be skipped.
      queryIfNotFound - If the file still cannot be found, after searching f and base, should we ask the user to find it for us.
      filter - The FileFilter that the file dialog can use to locate the file. If this is null, then no filter is used.
      Returns:
      If it exists, the file itself, otherwise null.
    • buildMetaData

      public static AbstractMetaData buildMetaData(File module)