ROW
- is the generic type of a row in the list.public interface UiWidgetAbstractDataTable<ROW> extends UiWidgetAbstractDataSet<ROW>
data set widget
that represents a
data table. That is a table showing rows of data with their attributes in columns. It has the
following features:
columns
.ID
,
title
, and tooltip
that
will be used for the header of the column.columns
can be
sorted
using
custom comparators
by clicking the column header.
Clicking again will swap between ascending and descending order what is also visualized by an arrow icon.columns
can be resized
by
clicking to the right of the column header and moving the right column border horizontally.columns
can be reordered
by
dragging them around.columns
can be edited
by
double-clicking on cells or programmatically.Modifier and Type | Field and Description |
---|---|
static String |
STYLE_DATA_TABLE
The default
style of this data table widget. |
STYLE_HEADER
HTML_ATTRIBUTE_ID, ID_SEPARATOR, PROPERTY_ID
PROPERTY_STYLES, STYLE_PATTERN_MULTIPLE, STYLE_PATTERN_SINGLE
WAI_ARIA
PROPERTY_SUMMARY
PROPERTY_TITLE
Modifier and Type | Method and Description |
---|---|
<CELL> UiWidgetTableColumn<ROW,CELL> |
createColumn(PropertyAccessor<ROW,CELL> rowAccessor,
UiSingleWidgetFactory<? extends UiWidgetWithValue<CELL>> widgetFactory,
Comparator<CELL> sortComparator)
This method creates a new
column for this table. |
<CELL> UiWidgetTableColumn<ROW,CELL> |
createColumn(TypedProperty<CELL> rowProperty,
UiSingleWidgetFactory<? extends UiWidgetWithValue<CELL>> widgetFactory,
Comparator<CELL> sortComparator)
This method creates a new
column for this table. |
UiWidgetTableColumn<ROW,?> |
getColumn(int index)
This method gets the
column at the given index . |
UiWidgetTableColumn<ROW,?> |
getColumnById(String columnId,
boolean required)
This method gets the
column with the given columnId . |
int |
getColumnCount() |
UiWidgetTableColumn<?,Integer> |
getRowNumberColumn()
Gets implicit
column that shows the row-numbers. |
UiWidgetTableColumn<?,Boolean> |
getSelectionColumn()
Gets implicit
column that shows the checkboxes or radios for the selection of
a row. |
void |
setColumns(List<? extends UiWidgetTableColumn<ROW,?>> columns)
This method sets the
columns for the table of this model. |
getTitle, setTitle
asFeatureSelectedValue
getContext, getParent, getSize
clearMessages
addEventHandler, removeEventHandler
setMode
getMode
setModeFixed
getModeFixed
setId
getId
setTooltip
getTooltip
getVisibleFlag, isVisible, setVisible, setVisible
isVisibleRecursive
setEnabled
isEnabled
addStyle, removeStyle
hasStyle
setStyles
getStyles
setPrimaryStyle
getPrimaryStyle
dispose
isDisposed
isModified
getAriaRole
validate
addSelectionHandler, isSelected, removeSelectionHandler, setSelection
setSelectedValue, setSelectedValues
getSelectedValue, getSelectedValues, getSelectionCount, hasSelectedValue
setSelectionMode
getSelectionMode
setSummary
getSummary
setTitleVisible
isTitleVisible
setEditable
isEditable
static final String STYLE_DATA_TABLE
style
of this data table widget.<CELL> UiWidgetTableColumn<ROW,CELL> createColumn(TypedProperty<CELL> rowProperty, UiSingleWidgetFactory<? extends UiWidgetWithValue<CELL>> widgetFactory, Comparator<CELL> sortComparator)
column
for this table. setColumns(List)
for all
columns that should appear in the UI.CELL
- is the generic type of the property type
.rowProperty
- is the TypedProperty
identifying which property
of <ROW> to show in the column.widgetFactory
- is the factory to
create
widgets for this
column. ATTENTION: These widgets might be reused for performance-reasons for a different
row just by setting its value
. They should NOT contain
additional state information (what is generally a bad idea). This parameter may be
null
to fall back to
datatype based
creation
.sortComparator
- is the sort-comparator to
set
.UiWidgetTableColumn
.<CELL> UiWidgetTableColumn<ROW,CELL> createColumn(PropertyAccessor<ROW,CELL> rowAccessor, UiSingleWidgetFactory<? extends UiWidgetWithValue<CELL>> widgetFactory, Comparator<CELL> sortComparator)
column
for this table. setColumns(List)
for all
columns that should appear in the UI.CELL
- is the generic type of the property value
.rowAccessor
- is the PropertyAccessor
to access
the property of <ROW> to show in the column.widgetFactory
- is the factory to
create
widgets for this
column. ATTENTION: These widgets might be reused for performance-reasons for a different
row just by setting its value
. They should NOT contain
additional state information (what is generally a bad idea). This parameter may be
null
to fall back to
datatype based
creation
.sortComparator
- is the sort-comparator to
set
.UiWidgetTableColumn
.void setColumns(List<? extends UiWidgetTableColumn<ROW,?>> columns)
columns
for the table of this model. list.setColumns(Arrays.asList(column1, column2, column3))Unfortunately varargs with generics cause trouble in interfaces.
AttributeWriteVisibleAdvanced.setVisible(boolean)
instead if possible.columns
- are the columns
to set. Use createColumn
to
create before.createColumn(TypedProperty, UiSingleWidgetFactory, Comparator)
,
createColumn(PropertyAccessor, UiSingleWidgetFactory, Comparator)
int getColumnCount()
columns
that are currently set
.List.size()
UiWidgetTableColumn<ROW,?> getColumn(int index)
column
at the given index
.index
- is the index of the requested column
. The index corresponds to
the index when the columns have been set
. Reordering or hiding columns
in the UI has no effect on the index. The value has to be in the range from 0
to
getColumnCount()
- 1
.column
.List.get(int)
UiWidgetTableColumn<?,Boolean> getSelectionColumn()
column
that shows the checkboxes or radios for the selection of
a row. title
, reorderable
, resizable
, or
sortable
.column
that shows the checkboxes or radios for the
selection of a row.UiWidgetTableColumn<?,Integer> getRowNumberColumn()
column
that shows the row-numbers. title
, reorderable
, resizable
, or
sortable
. make it visible
.column
that shows the row-numbers.UiWidgetTableColumn<ROW,?> getColumnById(String columnId, boolean required) throws ObjectNotFoundException
column
with the given columnId
.columnId
- is the ID
of the requested column.required
- - if true
and the requested column does not exist, an exception is thrown,
false
otherwise (null
will be returned for non existent columns).column
or null
if no such column exists
and required
is false
.ObjectNotFoundException
- if no column exists with the given columnId
and
required
is true
.Copyright © 2001–2016 mmm-Team. All rights reserved.