Class SelectOptionPanel

    • Field Detail

      • m_DialogTitle

        protected String m_DialogTitle
        the title for the dialog.
      • m_MultiSelect

        protected boolean m_MultiSelect
        whether to use multi-select.
      • m_Options

        protected String[] m_Options
        the available options.
      • m_Lenient

        protected boolean m_Lenient
        whether to use lenient mode.
    • Constructor Detail

      • SelectOptionPanel

        public SelectOptionPanel()
    • Method Detail

      • indexOf

        protected int indexOf​(String[] options,
                              String option)
        Returns the index of the option in the provided array.
        Parameters:
        options - the options to locate the search string
        option - the option to search for
        Returns:
        the index, -1 if not found in options
      • setOptions

        public void setOptions​(String[] value)
        Sets the options to choose from.
        Parameters:
        value - the options
      • getOptions

        public String[] getOptions()
        Returns the options to choose from.
        Returns:
        the options
      • setCurrentIndex

        public void setCurrentIndex​(int value)
        Selects the option specified by the index.
        Parameters:
        value - the index to select
      • getCurrentIndex

        public int getCurrentIndex()
        Returns the index of the currently selected option.
        Returns:
        the index, -1 if none selected
      • setCurrentIndices

        public void setCurrentIndices​(int[] value)
        Selects the options specified by the indices.
        Parameters:
        value - the indices to select
      • getCurrentIndices

        public int[] getCurrentIndices()
        Returns the indices of the currently selected options.
        Returns:
        the indices
      • setDialogTitle

        public void setDialogTitle​(String value)
        Sets the title for the dialog.
        Parameters:
        value - the title
      • getDialogTitle

        public String getDialogTitle()
        Returns the title to use for the dialog.
        Returns:
        the title
      • setMultiSelect

        public void setMultiSelect​(boolean value)
        Sets whether to allow selection of multiple options.
        Parameters:
        value - true if multi-select enabled
      • isMultiSelect

        public boolean isMultiSelect()
        Returns whether multiple options can be selected.
        Returns:
        true if multi-select enabled
      • setLenient

        public void setLenient​(boolean value)
        Sets whether to make setting of options lenient. If set, doesn't remove current ones if not present in available options.
        Parameters:
        value - true if lenient
      • isLenient

        public boolean isLenient()
        Returns whether multiple options can be selected. If set, doesn't remove current ones if not present in available options.
        Returns:
        true if lenient
      • toString

        protected String toString​(String[] value)
        Converts the value into its string representation.
        Specified by:
        toString in class AbstractChooserPanel<String[]>
        Parameters:
        value - the value to convert
        Returns:
        the generated string
      • fromString

        protected String[] fromString​(String value)
        Converts the string representation into its object representation.
        Specified by:
        fromString in class AbstractChooserPanel<String[]>
        Parameters:
        value - the string value to convert
        Returns:
        the generated object
      • doChoose

        protected String[] doChoose()
        Performs the actual choosing of an object.
        Specified by:
        doChoose in class AbstractChooserPanel<String[]>
        Returns:
        the chosen object or null if none chosen