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
fc
Fields inherited from class VASSAL.launch.GameModuleAction
actionCancelled, actions, comp
Fields inherited from class javax.swing.AbstractAction
changeSupport, enabled
Fields 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
-
Method Summary
Modifier and TypeMethodDescriptionstatic AbstractMetaData
buildMetaData
(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 FileChooser
static Class
<?> void
loadModule
(File f) void
Methods inherited from class VASSAL.launch.GameModuleAction
actionPerformed, addAction, getMessage, reportError, runActions
Methods 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:
performAction
in classLoadModuleAction
- Throws:
IOException
-
loadModule
- Overrides:
loadModule
in 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 ofbase
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. Ifbase
isnull
, this will be skipped.queryIfNotFound
- If the file still cannot be found, after searchingf
andbase
, should we ask the user to find it for us.filter
- TheFileFilter
that 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
-