public class GroupsListModel<D,G,F> extends AbstractListModel<Object> implements GroupsSelectableModel<Object>
GroupsModel
as an instance of ListModel
such that it is easier to handle by Listbox
and
Group
.Modifier and Type | Class and Description |
---|---|
static class |
GroupsListModel.GroupDataInfo
The group information returned by
getDataInfo(int) . |
AbstractListModel.DefaultSelectionControl<E>
Modifier and Type | Field and Description |
---|---|
protected GroupsModel<D,G,F> |
_model |
_selection
INTERNAL_EVENT
Modifier | Constructor and Description |
---|---|
protected |
GroupsListModel(GroupsModel<D,G,F> model) |
Modifier and Type | Method and Description |
---|---|
void |
addSelection(Object obj)
Deprecated.
As of release 6.0.0, replaced with
addToSelection(java.lang.Object) . |
boolean |
addToSelection(Object obj)
Add the specified object into selection.
|
void |
cleanInternalListener()
Clean up internal listener,
it will be called when components changing model.
|
void |
clearSelection()
Change the selection to the empty set.
|
Object |
clone() |
boolean |
equals(Object o) |
GroupingInfo |
getDataInfo(int index)
Returns the group info of given index
|
Object |
getElementAt(int index)
Returns the value at the specified index.
|
int |
getGroupOffset(int groupIndex)
Returns the offset from 0 that a group in this ListModel.
|
List<int[]> |
getGroupsInfos() |
GroupsModel<D,G,F> |
getGroupsModel() |
Set<Object> |
getSelection()
Returns the current selection.
|
SelectionControl |
getSelectionControl()
Returns the selection control for the selection model, if any.
|
int |
getSize()
Returns the length of the list.
|
int |
hashCode() |
boolean |
isGroupSelectable()
Returns whether the groups are selectable
|
boolean |
isMultiple()
Returns whether the current selection mode is multiple.
|
boolean |
isSelected(Object obj)
Returns whether an object is selected.
|
boolean |
isSelectionEmpty()
Returns true if the selection is currently empty.
|
boolean |
removeFromSelection(Object obj)
Remove the specified object from selection.
|
void |
removeSelection(Object obj)
Deprecated.
As of release 6.0.0, replaced with
removeFromSelection(java.lang.Object) . |
void |
setGroupSelectable(boolean groupSelectable)
Sets the groups are selectable
|
void |
setMultiple(boolean multiple)
Sets the selection mode to be multiple.
|
void |
setSelection(Collection<?> selection)
Replace the current selection with the given set.
|
void |
setSelectionControl(SelectionControl ctrl)
Sets the selection control for the selection model
|
static <D,G,F> GroupsListModel<D,G,F> |
toListModel(GroupsModel<D,G,F> model)
Returns the list model (
ListModel ) representing the given
groups model. |
String |
toString() |
addListDataListener, addPagingEventListener, fireEvent, fireSelectionEvent, getActivePage, getPageCount, getPageSize, newEmptySelection, readSelection, removeAllSelection, removeListDataListener, removePagingEventListener, retainAllSelection, setActivePage, setPageSize, writeSelection
protected GroupsModel<D,G,F> _model
protected GroupsListModel(GroupsModel<D,G,F> model)
public static <D,G,F> GroupsListModel<D,G,F> toListModel(GroupsModel<D,G,F> model)
ListModel
) representing the given
groups model.public void cleanInternalListener()
public List<int[]> getGroupsInfos()
public int getGroupOffset(int groupIndex)
For example, _gpofs[2] is the offset of group 2 (the third group) in this ListModel.
groupIndex
- the group indexpublic GroupsModel<D,G,F> getGroupsModel()
public GroupingInfo getDataInfo(int index)
public void addSelection(Object obj)
addToSelection(java.lang.Object)
.public void removeSelection(Object obj)
removeFromSelection(java.lang.Object)
.public Object getElementAt(int index)
ListModel
getElementAt
in interface ListModel<Object>
public int getSize()
ListModel
public Set<Object> getSelection()
AbstractListModel
getSelection
in interface Selectable<Object>
getSelection
in class AbstractListModel<Object>
public void setSelection(Collection<?> selection)
If this represents a change to the current selection then notify each ListDataListener, including UI.
setSelection
in interface Selectable<Object>
setSelection
in class AbstractListModel<Object>
public boolean isSelected(Object obj)
isSelected
in interface Selectable<Object>
isSelected
in class AbstractListModel<Object>
public boolean isSelectionEmpty()
isSelectionEmpty
in interface Selectable<Object>
isSelectionEmpty
in class AbstractListModel<Object>
public boolean addToSelection(Object obj)
If this represents a change to the current selection then notify each ListDataListener, including UI.
addToSelection
in interface Selectable<Object>
addToSelection
in class AbstractListModel<Object>
obj
- the object to be as selection.obj
is not part of the data, or was already selected.public boolean removeFromSelection(Object obj)
If this represents a change to the current selection then notify each ListDataListener, including UI.
removeFromSelection
in interface Selectable<Object>
removeFromSelection
in class AbstractListModel<Object>
obj
- the object to be remove from selection.public void clearSelection()
If this represents a change to the current selection then notify each ListDataListener, including UI.
clearSelection
in interface Selectable<Object>
clearSelection
in class AbstractListModel<Object>
public boolean isMultiple()
isMultiple
in interface Selectable<Object>
isMultiple
in class AbstractListModel<Object>
Selectable.setMultiple(boolean)
public void setMultiple(boolean multiple)
setMultiple
in interface Selectable<Object>
setMultiple
in class AbstractListModel<Object>
public SelectionControl getSelectionControl()
Selectable
getSelectionControl
in interface Selectable<Object>
getSelectionControl
in class AbstractListModel<Object>
public void setSelectionControl(SelectionControl ctrl)
Selectable
setSelectionControl
in interface Selectable<Object>
setSelectionControl
in class AbstractListModel<Object>
public Object clone()
clone
in class AbstractListModel<Object>
public void setGroupSelectable(boolean groupSelectable)
GroupsSelectableModel
setGroupSelectable
in interface GroupsSelectableModel<Object>
public boolean isGroupSelectable()
GroupsSelectableModel
isGroupSelectable
in interface GroupsSelectableModel<Object>
Copyright © 2021. All rights reserved.