Package de.esoco.process.ui.composite
Klasse UiTableList<T>
java.lang.Object
org.obrel.core.RelatedObject
de.esoco.process.param.ParameterWrapper<List<org.obrel.core.RelationType<?>>,UiTableList<T>>
de.esoco.process.ui.UiComponent<List<org.obrel.core.RelationType<?>>,UiTableList<T>>
- Alle implementierten Schnittstellen:
de.esoco.lib.property.HasSelection<UiTableList<T>.Row>
,org.obrel.core.Relatable
- Bekannte direkte Unterklassen:
UiPagingTableList
public class UiTableList<T>
extends UiComposite<UiTableList<T>>
implements de.esoco.lib.property.HasSelection<UiTableList<T>.Row>
A table-like rendering of components in a list. The header and data areas are
rendered with
UiListPanel
instances where the list items represent
the header and data rows. The table appearance is achieved by using the same
column grid layout for the item content.-
Verschachtelte Klassen - Übersicht
Modifizierer und TypKlasseBeschreibungclass
The component that describes a table column.class
The component that contains the contents of a table row.Von Klasse geerbte verschachtelte Klassen/Schnittstellen de.esoco.process.ui.UiContainer
UiContainer.UiContainerFragment
-
Konstruktorübersicht
KonstruktorBeschreibungUiTableList
(UiContainer<?> parent) Creates a new instance with rows that can be expanded by selecting their header area.UiTableList
(UiContainer<?> parent, de.esoco.lib.expression.monad.Option<UiListPanel.ExpandableListStyle> expandStyle) Creates a new instance with rows that can be expanded by selecting their header area. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibung<V> UiTableList<T>.Column
<V> Adds a column to this table.void
addColumns
(Function<? super T, ?>... columnDataReaders) Adds multiple columns at once.void
addEmptyTableInfo
(Consumer<UiBuilder<?>> createEmtpyTableInfo) Adds components that will be displayed if a table is empty, i.e. it has now visible data rows.UiContainer
<?> addExpandedHeader
(UiLayout layout) Creates and returns a container that allows to add expanded content to the header of this list.protected void
buildContent
(UiBuilder<?> builder) This method can be overridden by subclasses to build the content of this container.protected <V> UiTableList<T>.Column
<V> createColumn
(Function<? super T, V> getColumnData) Creates a new column.protected UiTableList<T>.Row
createRow
(UiListPanel.Item item, T rowData) Creates a new row.protected void
displayRows
(int firstRow, int count) Update the rows of this table.List
<UiTableList<T>.Column<?>> Returns the columns of this table.final de.esoco.lib.model.DataProvider
<T> getData()
Returns the provider of the table data.List
<UiTableList<T>.Row> getRows()
Returns the data rows of this table.Returns the currently selected row.onColumnSelection
(Consumer<UiTableList<T>.Column<?>> handleColumnSelection) Registers a listener for column selections (i.e. clicks on column headers).onRowSelection
(Consumer<UiTableList<T>.Row> handleRowSelection) Registers a listener for row selections (i.e. clicks on rows).void
removeRow
(UiTableList<T>.Row row) Removes a certain row from this table.void
setColumnPrefix
(String prefix) Sets the prefix to be used for column titles.void
Sets the data provider of the table row data.void
setExpandedRowBuilder
(BiConsumer<UiBuilder<?>, T> builder) Sets a consumer that will be invoked to build the content of expanded rows if this table has an expansion style.void
setSelection
(UiTableList<T>.Row row) Sets the selection to a certain row.protected void
Updates the table display from the data provider that has been set throughsetData(DataProvider)
.Von Klasse geerbte Methoden de.esoco.process.ui.UiContainer
applyProperties, attachTo, builder, clear, componentAdded, componentListChanged, getComponents, getLayout, isBuilt, onClickInContainerArea, remove, toString
Von Klasse geerbte Methoden de.esoco.process.ui.UiComponent
cell, cell, getComponentStyleName, getImage, getParent, getRootView, getValueImpl, getView, height, icon, image, label, placeBefore, resid, setValueImpl, size, style, style, styleName, tooltip, update, visibleOn, width
Von Klasse geerbte Methoden de.esoco.process.param.ParameterWrapper
clear, disable, enable, fragment, get, getParam, has, hide, id, initiateDownload, isEnabled, isVisible, remove, set, set, set, setEnabled, setFragment, setParam, setParameterEventHandler, setParameterType, setVisible, show, type
Von Klasse geerbte Methoden org.obrel.core.RelatedObject
deleteRelation, get, getRelation, getRelations, notifyRelationListeners, readRelations, relationsEqual, relationsHashCode, relationsString, set, set, transform, writeRelations
Von Klasse geerbte Methoden java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Von Schnittstelle geerbte Methoden org.obrel.core.Relatable
deleteRelation, deleteRelations, getAll, getOption, getRelationCount, getRelations, hasFlag, hasRelation, hasRelations, init, set, set, set, setOption, streamRelations
-
Konstruktordetails
-
UiTableList
Creates a new instance with rows that can be expanded by selecting their header area. Expanding an item will reveal the item content and hide any other previously expanded item content.- Parameter:
parent
- The parent container
-
UiTableList
public UiTableList(UiContainer<?> parent, de.esoco.lib.expression.monad.Option<UiListPanel.ExpandableListStyle> expandStyle) Creates a new instance with rows that can be expanded by selecting their header area. Expanding an item will reveal the item content and hide any other previously expanded item content.- Parameter:
parent
- The parent containerexpandStyle
- The expand style
-
-
Methodendetails
-
addColumn
Adds a column to this table.- Parameter:
getColumnData
- A function that retrieves the column value of a table cell from a row data object- Gibt zurück:
- The new column
-
addColumns
Adds multiple columns at once.- Parameter:
columnDataReaders
- The
-
addEmptyTableInfo
Adds components that will be displayed if a table is empty, i.e. it has now visible data rows. The argument is a function that receives an UI builder that must be used to build the empty table info component. This component will then be displayed below the table header.The application should not make assumptions about the layout of the builder's container and only add a single component. If it needs a more complex UI it should add a container with the required layout.
- Parameter:
createEmtpyTableInfo
- A consumer that receives a builder for the empty table info area
-
addExpandedHeader
Creates and returns a container that allows to add expanded content to the header of this list. The content will be displayed if the header is expanded by clicking on it. This method must be invoked before the list is rendered for the first time because it needs to modify the styles of the header components to support expansion.- Parameter:
layout
- The layout of the expanded header content panel the builder is created for- Gibt zurück:
- The container for the expanded header content
-
getColumns
Returns the columns of this table.- Gibt zurück:
- The column list
-
getData
Returns the provider of the table data.- Gibt zurück:
- The table row data provider
-
getRows
Returns the data rows of this table.- Gibt zurück:
- The data row list
-
getSelection
Returns the currently selected row.- Angegeben von:
getSelection
in Schnittstellede.esoco.lib.property.HasSelection<T>
- Gibt zurück:
- The selected or (NULL for none)
-
onColumnSelection
Registers a listener for column selections (i.e. clicks on column headers). The listener will be invoked with the respective column as it's argument.- Parameter:
handleColumnSelection
- The column selection handler- Gibt zurück:
- This instance
-
onRowSelection
Registers a listener for row selections (i.e. clicks on rows). The listener will be invoked with the respective row as it's argument.- Parameter:
handleRowSelection
- The row selection handler- Gibt zurück:
- This instance
-
removeRow
Removes a certain row from this table.- Parameter:
row
- The row to remove
-
setColumnPrefix
Sets the prefix to be used for column titles.- Parameter:
prefix
- The column title prefix
-
setData
Sets the data provider of the table row data. This will immediately build the table rows from the data so all necessary initializations of this table should have been performed already (e.g. settings columns or an expanded row builder).- Parameter:
rowDataProvider
- The data provider that returns the table rows
-
setExpandedRowBuilder
Sets a consumer that will be invoked to build the content of expanded rows if this table has an expansion style. This can be used for rows with simple row content where the full content can be build at once. For complex cases where the expanded row content should be updated only upon row selection aUiTableList<T>.Row
subclass should be used instead with overridden methodsUiTableList.Row.initExpandedContent(UiBuilder)
andUiTableList.Row.updateExpandedContent()
.The argument is a binary consumer that will be invoked with the builder for the row content container and the data object of the row.
- Parameter:
builder
- The builder for the row content
-
setSelection
Sets the selection to a certain row.- Angegeben von:
setSelection
in Schnittstellede.esoco.lib.property.HasSelection<T>
- Parameter:
row
- The row to select or NULL for no selection
-
buildContent
This method can be overridden by subclasses to build the content of this container. Alternatively, the content can also be built by adding components to it after creation. If both mechanisms are used in combination the call toUiContainer.buildContent(UiBuilder)
will occur afterwards because it is invoked just before the container is made visible (fromUiContainer.applyProperties()
.The
UiBuilder
argument is the same instance that is returned byUiContainer.builder()
.The default implementation of this method does nothing.
- Setzt außer Kraft:
buildContent
in KlasseUiContainer<UiTableList<T>>
- Parameter:
builder
- The builder to create the container UI with
-
createColumn
Creates a new column. Subclasses can override this method to return their own column subclasses, e.g. to handle special formatting or value parsing.- Parameter:
getColumnData
- The column data access function- Gibt zurück:
- The new column instance
-
createRow
Creates a new row. Subclasses can override this method to return their own row subclasses, e.g. to handle the row content.- Parameter:
item
- The row itemrowData
- The row data- Gibt zurück:
- A new row instance
-
displayRows
protected void displayRows(int firstRow, int count) Update the rows of this table. This will also adjust the number of table rows (i.e. add or remove rows) to match the size of the given data set.- Parameter:
firstRow
- The index of the first row to displaycount
- The number of rows to display
-
updateData
protected void updateData()Updates the table display from the data provider that has been set throughsetData(DataProvider)
. The default implementation renders all data objects from the provider. Subclasses can override this method if they need to display only part of the data, e.g. for a paging table.
-