Class StringEnumConfigurer

java.lang.Object
VASSAL.configure.Configurer
VASSAL.configure.StringEnumConfigurer
Direct Known Subclasses:
DoActionButton.LoopTypeConfig

public class StringEnumConfigurer extends Configurer
A Configurer that returns a String from among a list of possible values
  • Constructor Details

    • StringEnumConfigurer

      public StringEnumConfigurer(String key, String name, String[] validValues)
  • Method Details

    • getBox

      public JComboBox<String> getBox()
    • setBox

      public void setBox(JComboBox<String> box)
    • 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
    • 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 -
    • setEditable

      public void setEditable(boolean enabled)
    • isValidValue

      public boolean isValidValue(Object o)
    • getValidValues

      public String[] getValidValues()
    • setValidValues

      public void setValidValues(String[] s)
    • setValue

      public void setValue(Object o)
      Description copied from class: Configurer
      Set the Object value
      Overrides:
      setValue in class Configurer
    • 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
    • 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