Class FileConfigurer
java.lang.Object
VASSAL.configure.Configurer
VASSAL.configure.FileConfigurer
- Direct Known Subclasses:
AudioClipConfigurer
,DirectoryConfigurer
,ImageConfigurer
A Configurer for java.io.File values
-
Nested Class Summary
Nested classes/interfaces inherited from class VASSAL.configure.Configurer
Configurer.ContextLevel
-
Field Summary
Modifier and TypeFieldDescriptionprotected ArchiveWriter
protected boolean
protected FileChooser
protected JPanel
protected DirectoryConfigurer
protected JTextField
Fields inherited from class VASSAL.configure.Configurer
changeSupport, context, contextLevel, frozen, hint, key, LIST_ENTRY_HIGHLIGHT_COLOR, name, NAME_PROPERTY, noUpdate, value
-
Constructor Summary
ConstructorDescriptionFileConfigurer
(String key, String name) FileConfigurer
(String key, String name, DirectoryConfigurer startingDirectory) FileConfigurer
(String key, String name, ArchiveWriter archive) If a non-nullArchiveWriter
is used in the constructor, then invokingsetValue(java.lang.Object)
on this FileConfigurer will automatically add the file to the archive -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addToArchive
(File f) void
GUI interface for setting the option in an editing windowprotected FileChooser
boolean
static void
void
setEditable
(boolean editable) void
setLabelVisible
(boolean visible) Show/Hide the internal label maintained by this Configurer.void
Set the Object valuevoid
Set the Object value from a StringMethods inherited from class VASSAL.configure.Configurer
addFocusListener, addPropertyChangeListener, fireUpdate, getContext, getContextLevel, getHint, getKey, getName, getScreenSize, getValue, initCustomControls, isFrozen, isHighlighted, isPieceContext, removeFocusListener, removePropertyChangeListener, repack, repack, requestFocus, setContext, setContext, setContext, setContextLevel, setEnabled, setFrozen, setHighlighted, setHint, setHintKey, setLabelVisibile, setName
-
Field Details
-
archive
-
p
-
tf
-
fc
-
editable
protected boolean editable -
startingDirectory
-
-
Constructor Details
-
FileConfigurer
-
FileConfigurer
- Parameters:
key
- Configurer keyname
- Configurer labelstartingDirectory
- If non-null, points to a preferences setting that specifies the starting directory for the "Select" button
-
FileConfigurer
If a non-nullArchiveWriter
is used in the constructor, then invokingsetValue(java.lang.Object)
on this FileConfigurer will automatically add the file to the archive
-
-
Method Details
-
initFileChooser
-
getValueString
- Specified by:
getValueString
in classConfigurer
- Returns:
- a String representation of the Object value
-
setValue
Description copied from class:Configurer
Set the Object value- Overrides:
setValue
in classConfigurer
-
addToArchive
-
setValue
Description copied from class:Configurer
Set the Object value from a String- Specified by:
setValue
in classConfigurer
-
setLabelVisible
public void setLabelVisible(boolean visible) Description copied from class:Configurer
Show/Hide the internal label maintained by this Configurer. It is up to individual Configurers to track and hide the label (if they can). This method is currently only utilized by the Preference configsPrefsEditor.addOption(String, Configurer)
to extract an existing label in a configurer, display correctly aligned and suppress the original label. This keeps compatibility with custom module code setting up preferences. This method only needs to be implemented in Configurers that are added as preferences.- Overrides:
setLabelVisible
in classConfigurer
- Parameters:
visible
- Hide label if true
-
getControls
Description copied from class:Configurer
GUI interface for setting the option in an editing window- Specified by:
getControls
in classConfigurer
-
chooseNewValue
public void chooseNewValue() -
getFileValue
-
main
-
isEditable
public boolean isEditable() -
setEditable
public void setEditable(boolean editable)
-