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
FieldsModifier and TypeFieldDescriptionprotected static intprotected intprotected JTextFieldprotected JPanelFields inherited from class VASSAL.configure.Configurer
changeSupport, frozen, hint, key, LIST_ENTRY_HIGHLIGHT_COLOR, name, NAME_PROPERTY, noUpdate, value -
Constructor Summary
ConstructorsConstructorDescriptionStringConfigurer(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 TypeMethodDescriptionvoidaddFocusListener(FocusListener listener)Add a FocusListener to the Swing Components that make up this Configurer.protected JTextFieldGUI interface for setting the option in an editing windowprotected StringvoidremoveFocusListener(FocusListener listener)Remove a FocusListener from the Swing Components that make up this Configurer.voidMove the cursor to the first input field of this ConfigurervoidsetHighlighted(boolean highlighted)Set the highlighted status of this configurer.voidsetLabelVisibile(boolean visible)Show/Hide the internal label maintained by this Configurer.voidSet the Object value from a StringvoidupdateHint(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:
getValueStringin classConfigurer- Returns:
- a String representation of the Object value
-
setValue
Description copied from class:ConfigurerSet the Object value from a String- Specified by:
setValuein classConfigurer
-
getGrowthConstraint
-
requestFocus
public void requestFocus()Description copied from class:ConfigurerMove the cursor to the first input field of this Configurer- Overrides:
requestFocusin classConfigurer
-
getControls
Description copied from class:ConfigurerGUI interface for setting the option in an editing window- Specified by:
getControlsin classConfigurer
-
buildTextField
-
updateHint
-
setLabelVisibile
public void setLabelVisibile(boolean visible)Description copied from class:ConfigurerShow/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:
setLabelVisibilein classConfigurer- Parameters:
visible- Hide label if true
-
setHighlighted
public void setHighlighted(boolean highlighted)Description copied from class:ConfigurerSet 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:
setHighlightedin classConfigurer- Parameters:
highlighted- New Highlighted status
-
addFocusListener
Description copied from class:ConfigurerAdd a FocusListener to the Swing Components that make up this Configurer.- Overrides:
addFocusListenerin classConfigurer- Parameters:
listener- Focus Listener
-
removeFocusListener
Description copied from class:ConfigurerRemove a FocusListener from the Swing Components that make up this Configurer.- Overrides:
removeFocusListenerin classConfigurer- Parameters:
listener- Focus Listener
-