- java.lang.Object
-
- io.github.mmm.ui.api.widget.AbstractUiWidget
-
- io.github.mmm.ui.spi.widget.AbstractUiNativeWidget
-
- io.github.mmm.ui.spi.widget.AbstractUiNativeWidgetWrapper<Void>
-
- io.github.mmm.ui.test.widget.TestWidget
-
- io.github.mmm.ui.test.widget.TestActiveWidget
-
- io.github.mmm.ui.test.widget.TestActiveValidatableWidget<List<R>>
-
- io.github.mmm.ui.test.widget.data.TestDataList<R>
-
- Type Parameters:
R
- type of the data for the rows displayed by this widget. Typically aBean
.
- All Implemented Interfaces:
EventSource<UiEvent,UiEventListener>
,AttributeReadEnabled
,AttributeReadId
,AttributeReadMultiSelection
,AttributeReadSelection<R>
,AttributeReadSelections<R>
,AttributeReadValid
,AttributeReadValue<List<R>>
,AttributeReadVisible
,AttributeWriteEnabled
,AttributeWriteId
,AttributeWriteMultiSelection
,AttributeWriteReadOnly
,AttributeWriteSelection<R>
,AttributeWriteSelections<R>
,AttributeWriteShowRowNumbers
,AttributeWriteText
,AttributeWriteTooltip
,AttributeWriteValidationFailure
,AttributeWriteValue<List<R>>
,AttributeWriteValueForUser<List<R>>
,AttributeWriteVisible
,UiAbstractDataTable<R>
,UiAbstractDataWidget<R>
,UiDataTable<R>
,UiActiveWidget
,UiNativeWidget
,UiRegularWidget
,UiWidget
,UiValidatableWidget<List<R>>
,UiValuedWidget<List<R>>
,UiNativeWidgetWrapper<Void>
public class TestDataList<R> extends TestActiveValidatableWidget<List<R>> implements UiDataTable<R>
Implementation ofUiDataTable
for JavaFx.- Since:
- 1.0.0
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface io.github.mmm.ui.api.widget.data.UiAbstractDataTable
UiAbstractDataTable.FilterHandler<R>
-
Nested classes/interfaces inherited from interface io.github.mmm.ui.api.widget.data.UiAbstractDataWidget
UiAbstractDataWidget.ColumnAdapter<D,C>
-
-
Field Summary
-
Fields inherited from class io.github.mmm.ui.test.widget.TestWidget
focussedWidget
-
Fields inherited from interface io.github.mmm.ui.api.attribute.AttributeWriteMultiSelection
STYLE_SELECTION
-
Fields inherited from interface io.github.mmm.ui.api.attribute.AttributeWriteShowRowNumbers
ROW_NUMBER_HEADER_TITLE, STYLE_ROW_NUMBER
-
Fields inherited from interface io.github.mmm.ui.api.attribute.AttributeWriteValidationFailure
STYLE_INVALID
-
Fields inherited from interface io.github.mmm.ui.api.widget.data.UiAbstractDataWidget
STYLE
-
Fields inherited from interface io.github.mmm.ui.api.widget.UiActiveWidget
ACCESS_KEY_NONE
-
Fields inherited from interface io.github.mmm.ui.api.widget.value.UiValidatableWidget
STYLE_MANDATORY
-
-
Constructor Summary
Constructors Constructor Description TestDataList()
The constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addColumn(UiColumn<R,?> column, int index)
<V> UiColumn<R,V>
createColumn(TypedPropertyPath<V> property)
<V> UiColumn<R,V>
createColumn(String title, UiAbstractDataWidget.ColumnAdapter<R,V> adapter)
UiColumn<R,?>
getColumn(int index)
int
getColumnCount()
R
getSelection()
List<R>
getSelections()
boolean
isMultiSelection()
boolean
isShowRowNumbers()
void
setFilterHandler(UiAbstractDataTable.FilterHandler<R> filterHandler)
void
setMultiSelection(boolean multiSelection)
void
setRowTemplate(R rowTemplate)
void
setSelection(R selection)
void
setSelections(Collection<R> selection)
void
setShowRowNumbers(boolean showRowNumbers)
void
sort(SortOrder order, UiColumn<R,?>... sortColumns)
-
Methods inherited from class io.github.mmm.ui.test.widget.TestActiveValidatableWidget
getModificationTimestamp, getOriginalValue, getValidator, getValueOrThrow, setMandatory, setOriginalValue, setValidator, setValue
-
Methods inherited from class io.github.mmm.ui.test.widget.TestActiveWidget
getAccessKey, isFocused, setAccessKey, setFocused
-
Methods inherited from class io.github.mmm.ui.test.widget.TestWidget
getText, getWidget, setEnabledNative, setIdNative, setReadOnlyNative, setText, setTooltipNative, setVisibleNative
-
Methods inherited from class io.github.mmm.ui.spi.widget.AbstractUiNativeWidgetWrapper
createDefaultStyles, createStyles, getId, getStyles, getTooltip, onStylesChanged, setId, setTooltip
-
Methods inherited from class io.github.mmm.ui.spi.widget.AbstractUiNativeWidget
addListener, dispose, doDispose, doGetEnabledState, doGetVisibleState, doSetEnabledState, doSetEnabledState, doSetValidationFailure, doSetVisibleState, doSetVisibleState, ensureHandlers, fireEvent, getEventAdapter, getParent, getProgrammaticEventType, getReadOnlyFixed, getValidationFailure, hasListeners, isDisposed, isEnabled, isInitiallyVisible, isReadOnly, isValid, isVisible, isVisibleWithoutRoot, registerHandlers, removeListener, requireNotDisposed, setEnabled, setParent, setProgrammaticEventType, setReadOnly, setReadOnlyFixed, setValidationFailure, setVisible, unwrap, validateDown
-
Methods inherited from class io.github.mmm.ui.api.widget.AbstractUiWidget
isEmpty, setParent, unwrap
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.github.mmm.ui.api.attribute.AttributeReadId
getId
-
Methods inherited from interface io.github.mmm.ui.api.attribute.AttributeWriteId
setId
-
Methods inherited from interface io.github.mmm.ui.api.attribute.AttributeWriteSelections
addSelection, addSelections
-
Methods inherited from interface io.github.mmm.ui.api.attribute.AttributeWriteTooltip
getTooltip, setTooltip
-
Methods inherited from interface io.github.mmm.ui.api.attribute.AttributeWriteValidationFailure
getValidationFailure, setValidationFailure, setValidationFailure
-
Methods inherited from interface io.github.mmm.event.EventSource
addListener, addListener, addWeakListener, removeListener
-
Methods inherited from interface io.github.mmm.ui.api.widget.data.UiAbstractDataTable
addColumn, addColumn, addColumn, addColumns
-
Methods inherited from interface io.github.mmm.ui.spi.widget.UiNativeWidgetWrapper
getTopWidget
-
Methods inherited from interface io.github.mmm.ui.api.widget.value.UiValidatableWidget
getOriginalValue, getValidator, getValue, getValueOrThrow, isValid, reset, setOriginalValue, setValidator, setValue, setValue, setValueForUser
-
Methods inherited from interface io.github.mmm.ui.api.widget.UiWidget
cast, dispose, getModificationTimestamp, getParent, getReadOnlyFixed, getStyles, isDisposed, isEnabled, isEnabled, isFocused, isModified, isReadOnly, isVisible, isVisible, setEnabled, setEnabled, setFocused, setReadOnly, setReadOnlyFixed, setVisible, setVisible, validate, validate, validate, validateDown, validateUp
-
-
-
-
Method Detail
-
setRowTemplate
public void setRowTemplate(R rowTemplate)
- Specified by:
setRowTemplate
in interfaceUiAbstractDataWidget<R>
- Parameters:
rowTemplate
- the template instance of a row.
-
createColumn
public <V> UiColumn<R,V> createColumn(TypedPropertyPath<V> property)
- Specified by:
createColumn
in interfaceUiAbstractDataTable<R>
- Type Parameters:
V
- type of the cell values of theUiColumn
.- Parameters:
property
- theproperty
of the row data.- Returns:
- the new
UiColumn
.
-
createColumn
public <V> UiColumn<R,V> createColumn(String title, UiAbstractDataWidget.ColumnAdapter<R,V> adapter)
- Specified by:
createColumn
in interfaceUiAbstractDataTable<R>
- Type Parameters:
V
- type of the cell values of theUiColumn
.- Parameters:
title
- thecolumn header title
.adapter
- theUiAbstractDataWidget.ColumnAdapter
giving access to read (and write) the column cell values from the data model.- Returns:
- the new
UiColumn
.
-
getColumnCount
public int getColumnCount()
- Specified by:
getColumnCount
in interfaceUiAbstractDataTable<R>
- Returns:
- the number of
columns
of this data widget. - See Also:
List.size()
-
getColumn
public UiColumn<R,?> getColumn(int index)
- Specified by:
getColumn
in interfaceUiAbstractDataTable<R>
- Parameters:
index
- is the index of the requestedUiColumn
. The index corresponds to the index when theUiColumn
has beenadded
. Reordering or hiding columns in the UI has no effect on the index. The value has to be in the range from0
to
.UiAbstractDataTable.getColumnCount()
- 1- Returns:
- the requested
column
. - See Also:
List.get(int)
-
addColumn
public void addColumn(UiColumn<R,?> column, int index)
- Specified by:
addColumn
in interfaceUiAbstractDataTable<R>
- Parameters:
column
- theUiColumn
to add. Has to becreated
by this data widget.index
- the index where to add the new column.
-
sort
public void sort(SortOrder order, UiColumn<R,?>... sortColumns)
Description copied from interface:UiAbstractDataTable
This method sorts the data with the givenSortOrder
according to the specifiedUiColumn
s. The sort priority is from the firstUiColumn
(primary sort) to the last (least significant sort). In case all values of the first column are unique additional columns will have no effect on sorting.- Specified by:
sort
in interfaceUiAbstractDataTable<R>
- Parameters:
order
- is theSortOrder
.sortColumns
- are the columns of this data-list to sort by.
-
setFilterHandler
public void setFilterHandler(UiAbstractDataTable.FilterHandler<R> filterHandler)
- Specified by:
setFilterHandler
in interfaceUiAbstractDataTable<R>
- Parameters:
filterHandler
- theUiAbstractDataTable.FilterHandler
to customize thefiltering
. Allows to override the filtering for individual columns or the entire table. Custom handling may trigger a server-side search and asynchronously update the data in the table.
-
isShowRowNumbers
public boolean isShowRowNumbers()
- Specified by:
isShowRowNumbers
in interfaceAttributeWriteShowRowNumbers
- Returns:
true
if line numbers should be shown (a first column is displayed showing a running number starting with1
for each line/row like in Execl),false
otherwise.
-
setShowRowNumbers
public void setShowRowNumbers(boolean showRowNumbers)
- Specified by:
setShowRowNumbers
in interfaceAttributeWriteShowRowNumbers
- Parameters:
showRowNumbers
- is the new value ofAttributeWriteShowRowNumbers.isShowRowNumbers()
.
-
getSelection
public R getSelection()
- Specified by:
getSelection
in interfaceAttributeReadSelection<R>
- Returns:
- the currently selected element. May be
null
if no element is selected. - See Also:
AttributeReadSelections.getSelections()
-
setSelection
public void setSelection(R selection)
- Specified by:
setSelection
in interfaceAttributeWriteSelection<R>
- Parameters:
selection
- is the new element to select.- See Also:
AttributeReadSelection.getSelection()
-
getSelections
public List<R> getSelections()
- Specified by:
getSelections
in interfaceAttributeReadSelections<R>
- Returns:
- the selected element(s). If nothing is selected, the
empty
List
is returned. For best UX a multi-selection is suggested to be managed by checkboxes in front of the elements that allow adding and removing them from the multi-selection. It can still be combined withsingle-selection
that highlights the element that has been clicked last. E.g. to remove or delete multiple elements from a list, the multi-selection can be used while the single-selection will be used to open the details of the last selected element in a master-details view or in a details popup.
-
setSelections
public void setSelections(Collection<R> selection)
- Specified by:
setSelections
in interfaceAttributeWriteSelections<R>
- Parameters:
selection
- is theCollection
of elements to select.- See Also:
AttributeReadSelections.getSelections()
-
isMultiSelection
public boolean isMultiSelection()
- Specified by:
isMultiSelection
in interfaceAttributeReadMultiSelection
- Returns:
true
to allowmulti-selection
,false
to allow onlysingle-selection
.
-
setMultiSelection
public void setMultiSelection(boolean multiSelection)
- Specified by:
setMultiSelection
in interfaceAttributeWriteMultiSelection
- Parameters:
multiSelection
- the new value ofAttributeReadMultiSelection.isMultiSelection()
. Should be set once after creation of this widget. Changing selection mode dynamically after attaching this widget and making it visible may not be supported on all platforms.- See Also:
AttributeReadMultiSelection.isMultiSelection()
-
-