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
-
Nested Class Summary
Nested classes/interfaces inherited from class VASSAL.configure.Configurer
Configurer.ContextLevel
-
Field Summary
Modifier and TypeFieldDescriptionprotected static final int
Deprecated, for removal: This API element is subject to removal in a future version.protected static final int
protected int
protected JTextField
protected JPanel
protected boolean
Fields inherited from class VASSAL.configure.Configurer
changeSupport, context, contextLevel, 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
setEnabled
(boolean enabled) Enable or Disable the action of this configurer/void
setHighlighted
(boolean highlighted) Set the highlighted status of this configurer.void
setLabelVisible
(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, getContext, getContextLevel, getHint, getKey, getName, getScreenSize, getValue, initCustomControls, isFrozen, isHighlighted, isPieceContext, removePropertyChangeListener, repack, repack, setContext, setContext, setContext, setContextLevel, setFrozen, setHint, setHintKey, setLabelVisibile, setName, setValue
-
Field Details
-
p
-
nameField
-
length
protected int length -
DEFAULT_LENGTH
protected static final int DEFAULT_LENGTH- See Also:
-
updateInProgress
protected boolean updateInProgress -
DEFAULT_LENGHTH
Deprecated, for removal: This API element is subject to removal in a future version.UseDEFAULT_LENGTH
instead.- See Also:
-
-
Constructor Details
-
StringConfigurer
-
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
-
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
-
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 override 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
-
setEnabled
public void setEnabled(boolean enabled) Description copied from class:Configurer
Enable or Disable the action of this configurer/- Overrides:
setEnabled
in classConfigurer
- Parameters:
enabled
-
-