Class ComboChoiceOption

  • public class ComboChoiceOption
    extends AbstractChoiceOption
    Implementation of the AbstractTemplateOption that allows users to choose a value from the fixed set of options using a combo box.
    • Constructor Detail

      • ComboChoiceOption

        public ComboChoiceOption​(BaseOptionTemplateSection section,
                                 String name,
                                 String label,
                                 String[][] choices)
        Constructor for ComboChoiceOption.
        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

      • createControl

        public void createControl​(Composite parent,
                                  int span)
        Description copied from class: TemplateField
        Subclasses must implement this method to create the control of the template field.
        Specified by:
        createControl in class TemplateField
        parent - the parent composite the control should be created in
        span - number of columns that the control should span
      • getIndexOfChoice

        protected int getIndexOfChoice​(String choice)
        Get the index (in the collection) of the choice
        choice - The key of the item
        The position in the list, or -1 if not found