Package VASSAL.configure
Class StringConfigurer
java.lang.Object
VASSAL.configure.Configurer
VASSAL.configure.StringConfigurer
- Direct Known Subclasses:
BeanShellExpressionConfigurer
,DoubleConfigurer
,FormattedStringConfigurer
,IntConfigurer
,LongConfigurer
,PasswordConfigurer
A Configurer for String values
-
Field Summary
Modifier and TypeFieldDescriptionprotected static int
protected int
protected JTextField
protected JPanel
Fields inherited from class VASSAL.configure.Configurer
changeSupport, frozen, hint, key, LIST_ENTRY_HIGHLIGHT_COLOR, name, NAME_PROPERTY, noUpdate, value
-
Constructor Summary
ConstructorDescriptionStringConfigurer(String val)
StringConfigurer(String key, String name)
StringConfigurer(String key, String name, int length)
StringConfigurer(String key, String name, int length, String hint, String val)
Base Constructor for StringConfigurerStringConfigurer(String key, String name, String val)
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addFocusListener(FocusListener listener)
Add a FocusListener to the Swing Components that make up this Configurer.protected JTextField
GUI interface for setting the option in an editing windowprotected String
void
removeFocusListener(FocusListener listener)
Remove a FocusListener from the Swing Components that make up this Configurer.void
Move the cursor to the first input field of this Configurervoid
setHighlighted(boolean highlighted)
Set the highlighted status of this configurer.void
setLabelVisibile(boolean visible)
Show/Hide the internal label maintained by this Configurer.void
Set the Object value from a Stringvoid
updateHint(String hint)
Methods inherited from class VASSAL.configure.Configurer
addPropertyChangeListener, fireUpdate, getHint, getKey, getName, getScreenSize, getValue, isFrozen, isHighlighted, removePropertyChangeListener, repack, repack, setFrozen, setHint, setHintKey, setName, setValue
-
Field Details
-
p
-
nameField
-
length
protected int length -
DEFAULT_LENGHTH
protected static final int DEFAULT_LENGHTH- See Also:
- Constant Field Values
-
-
Constructor Details
-
StringConfigurer
Base Constructor for StringConfigurer- Parameters:
key
- Configurer Key - Not used for new-style configsname
- Configurer Name (label)val
- Initial Configurer valuelength
- Configurer lengthhint
- Hint text
-
StringConfigurer
-
StringConfigurer
-
StringConfigurer
-
StringConfigurer
-
-
Method Details
-
getValueString
- Specified by:
getValueString
in classConfigurer
- Returns:
- a String representation of the Object value
-
setValue
Description copied from class:Configurer
Set the Object value from a String- Specified by:
setValue
in classConfigurer
-
getGrowthConstraint
-
requestFocus
public void requestFocus()Description copied from class:Configurer
Move the cursor to the first input field of this Configurer- Overrides:
requestFocus
in classConfigurer
-
getControls
Description copied from class:Configurer
GUI interface for setting the option in an editing window- Specified by:
getControls
in classConfigurer
-
buildTextField
-
updateHint
-
setLabelVisibile
public void setLabelVisibile(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:
setLabelVisibile
in classConfigurer
- Parameters:
visible
- Hide label if true
-
setHighlighted
public void setHighlighted(boolean highlighted)Description copied from class:Configurer
Set the highlighted status of this configurer. It is up to individual Configurers to over-ride this method and implement a suitable visual highlighting scheme Note: Cannot make this abstract as it will break custom code.- Overrides:
setHighlighted
in classConfigurer
- Parameters:
highlighted
- New Highlighted status
-
addFocusListener
Description copied from class:Configurer
Add a FocusListener to the Swing Components that make up this Configurer.- Overrides:
addFocusListener
in classConfigurer
- Parameters:
listener
- Focus Listener
-
removeFocusListener
Description copied from class:Configurer
Remove a FocusListener from the Swing Components that make up this Configurer.- Overrides:
removeFocusListener
in classConfigurer
- Parameters:
listener
- Focus Listener
-