T - the type of the data table recordspublic class GroupingPlugin<T> extends Object implements DataTablePlugin<T>, TableConfig.RowAppender<T>
| Modifier and Type | Class and Description |
|---|---|
static class |
GroupingPlugin.DataGroup<T> |
static interface |
GroupingPlugin.GroupSupplier<T>
this interface is to provide an implementation to define each row group
|
| Constructor and Description |
|---|
GroupingPlugin(GroupingPlugin.GroupSupplier<T> groupSupplier,
CellRenderer<T> groupRenderer)
Create an instance with custom group supplier and group cell renderer
|
| Modifier and Type | Method and Description |
|---|---|
void |
appendRow(DataTable<T> dataTable,
TableRow<T> tableRow)
Appends a row to the data table
|
void |
collapseAll()
Collapse all the current groups in the data table
|
void |
expandAll()
Expands all the current groups in the data table
|
Map<String,GroupingPlugin.DataGroup<T>> |
getDataGroups() |
void |
handleEvent(TableEvent event) |
void |
init(DataTable<T> dataTable)
this method is used to initialise the plugin with the datatable instance
|
GroupingPlugin<T> |
setGroupCollapsedIcon(Supplier<BaseIcon<?>> groupCollapsedIconSupplier)
Changes the group collapse icon
|
GroupingPlugin<T> |
setGroupExpandedIcon(Supplier<BaseIcon<?>> groupExpandedIconSupplier)
Changes the group expand icon
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetUtilityElements, onAfterAddHeaders, onAfterAddTable, onAllRowsAdded, onBeforeAddHeaders, onBeforeAddRow, onBeforeAddTable, onBodyAdded, onHeaderAdded, onRowAdded, requiresUtilityColumnpublic GroupingPlugin(GroupingPlugin.GroupSupplier<T> groupSupplier, CellRenderer<T> groupRenderer)
groupSupplier - the GroupingPlugin.GroupSuppliergroupRenderer - the CellRendererpublic void init(DataTable<T> dataTable)
init in interface DataTablePlugin<T>dataTable - the DataTable we are attaching this plugin to.public GroupingPlugin<T> setGroupExpandedIcon(Supplier<BaseIcon<?>> groupExpandedIconSupplier)
groupExpandedIconSupplier - Supplier of BaseIcon to change the iconpublic GroupingPlugin<T> setGroupCollapsedIcon(Supplier<BaseIcon<?>> groupCollapsedIconSupplier)
groupCollapsedIconSupplier - Supplier of BaseIcon to change the iconpublic void appendRow(DataTable<T> dataTable, TableRow<T> tableRow)
the plugin will create a group based on the GroupSupplier and will append rows to the first group matching the criteria
appendRow in interface TableConfig.RowAppender<T>dataTable - the DataTabletableRow - the TableRow being appendedpublic void expandAll()
public void collapseAll()
public Map<String,GroupingPlugin.DataGroup<T>> getDataGroups()
public void handleEvent(TableEvent event)
handleEvent in interface TableEventListenerhandleEvent in interface DataTablePlugin<T>event - the TableEvent being receivedCopyright © 2019–2022 Dominokit. All rights reserved.