Interface ListSelectModel<V>

    • Method Detail

      • getSelectionPolicy

        ListSelectionPolicy<V> getSelectionPolicy()
        Returns:
        The selection policy for this model.
      • getSelectedIndex

        int getSelectedIndex()
        Determines the selected index. If more than one index is selected, the lead selected index will be returned.
        Returns:
        The index currently selected, or -1 if no index is selected.
        See Also:
        SelectModel.getSelectedValue()
      • getSelectedIndexes

        int[] getSelectedIndexes()
        Determines the selected indices.
        Returns:
        The indices currently selected.
        See Also:
        SelectModel.getSelectedValues()
      • addSelectedIndexes

        void addSelectedIndexes​(int... indexes)
                         throws java.beans.PropertyVetoException
        Adds a selection at the given indices. Any invalid indices will be ignored. If the value change is vetoed by the installed validator, the validation exception will be accessible via Throwable.getCause().
        Parameters:
        indexes - The indices to add to the selection.
        Throws:
        java.beans.PropertyVetoException - if the provided value is not valid or the change has otherwise been vetoed.
        See Also:
        ListSelectionPolicy.getAddSelectedIndices(ListSelectModel, int[]), setSelectedIndexes(int...)
      • removeSelectedIndexes

        void removeSelectedIndexes​(int... indexes)
                            throws java.beans.PropertyVetoException
        Removes a selection at the given indices. Any invalid indices will be ignored. If the value change is vetoed by the installed validator, the validation exception will be accessible via Throwable.getCause().
        Parameters:
        indexes - The indices to remove from the selection.
        Throws:
        java.beans.PropertyVetoException - if the provided value is not valid or the change has otherwise been vetoed.
        See Also:
        ListSelectionPolicy.getRemoveSelectedIndices(ListSelectModel, int[]), setSelectedIndexes(int[])
      • isValueDisplayed

        boolean isValueDisplayed​(V value)
        Determines the displayed status of the first occurrence of a given value.
        Parameters:
        value - The value for which the displayed status is to be determined.
        Returns:
        true if the value is displayed, else false.
        Throws:
        java.lang.IndexOutOfBoundsException - if the given value does not occur in the model.
      • setValueDisplayed

        void setValueDisplayed​(V value,
                               boolean newDisplayed)
        Sets the displayed status of the first occurrence of a given value. This is a bound value state property.
        Parameters:
        value - The value to display.
        newDisplayed - Whether the value should be displayed.
        See Also:
        Displayable.DISPLAYED_PROPERTY
      • isIndexDisplayed

        boolean isIndexDisplayed​(int index)
        Determines the displayed status of a given index.
        Parameters:
        index - The index of the value for which the displayed status is to be determined.
        Returns:
        true if the value at the given index is displayed, else false.
      • setIndexDisplayed

        void setIndexDisplayed​(int index,
                               boolean newDisplayed)
        Sets the displayed status of a given index. This is a bound value state property.
        Parameters:
        index - The index of the value to display.
        newDisplayed - Whether the value at the given index should be displayed.
        Throws:
        java.lang.IndexOutOfBoundsException - if the given index is not within the range of the list.
        See Also:
        Displayable.DISPLAYED_PROPERTY
      • isValueEnabled

        boolean isValueEnabled​(V value)
        Determines the enabled status of the first occurrence of a given value.
        Parameters:
        value - The value for which the enabled status is to be determined.
        Returns:
        true if the value is enabled, else false.
        Throws:
        java.lang.IndexOutOfBoundsException - if the given value does not occur in the model.
      • setValueEnabled

        void setValueEnabled​(V value,
                             boolean newEnabled)
        Sets the enabled status of the first occurrence of a given value. This is a bound value state property.
        Parameters:
        value - The value to enable or disable.
        newEnabled - Whether the value should be enabled.
        See Also:
        Enableable.ENABLED_PROPERTY
      • isIndexEnabled

        boolean isIndexEnabled​(int index)
        Determines the enabled status of a given index.
        Parameters:
        index - The index of the value for which the enabled status is to be determined.
        Returns:
        true if the value at the given index is enabled, else false.
      • setIndexEnabled

        void setIndexEnabled​(int index,
                             boolean newEnabled)
        Sets the enabled status of a given index. This is a bound value state property.
        Parameters:
        index - The index of the value to enable or disable.
        newEnabled - Whether the value at the given index should be enabled.
        Throws:
        java.lang.IndexOutOfBoundsException - if the given index is not within the range of the list.
        See Also:
        Enableable.ENABLED_PROPERTY
      • addListSelectionListener

        void addListSelectionListener​(ListSelectionListener<V> selectionListener)
        Adds a list selection listener.
        Parameters:
        selectionListener - The selection listener to add.
      • removeListSelectionListener

        void removeListSelectionListener​(ListSelectionListener<V> selectionListener)
        Removes a list selection listener.
        Parameters:
        selectionListener - The selection listener to remove.