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
FieldsModifier and TypeFieldDescriptionprotected static final intDeprecated, for removal: This API element is subject to removal in a future version.protected static final intprotected intprotected JTextFieldprotected JPanelprotected booleanFields inherited from class VASSAL.configure.Configurer
changeSupport, context, contextLevel, 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 ConfigurervoidsetEnabled(boolean enabled) Enable or Disable the action of this configurer/voidsetHighlighted(boolean highlighted) Set the highlighted status of this configurer.voidsetLabelVisible(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, 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_LENGTHinstead.- See Also:
-
-
Constructor Details
-
StringConfigurer
-
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
-
setLabelVisible
public void setLabelVisible(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:
setLabelVisiblein 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 override 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
-
setEnabled
public void setEnabled(boolean enabled) Description copied from class:ConfigurerEnable or Disable the action of this configurer/- Overrides:
setEnabledin classConfigurer- Parameters:
enabled-
-