Package VASSAL.tools.imports
Class ImportAction
java.lang.Object
javax.swing.AbstractAction
VASSAL.launch.GameModuleAction
VASSAL.launch.LoadModuleAction
VASSAL.launch.EditModuleAction
VASSAL.tools.imports.ImportAction
- All Implemented Interfaces:
ActionListener,Serializable,Cloneable,EventListener,Action
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:
-
Field Summary
Fields inherited from class VASSAL.launch.LoadModuleAction
fcFields inherited from class VASSAL.launch.GameModuleAction
actionCancelled, actions, compFields inherited from class javax.swing.AbstractAction
changeSupport, enabledFields inherited from interface javax.swing.Action
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, DISPLAYED_MNEMONIC_INDEX_KEY, LARGE_ICON_KEY, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SELECTED_KEY, SHORT_DESCRIPTION, SMALL_ICON -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic AbstractMetaDatabuildMetaData(File module) 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.static FileChooserstatic Class<?> voidloadModule(File f) voidMethods inherited from class VASSAL.launch.GameModuleAction
actionPerformed, addAction, getMessage, reportError, runActionsMethods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
-
Constructor Details
-
ImportAction
-
-
Method Details
-
getFileChooser
-
getImporterClass
- Throws:
IOException
-
performAction
- Overrides:
performActionin classLoadModuleAction- Throws:
IOException
-
loadModule
- Overrides:
loadModulein classEditModuleAction- Throws:
IOException
-
getCaseInsensitiveFile
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 ofbasewhich 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,baseis typically the base file under the assumption that the files on which it depends are found in the same directory. Ifbaseisnull, this will be skipped.queryIfNotFound- If the file still cannot be found, after searchingfandbase, should we ask the user to find it for us.filter- TheFileFilterthat the file dialog can use to locate the file. If this isnull, then no filter is used.- Returns:
- If it exists, the file itself, otherwise null.
-
buildMetaData
-