Interface OptionModel

All Superinterfaces:
ComboBoxModel, Iterable<Option>, ListModel

public interface OptionModel extends ComboBoxModel, Iterable<Option>
Interface for a model on options.
Since:
4.0.17
  • Method Details

    • getOption

      Option getOption(String value)
      Get the option corresponding to the given value.
      Parameters:
      value - The value to look up.
      Returns:
      The matching option or null.
      Since:
      4.0.17
    • contains

      boolean contains(Option value)
      Test, if the model contains an option with the given value.
      Parameters:
      value - The value to check.
      Returns:
      true, if the model contains a matching option.
      Since:
      4.0.17
    • indexOf

      int indexOf(Option value)
      Get the index of the option matching the given value.
      Parameters:
      value - The value to find an option for.
      Returns:
      The index of the option or -1, if no such option exists.
      Since:
      4.0.17
    • getSelectedOption

      Option getSelectedOption()
      Get the selected option.
      Returns:
      The selected option (maybe null).
      Since:
      4.0.17
    • setSelectedOption

      void setSelectedOption(Option option)
      Set the selected option.
      Parameters:
      option - The option to set as selected (maybe null).
      Since:
      4.0.17
    • getChildModel

      OptionModel getChildModel(boolean strict)
      Get a child model, i.e., a reference to the option model that can store a separate option as selection.
      A child model can be said to operate strict, i.e., only values contained in the model can be set as selected. If not strict, foreign options may be set, too.
      Parameters:
      strict - If true, only defined options are allowed.
      Returns:
      The child model.
      Since:
      4.0.17