Class AbstractChoiceOption

  • Direct Known Subclasses:
    ComboChoiceOption, RadioChoiceOption

    public abstract class AbstractChoiceOption
    extends TemplateOption
    Abstract implementation of the TemplateOption that allows users to choose a value from the fixed set of options.
    • Field Detail

      • fChoices

        protected String[][] fChoices
    • Constructor Detail

      • AbstractChoiceOption

        public AbstractChoiceOption​(BaseOptionTemplateSection section,
                                    String name,
                                    String label,
                                    String[][] choices)
        Constructor for AbstractChoiceOption.
        section - the parent section.
        name - the unique name
        label - the presentable label
        choices - the list of choices from which the value can be chosen. Each array entry should be an array of size 2, where position 0 will be interpeted as the choice unique name, and position 1 as the choice presentable label.
    • Method Detail

      • getChoice

        public String getChoice()
        Returns the string value of the current choice.
        the current choice or null if not initialized.
      • setValue

        public void setValue​(Object value)
        Implements the superclass method by passing the new value to the option's widget.
        setValue in class TemplateOption
        value - the new value.
      • setValue

        protected void setValue​(Object value,
                                boolean updateControl)
        Implements the superclass method by passing the new value to the option's widget; updates to the combo can be supressed.
        value - the new value.
        updateControl - true to have the Combo's displayed value updated too, false to indicate that this isn't necessary.
      • setOptionValue

        protected abstract void setOptionValue​(Object value)
      • setEnabled

        public void setEnabled​(boolean enabled)
        Description copied from class: TemplateOption
        Sets the enabled state of this option. The action presentation of the enabled state depends on the implementing option.
        setEnabled in class TemplateOption
        enabled - the new enabled state
      • setOptionEnabled

        protected abstract void setOptionEnabled​(boolean enabled)
      • selectChoice

        protected void selectChoice​(String choice)
      • selectOptionChoice

        protected abstract void selectOptionChoice​(String choice)
      • isBlocked

        protected boolean isBlocked()