public class GroupsListModel<D,G,F> extends AbstractListModel<java.lang.Object> implements GroupsSelectableModel<java.lang.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(java.lang.Object obj)
Deprecated.
As of release 6.0.0, replaced with
addToSelection(java.lang.Object) . |
boolean |
addToSelection(java.lang.Object obj)
Add the specified object into selection.
|
void |
clearSelection()
Change the selection to the empty set.
|
java.lang.Object |
clone() |
boolean |
equals(java.lang.Object o) |
GroupingInfo |
getDataInfo(int index)
Returns the group info of given index
|
java.lang.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.
|
java.util.List<int[]> |
getGroupsInfos() |
GroupsModel<D,G,F> |
getGroupsModel() |
java.util.Set<java.lang.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(java.lang.Object obj)
Returns whether an object is selected.
|
boolean |
isSelectionEmpty()
Returns true if the selection is currently empty.
|
boolean |
removeFromSelection(java.lang.Object obj)
Remove the specified object from selection.
|
void |
removeSelection(java.lang.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(java.util.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. |
java.lang.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 java.util.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 boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public void addSelection(java.lang.Object obj)
addToSelection(java.lang.Object)
.public void removeSelection(java.lang.Object obj)
removeFromSelection(java.lang.Object)
.public java.lang.Object getElementAt(int index)
ListModel
getElementAt
in interface ListModel<java.lang.Object>
public int getSize()
ListModel
public java.util.Set<java.lang.Object> getSelection()
AbstractListModel
getSelection
in interface Selectable<java.lang.Object>
getSelection
in class AbstractListModel<java.lang.Object>
public void setSelection(java.util.Collection<?> selection)
If this represents a change to the current selection then notify each ListDataListener, including UI.
setSelection
in interface Selectable<java.lang.Object>
setSelection
in class AbstractListModel<java.lang.Object>
public boolean isSelected(java.lang.Object obj)
isSelected
in interface Selectable<java.lang.Object>
isSelected
in class AbstractListModel<java.lang.Object>
public boolean isSelectionEmpty()
isSelectionEmpty
in interface Selectable<java.lang.Object>
isSelectionEmpty
in class AbstractListModel<java.lang.Object>
public boolean addToSelection(java.lang.Object obj)
If this represents a change to the current selection then notify each ListDataListener, including UI.
addToSelection
in interface Selectable<java.lang.Object>
addToSelection
in class AbstractListModel<java.lang.Object>
obj
- the object to be as selection.obj
is not part of the data, or was already selected.public boolean removeFromSelection(java.lang.Object obj)
If this represents a change to the current selection then notify each ListDataListener, including UI.
removeFromSelection
in interface Selectable<java.lang.Object>
removeFromSelection
in class AbstractListModel<java.lang.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<java.lang.Object>
clearSelection
in class AbstractListModel<java.lang.Object>
public boolean isMultiple()
isMultiple
in interface Selectable<java.lang.Object>
isMultiple
in class AbstractListModel<java.lang.Object>
Selectable.setMultiple(boolean)
public void setMultiple(boolean multiple)
setMultiple
in interface Selectable<java.lang.Object>
setMultiple
in class AbstractListModel<java.lang.Object>
public SelectionControl getSelectionControl()
Selectable
getSelectionControl
in interface Selectable<java.lang.Object>
getSelectionControl
in class AbstractListModel<java.lang.Object>
public void setSelectionControl(SelectionControl ctrl)
Selectable
setSelectionControl
in interface Selectable<java.lang.Object>
setSelectionControl
in class AbstractListModel<java.lang.Object>
public java.lang.Object clone()
clone
in class AbstractListModel<java.lang.Object>
public void setGroupSelectable(boolean groupSelectable)
GroupsSelectableModel
setGroupSelectable
in interface GroupsSelectableModel<java.lang.Object>
public boolean isGroupSelectable()
GroupsSelectableModel
isGroupSelectable
in interface GroupsSelectableModel<java.lang.Object>
Copyright © 2005-2018 Potix Corporation. All Rights Reserved.