ADAPTER - is the generic type of AbstractUiWidgetNative.getWidgetAdapter().VALUE - is the generic type of the value. Has to be either ITEM or
List<ITEM>.ROW - is the generic type of a row in the value list.ITEM_CONTAINER - is the generic type of the ItemContainer.public abstract class AbstractUiWidgetAbstractDataTable<ADAPTER extends UiWidgetAdapterAbstractDataTable<ROW>,VALUE,ROW,ITEM_CONTAINER extends ItemContainer<ROW,ITEM_CONTAINER>> extends AbstractUiWidgetAbstractDataSet<ADAPTER,VALUE,ROW,ITEM_CONTAINER> implements UiWidgetAbstractDataTable<ROW>
UiWidgetAbstractDataTable.| Modifier and Type | Class and Description |
|---|---|
private class |
AbstractUiWidgetAbstractDataTable.LazyPropertyAccessor<CELL>
This class is a lazy implementation of
PropertyAccessor. |
AbstractUiWidgetNative.SizeImplAbstractUiWidget.AccessHelper, AbstractUiWidget.EventSender, AbstractUiWidget.HandlerContainer| Modifier and Type | Field and Description |
|---|---|
private List<AbstractUiWidgetTableColumn<?,ROW,?>> |
columns |
private AbstractUiWidgetTableColumn<?,?,?> |
dragOverColumn |
private UiDataBinding<ROW> |
rowBinding |
private AbstractUiWidgetTableColumn<?,ROW,Integer> |
rowNumberColumn |
private AbstractUiWidgetTableColumn<?,ROW,Boolean> |
selectionColumn |
private AbstractUiWidgetTableColumn<?,ROW,?> |
sortColumn |
STYLE_DATA_TABLESTYLE_HEADERHTML_ATTRIBUTE_ID, ID_SEPARATOR, PROPERTY_IDPROPERTY_STYLES, STYLE_PATTERN_MULTIPLE, STYLE_PATTERN_SINGLEWAI_ARIAPROPERTY_SUMMARYPROPERTY_TITLEACCESS_KEY_NONE, HTML_ATTRIBUTE_ACCESS_KEY| Constructor and Description |
|---|
AbstractUiWidgetAbstractDataTable(UiContext context,
ADAPTER widgetAdapter)
The constructor.
|
| 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. |
private <CELL> UiWidgetTableColumn<ROW,CELL> |
createColumn(PropertyAccessor<ROW,CELL> rowAccessor,
UiSingleWidgetFactory<? extends UiWidgetWithValue<CELL>> widgetFactory,
Comparator<CELL> sortComparator,
TypedProperty<CELL> rowProperty) |
<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. |
protected abstract ITEM_CONTAINER |
createRowContainer() |
protected ITEM_CONTAINER |
createRowContainer(ROW row) |
private AbstractUiWidgetTableColumn<?,ROW,Integer> |
createRowNumberColumn() |
protected AbstractUiWidgetTableColumn<?,ROW,Boolean> |
createSelectionColumn() |
UiWidgetAdapterTableColumn |
createTableColumnAdapter(UiWidgetTableColumn<ROW,?> column) |
private void |
dragColumn(AbstractUiWidgetTableColumn<?,ROW,?> dragColumn,
AbstractUiWidgetTableColumn<?,ROW,?> dropColumn) |
void |
dragColumn(String dragId,
String dropId)
This method updates this table after a column has been dragged and dropped onto another column.
|
UiWidgetTableColumn<ROW,?> |
getColumn(int index)
This method gets the
column at the given index. |
AbstractUiWidgetTableColumn<?,ROW,?> |
getColumnById(String columnId,
boolean required)
This method gets the
column with the given columnId. |
int |
getColumnCount() |
protected ROW |
getItem(ITEM_CONTAINER container)
This method gets the item in the given
container. |
AbstractUiWidgetTableColumn<?,ROW,Integer> |
getRowNumberColumn()
Gets implicit
column that shows the row-numbers. |
AbstractUiWidgetTableColumn<?,ROW,Boolean> |
getSelectionColumn()
Gets implicit
column that shows the checkboxes or radios for the selection of
a row. |
(package private) AbstractUiWidgetTableColumn<?,ROW,?> |
getSortColumn() |
boolean |
hasRowNumberColumn() |
protected void |
initializeWidgetAdapter(ADAPTER adapter)
This method is called from
AbstractUiWidgetNative.getWidgetAdapter() to initialize the UiWidgetAdapter. |
void |
setColumns(List<? extends UiWidgetTableColumn<ROW,?>> columns)
This method sets the
columns for the table of this model. |
AbstractUiWidgetTableColumn<?,?,?> |
setDragOverColumn(AbstractUiWidgetTableColumn<?,?,?> column)
Sets the column that is currently under the dragged column.
|
(package private) void |
sort(AbstractUiWidgetTableColumn<?,ROW,?> column,
SortOrder sortOrder)
This method sorts this list according to the given
column. |
addSelectionHandler, asFeatureSelectedValue, clearSelection, doGetSelected, doSetSelected, getAllAvailableItems, getFirstAvailableItem, getItemContainer, getLastAvailableItem, getSelectedValue, getSelectedValues, getSelectedValuesInternal, getSelectionCount, getSelectionMode, getSummary, getTitle, hasSelectedValue, isEditable, isSelected, isTitleVisible, onItemSelection, removeSelectionHandler, setEditable, setSelectedValue, setSelectedValues, setSelectedValues, setSelection, setSelection, setSelectionMode, setSummary, setTitle, setTitleVisibleaddFocusHandler, getAccessKey, isFocused, onAccessKeyPressed, removeFocusHandler, setAccessKey, setFocused, setFocusedaddChangeHandler, addStyle, clearMessages, clearValidity, createSize, createUniqueId, createWidgetAdapter, dispose, doGetValue, doSetMode, doSetValue, doValidate, getAriaRole, getAriaRoleFixedType, getChild, getChild, getChildCount, getChildIndex, getId, getIndexOfStyle, getMode, getModeFixed, getParent, getPrimaryStyle, getSize, getStyles, getTooltip, getVisibleFlag, getWidgetAdapter, getWidgetAdapter, hasStyle, hasWidgetAdapter, isDisposed, isEnabled, isModifiedRecursive, isVisible, isVisibleRecursive, removeChangeHandler, removeFromParent, removeStyle, setAriaRole, setEnabled, setId, setIdPrefix, setMode, setMode, setModeFixed, setParent, setPrimaryStyle, setStyles, setTooltip, setVisible, setVisible, toString, visibilityChangedaddEventHandler, addValidator, clearMessagesLocal, clearValidationFailure, convertValueToString, fireEvent, fireValueChange, getBasicUtil, getContext, getDataBinding, getDataBinding, getDataBindingForWidget, getEventSender, getFactory, getLogger, getObserverSource, getOriginalValue, getRecentValue, getSource, getValueClass, getValueDirect, getValueOrException, getWidgetAdapter, hasEventSender, isMandatory, isModified, removeEventHandler, removeFromParent, removeValidator, setMandatory, setModified, setParent, setValueaddValidatorMandatory, createValidationFailure, getValue, getValueAndValidate, handleGetValueError, resetValue, setValue, setValueForUser, validateclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetTitle, setTitleasFeatureSelectedValuegetContext, getParent, getSizeclearMessagesaddEventHandler, removeEventHandlersetModegetModesetModeFixedgetModeFixedsetIdgetIdsetTooltipgetTooltipgetVisibleFlag, isVisible, setVisible, setVisibleisVisibleRecursivesetEnabledisEnabledaddStyle, removeStylehasStylesetStylesgetStylessetPrimaryStylegetPrimaryStyledisposeisDisposedisModifiedgetAriaRolevalidateaddSelectionHandler, isSelected, removeSelectionHandler, setSelectionsetSelectedValue, setSelectedValuesgetSelectedValue, getSelectedValues, getSelectionCount, hasSelectedValuesetSelectionModegetSelectionModesetSummarygetSummarysetTitleVisibleisTitleVisiblesetEditableisEditableresetValue, setValue, setValueForUsergetValueprivate final List<AbstractUiWidgetTableColumn<?,ROW,?>> columns
setColumns(List)private UiDataBinding<ROW> rowBinding
private AbstractUiWidgetTableColumn<?,ROW,?> sortColumn
private AbstractUiWidgetTableColumn<?,ROW,Boolean> selectionColumn
getSelectionColumn()private AbstractUiWidgetTableColumn<?,ROW,Integer> rowNumberColumn
getRowNumberColumn()private AbstractUiWidgetTableColumn<?,?,?> dragOverColumn
public AbstractUiWidgetAbstractDataTable(UiContext context, ADAPTER widgetAdapter)
context - is the context.widgetAdapter - is the widget adapter. Typically null for
lazy initialization.protected void initializeWidgetAdapter(ADAPTER adapter)
AbstractUiWidgetNative.getWidgetAdapter() to initialize the UiWidgetAdapter. All
attributes of this widget need to be set in the UiWidgetAdapter.initializeWidgetAdapter in class AbstractUiWidgetAbstractDataSet<ADAPTER extends UiWidgetAdapterAbstractDataTable<ROW>,VALUE,ROW,ITEM_CONTAINER extends ItemContainer<ROW,ITEM_CONTAINER>>adapter - is the UiWidgetAdapter to initialize.public AbstractUiWidgetTableColumn<?,ROW,Boolean> getSelectionColumn()
column that shows the checkboxes or radios for the selection of
a row. title, reorderable, resizable, or
sortable.getSelectionColumn in interface UiWidgetAbstractDataTable<ROW>column that shows the checkboxes or radios for the
selection of a row.protected AbstractUiWidgetTableColumn<?,ROW,Boolean> createSelectionColumn()
getSelectionColumn()public AbstractUiWidgetTableColumn<?,ROW,Integer> getRowNumberColumn()
column that shows the row-numbers. title, reorderable, resizable, or
sortable. make it visible.getRowNumberColumn in interface UiWidgetAbstractDataTable<ROW>column that shows the row-numbers.public boolean hasRowNumberColumn()
true if getRowNumberColumn() has already been called, false
otherwise.private AbstractUiWidgetTableColumn<?,ROW,Integer> createRowNumberColumn()
getRowNumberColumn()protected ITEM_CONTAINER createRowContainer(ROW row)
row - is the <ROW> to set in the
container.AbstractItemContainer.protected abstract ITEM_CONTAINER createRowContainer()
AbstractItemContainer.protected ROW getItem(ITEM_CONTAINER container)
container.getItem in class AbstractUiWidgetAbstractDataSet<ADAPTER extends UiWidgetAdapterAbstractDataTable<ROW>,VALUE,ROW,ITEM_CONTAINER extends ItemContainer<ROW,ITEM_CONTAINER>>container - is the container of the requested item.public <CELL> UiWidgetTableColumn<ROW,CELL> createColumn(TypedProperty<CELL> rowProperty, UiSingleWidgetFactory<? extends UiWidgetWithValue<CELL>> widgetFactory, Comparator<CELL> sortComparator)
column for this table. UiWidgetAbstractDataTable.setColumns(List) for all
columns that should appear in the UI.createColumn in interface UiWidgetAbstractDataTable<ROW>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.public <CELL> UiWidgetTableColumn<ROW,CELL> createColumn(PropertyAccessor<ROW,CELL> rowAccessor, UiSingleWidgetFactory<? extends UiWidgetWithValue<CELL>> widgetFactory, Comparator<CELL> sortComparator)
column for this table. UiWidgetAbstractDataTable.setColumns(List) for all
columns that should appear in the UI.createColumn in interface UiWidgetAbstractDataTable<ROW>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.private <CELL> UiWidgetTableColumn<ROW,CELL> createColumn(PropertyAccessor<ROW,CELL> rowAccessor, UiSingleWidgetFactory<? extends UiWidgetWithValue<CELL>> widgetFactory, Comparator<CELL> sortComparator, TypedProperty<CELL> rowProperty)
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.rowProperty - is the TypedProperty. May be null.UiWidgetTableColumn.createColumn(PropertyAccessor, UiSingleWidgetFactory, Comparator)public 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.setColumns in interface UiWidgetAbstractDataTable<ROW>columns - are the columns to set. Use createColumn to
create before.UiWidgetAbstractDataTable.createColumn(TypedProperty, UiSingleWidgetFactory, Comparator),
UiWidgetAbstractDataTable.createColumn(PropertyAccessor, UiSingleWidgetFactory, Comparator)public int getColumnCount()
getColumnCount in interface UiWidgetAbstractDataTable<ROW>columns that are currently set.List.size()public UiWidgetTableColumn<ROW,?> getColumn(int index)
column at the given index.getColumn in interface UiWidgetAbstractDataTable<ROW>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
UiWidgetAbstractDataTable.getColumnCount() - 1.column.List.get(int)public AbstractUiWidgetTableColumn<?,ROW,?> getColumnById(String columnId, boolean required) throws ObjectNotFoundException
column with the given columnId.getColumnById in interface UiWidgetAbstractDataTable<ROW>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.void sort(AbstractUiWidgetTableColumn<?,ROW,?> column, SortOrder sortOrder)
column.column - is the AbstractUiWidgetTableColumn to sort by.sortOrder - is the SortOrder.AbstractUiWidgetTableColumn<?,ROW,?> getSortColumn()
public UiWidgetAdapterTableColumn createTableColumnAdapter(UiWidgetTableColumn<ROW,?> column)
column - is the UiWidgetTableColumn for which to create the widget adapter.UiWidgetAdapterTableColumn for the given UiWidgetTableColumn.public void dragColumn(String dragId, String dropId)
dragId - the ID of the dragged column (that is to be moved).dropId - the ID of the dropped column (where to move to).private void dragColumn(AbstractUiWidgetTableColumn<?,ROW,?> dragColumn, AbstractUiWidgetTableColumn<?,ROW,?> dropColumn)
dragColumn - the dragged column (that is to be moved).dropColumn - the dropped column (where to move to).dragColumn(AbstractUiWidgetTableColumn, AbstractUiWidgetTableColumn)public AbstractUiWidgetTableColumn<?,?,?> setDragOverColumn(AbstractUiWidgetTableColumn<?,?,?> column)
column - is the new drag-over column. May be null.null.Copyright © 2001–2016 mmm-Team. All rights reserved.