Interface IRowGroupModel<T>
-
- All Superinterfaces:
IPersistable
- All Known Implementing Classes:
RowGroupModel
public interface IRowGroupModel<T> extends IPersistable
The model behind theRowGroupExpandCollapseLayer
containsIRowGroup
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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
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.IRowDataProvider<T>
getDataProvider()
int
getIndexFromRowCache(T row)
Retrieves a row's index by from our cache.T
getRowFromIndexCache(int rowIndex)
Retrieves a row T by it's index from our cache.IRowGroup<T>
getRowGroupForName(String groupName)
Returns an theIRowGroup
with the specified group name.IRowGroup<T>
getRowGroupForRow(T row)
Returns the firstIRowGroup
found containing the specified row.List<IRowGroup<T>>
getRowGroups()
void
invalidateIndexCache()
boolean
isEmpty()
void
notifyListeners()
Notify anyIRowGroupModelListener
s that something in the model has changed.void
registerRowGroupModelListener(IRowGroupModelListener listener)
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
unregisterRowGroupModelListener(IRowGroupModelListener listener)
Unregisters the listener from the model.-
Methods inherited from interface org.eclipse.nebula.widgets.nattable.persistence.IPersistable
loadState, saveState
-
-
-
-
Method Detail
-
addRowGroup
boolean addRowGroup(IRowGroup<T> rowGroup)
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
void addRowGroups(List<IRowGroup<T>> rowGroups)
Adds multiple row groups into the model and only fires off a single change notification.
- Parameters:
rowGroups
- A list ofIRowGroup
s to add.
-
removeRowGroup
boolean removeRowGroup(IRowGroup<T> rowGroup)
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.
-
getRowGroupForName
IRowGroup<T> getRowGroupForName(String groupName)
Returns an theIRowGroup
with the specified group name.
-
getRowGroupForRow
IRowGroup<T> getRowGroupForRow(T row)
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
void registerRowGroupModelListener(IRowGroupModelListener listener)
Registers a listener to the model to receive notification of any changes.- Parameters:
listener
- anIRowGroupModelListener
.
-
unregisterRowGroupModelListener
void unregisterRowGroupModelListener(IRowGroupModelListener listener)
Unregisters the listener from the model.- Parameters:
listener
- anIRowGroupModelListener
.
-
getRowFromIndexCache
T getRowFromIndexCache(int rowIndex)
Retrieves a row T by it's index from our cache. It will be added to the cache if not present.
-
getIndexFromRowCache
int getIndexFromRowCache(T row)
Retrieves a row's index by from our cache. It will be added to the cache if not present.
-
setDataProvider
void setDataProvider(IRowDataProvider<T> dataProvider)
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()
-
-