Class PDefaultChoiceStringEnum

All Implemented Interfaces:
PAppComponent, PAppFieldComponent, PClientComponent, PCollectDataListener, PComponent, PComponentAttribute, PFieldBean, PLightComponent, PViewDataChangeListener, ActionListener, ImageObserver, ItemSelectable, MenuContainer, Serializable, Remote, EventListener, Accessible, ListDataListener

public class PDefaultChoiceStringEnum extends PIAStringEnum
In addition to what PIAStringEnum can do, this component display a default selection to indicate that it will not collect data if the default is selected. Each element can have a value and display value. Display value will be shown to the user while value will be passed during data collection.

If the default string is not specified, this component behaves like a regular PIAStringEnum.

See Also:
  • Constructor Details

    • PDefaultChoiceStringEnum

      public PDefaultChoiceStringEnum()
      Creates a default choice combo box.
    • PDefaultChoiceStringEnum

      public PDefaultChoiceStringEnum(String defaultString)
      Creates a string enum field that supports a default selection. When the default string is selected, this component will not collect data.
      Parameters:
      defaultString - the default selection string.
  • Method Details

    • addItem

      public void addItem(String displayValue, String value)
      Adds a new element to the combobox.
      Parameters:
      displayValue - the string to be shown.
      value - the value to be collected.
    • setDefaultString

      public void setDefaultString(String defaultString)
      Sets the default selection string.
      Parameters:
      defaultString - the default selection string.
    • getDefaultString

      public String getDefaultString()
      Gets the default selection string.
      Returns:
      the default selection string.
    • setChoices

      public void setChoices(String[] choices)
      Description copied from class: PIAStringEnum
      Establishes the data to display in this component
      Overrides:
      setChoices in class PIAStringEnum
      Parameters:
      choices - The array of String objects to display in the component
    • setChoices

      public void setChoices(Vector choices)
      Description copied from class: PIAStringEnum
      Establishes the data to display in this component
      Overrides:
      setChoices in class PIAStringEnum
      Parameters:
      choices - The Vector of String objects to display in the component
    • collectData

      public void collectData(PCollectDataEvent event)
      Overriden to interpret default option.

      If the default is specified and selected, this field will not collect data.

      Specified by:
      collectData in interface PCollectDataListener
      Overrides:
      collectData in class PIAStringEnum
      Parameters:
      event - the data collection event.