Class GroupsListModel<D,​G,​F>

    • Constructor Detail

      • GroupsListModel

        protected GroupsListModel​(GroupsModel<D,​G,​F> model)
    • Method Detail

      • toListModel

        public static <D,​G,​F> GroupsListModel<D,​G,​F> toListModel​(GroupsModel<D,​G,​F> model)
        Returns the list model (ListModel) representing the given groups model.
        Since:
        6.0.0
      • cleanInternalListener

        public void cleanInternalListener()
        Clean up internal listener, it will be called when components changing model.
        Since:
        8.6.0
      • getGroupsInfos

        public java.util.List<int[]> getGroupsInfos()
      • getGroupOffset

        public int getGroupOffset​(int groupIndex)
        Returns the offset from 0 that a group in this ListModel.

        For example, _gpofs[2] is the offset of group 2 (the third group) in this ListModel.

        Parameters:
        groupIndex - the group index
        Returns:
        the offset from 0 that a group in this ListModel.
      • getDataInfo

        public GroupingInfo getDataInfo​(int index)
        Returns the group info of given index
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • getElementAt

        public java.lang.Object getElementAt​(int index)
        Description copied from interface: ListModel
        Returns the value at the specified index.
        Specified by:
        getElementAt in interface ListModel<D>
      • getSize

        public int getSize()
        Description copied from interface: ListModel
        Returns the length of the list.
        Specified by:
        getSize in interface ListModel<D>
      • getSelection

        public java.util.Set<java.lang.Object> getSelection()
        Description copied from class: AbstractListModel
        Returns the current selection. It is readonly. Don't modify it directly
        Specified by:
        getSelection in interface Selectable<D>
        Overrides:
        getSelection in class AbstractListModel<java.lang.Object>
        Returns:
        the current selection.
      • setSelection

        public void setSelection​(java.util.Collection<?> selection)
        Replace the current selection with the given set.

        If this represents a change to the current selection then notify each ListDataListener, including UI.

        Specified by:
        setSelection in interface Selectable<D>
        Overrides:
        setSelection in class AbstractListModel<java.lang.Object>
      • addToSelection

        public boolean addToSelection​(java.lang.Object obj)
        Add the specified object into selection.

        If this represents a change to the current selection then notify each ListDataListener, including UI.

        Specified by:
        addToSelection in interface Selectable<D>
        Overrides:
        addToSelection in class AbstractListModel<java.lang.Object>
        Parameters:
        obj - the object to be as selection.
        Returns:
        true if it is added successfully; false if obj is not part of the data, or was already selected.
      • removeFromSelection

        public boolean removeFromSelection​(java.lang.Object obj)
        Remove the specified object from selection.

        If this represents a change to the current selection then notify each ListDataListener, including UI.

        Specified by:
        removeFromSelection in interface Selectable<D>
        Overrides:
        removeFromSelection in class AbstractListModel<java.lang.Object>
        Parameters:
        obj - the object to be remove from selection.
        Returns:
        whether it is removed successfully
      • clearSelection

        public void clearSelection()
        Change the selection to the empty set.

        If this represents a change to the current selection then notify each ListDataListener, including UI.

        Specified by:
        clearSelection in interface Selectable<D>
        Overrides:
        clearSelection in class AbstractListModel<java.lang.Object>