Interface IRowGroupModel<T>
- All Superinterfaces:
IPersistable
- All Known Implementing Classes:
RowGroupModel
The model behind the
RowGroupExpandCollapseLayer
contains
IRowGroup
s which in turn contain lists of row objects of type T.-
Field Summary
Fields inherited from interface org.eclipse.nebula.widgets.nattable.persistence.IPersistable
DOT, VALUE_SEPARATOR
-
Method Summary
Modifier and TypeMethodDescriptionboolean
addRowGroup
(IRowGroup<T> rowGroup) Adds a group into the model.void
addRowGroups
(List<IRowGroup<T>> rowGroups) Adds multiple row groups into the model and only fires off a single change notification.void
clear()
Wipes all groups from the model.int
getIndexFromRowCache
(T row) Retrieves a row's index by from our cache.getRowFromIndexCache
(int rowIndex) Retrieves a row T by it's index from our cache.getRowGroupForName
(String groupName) Returns an theIRowGroup
with the specified group name.getRowGroupForRow
(T row) Returns the firstIRowGroup
found containing the specified row.void
boolean
isEmpty()
void
Notify anyIRowGroupModelListener
s that something in the model has changed.void
Registers a listener to the model to receive notification of any changes.boolean
removeRowGroup
(IRowGroup<T> rowGroup) Removes the group from the model.void
setDataProvider
(IRowDataProvider<T> dataProvider) Required for the index-to-row cache to populate itseld.void
Unregisters the listener from the model.Methods inherited from interface org.eclipse.nebula.widgets.nattable.persistence.IPersistable
loadState, saveState
-
Method Details
-
addRowGroup
Adds a group into the model.
A notification should be sent to any
IRowGroupModelListener
s to indicate a change in the model has occurred.- Parameters:
rowGroup
- TheIRowGroup
to be added.- Returns:
- false if the group wasn't added.
-
addRowGroups
Adds multiple row groups into the model and only fires off a single change notification.
- Parameters:
rowGroups
- A list ofIRowGroup
s to add.
-
removeRowGroup
Removes the group from the model.
A notification should be sent to any
IRowGroupModelListener
s to indicate a change in the model has occurred.- Parameters:
rowGroup
- TheIRowGroup
to remove.- Returns:
- true if the group was present and removed, false if the group was not present.
-
getRowGroups
-
getRowGroupForName
Returns an theIRowGroup
with the specified group name. -
getRowGroupForRow
Returns the firstIRowGroup
found containing the specified row.- Parameters:
row
- The row object.- Returns:
- An
IRowGroup
or null if there is no group with the specified row.
-
isEmpty
boolean isEmpty()- Returns:
- true if there are no
IRowGroup
s in the model. Note: if there are groups but there are no rows, then true is still returned.
-
clear
void clear()Wipes all groups from the model.
A notification should be sent to any
IRowGroupModelListener
s to indicate a change in the model has occurred. -
notifyListeners
void notifyListeners()Notify any
IRowGroupModelListener
s that something in the model has changed. -
registerRowGroupModelListener
Registers a listener to the model to receive notification of any changes.- Parameters:
listener
- anIRowGroupModelListener
.
-
unregisterRowGroupModelListener
Unregisters the listener from the model.- Parameters:
listener
- anIRowGroupModelListener
.
-
getRowFromIndexCache
Retrieves a row T by it's index from our cache. It will be added to the cache if not present. -
getIndexFromRowCache
Retrieves a row's index by from our cache. It will be added to the cache if not present. -
setDataProvider
Required for the index-to-row cache to populate itseld. -
getDataProvider
IRowDataProvider<T> getDataProvider()- Returns:
- an
IRowDataProvider
used for the index-to-row cache.
-
invalidateIndexCache
void invalidateIndexCache()
-