Class StringConfigurer

java.lang.Object
VASSAL.configure.Configurer
VASSAL.configure.StringConfigurer
Direct Known Subclasses:
BeanShellExpressionConfigurer, DoubleConfigurer, FormattedStringConfigurer, IntConfigurer, LongConfigurer, PasswordConfigurer

public class StringConfigurer extends Configurer
A Configurer for String values
  • Field Details

    • p

      protected JPanel p
    • nameField

      protected JTextField nameField
    • length

      protected int length
    • DEFAULT_LENGTH

      protected static final int DEFAULT_LENGTH
      See Also:
    • updateInProgress

      protected boolean updateInProgress
    • DEFAULT_LENGHTH

      @Deprecated(since="2021-12-04", forRemoval=true) protected static final int DEFAULT_LENGHTH
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use DEFAULT_LENGTH instead.
      See Also:
  • Constructor Details

    • StringConfigurer

      public StringConfigurer(String key, String name, int length, String hint, String val)
      Base Constructor for StringConfigurer
      Parameters:
      key - Configurer Key - Not used for new-style configs
      name - Configurer Name (label)
      length - Configurer length
      hint - Hint text
      val - Initial Configurer value
    • StringConfigurer

      public StringConfigurer(String key, String name, String val)
    • StringConfigurer

      public StringConfigurer(String key, String name, int length)
    • StringConfigurer

      public StringConfigurer(String key, String name)
    • StringConfigurer

      public StringConfigurer(String val)
  • Method Details

    • getValueString

      public String getValueString()
      Specified by:
      getValueString in class Configurer
      Returns:
      a String representation of the Object value
    • setValue

      public void setValue(String s)
      Description copied from class: Configurer
      Set the Object value from a String
      Specified by:
      setValue in class Configurer
    • getGrowthConstraint

      protected String getGrowthConstraint()
    • requestFocus

      public void requestFocus()
      Description copied from class: Configurer
      Move the cursor to the first input field of this Configurer
      Overrides:
      requestFocus in class Configurer
    • getControls

      public Component getControls()
      Description copied from class: Configurer
      GUI interface for setting the option in an editing window
      Specified by:
      getControls in class Configurer
    • buildTextField

      protected JTextField buildTextField()
    • updateHint

      public void updateHint(String hint)
    • 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 configs PrefsEditor.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 class Configurer
      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 class Configurer
      Parameters:
      highlighted - New Highlighted status
    • addFocusListener

      public void addFocusListener(FocusListener listener)
      Description copied from class: Configurer
      Add a FocusListener to the Swing Components that make up this Configurer.
      Overrides:
      addFocusListener in class Configurer
      Parameters:
      listener - Focus Listener
    • removeFocusListener

      public void removeFocusListener(FocusListener listener)
      Description copied from class: Configurer
      Remove a FocusListener from the Swing Components that make up this Configurer.
      Overrides:
      removeFocusListener in class Configurer
      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 class Configurer
      Parameters:
      enabled -