ADAPTER
- is the generic type of AbstractUiWidgetNative.getWidgetAdapter()
.ROW
- is the generic type of the element representing a row of the grid. It should be a java-bean
oriented object. Immutable objects (that have no setters) can also be used but only for read-only
tables.CELL
- is the generic type of the values located in the cells of this column.public abstract class AbstractUiWidgetTableColumn<ADAPTER extends UiWidgetAdapterTableColumn,ROW,CELL> extends AbstractUiWidgetNative<ADAPTER,CELL> implements UiWidgetTableColumn<ROW,CELL>
UiWidgetTableColumn
.AbstractUiWidgetNative.SizeImpl
AbstractUiWidget.AccessHelper, AbstractUiWidget.EventSender, AbstractUiWidget.HandlerContainer
Modifier and Type | Field and Description |
---|---|
private boolean |
attached |
private int |
currentIndex |
private AbstractUiWidgetAbstractDataTable<?,?,ROW,?> |
dataTable |
private static int |
DEFAULT_WIDTH
The initial default width of a column in pixel.
|
private boolean |
editable |
static TypedProperty<Integer> |
PROPERTY_ROW_NUMBER
The virtual property for multi-selection.
|
static TypedProperty<Boolean> |
PROPERTY_SELECTED
The virtual property for multi-selection.
|
private PropertyAccessor<ROW,CELL> |
propertyAccessor |
private boolean |
reorderable |
private boolean |
resizable |
private boolean |
sortable |
private Comparator<CELL> |
sortComparator |
private SortOrder |
sortOrder |
private String |
title |
private TypedProperty<CELL> |
typedProperty |
private UiSingleWidgetFactory<? extends UiWidgetWithValue<CELL>> |
widgetFactory |
STYLE_HEADER
HTML_ATTRIBUTE_ID, ID_SEPARATOR, PROPERTY_ID
PROPERTY_STYLES, STYLE_PATTERN_MULTIPLE, STYLE_PATTERN_SINGLE
WAI_ARIA
PROPERTY_TITLE
Constructor and Description |
---|
AbstractUiWidgetTableColumn(UiContext context,
AbstractUiWidgetAbstractDataTable<?,?,ROW,?> listTable,
TypedProperty<CELL> typedProperty,
ADAPTER widgetAdapter)
The constructor.
|
Modifier and Type | Method and Description |
---|---|
int |
getCurrentIndex() |
AbstractUiWidgetAbstractDataTable<?,?,ROW,?> |
getDataTable() |
PropertyAccessor<ROW,CELL> |
getPropertyAccessor() |
Comparator<CELL> |
getSortComparator()
This method gets the
Comparator used to compare and
sort the values. |
SortOrder |
getSortOrder() |
String |
getTitle()
This method gets the title of this object.
|
TypedProperty<CELL> |
getTypedProperty() |
UiSingleWidgetFactory<? extends UiWidgetWithValue<CELL>> |
getWidgetFactory() |
protected void |
initializeWidgetAdapter(ADAPTER adapter)
This method is called from
AbstractUiWidgetNative.getWidgetAdapter() to initialize the UiWidgetAdapter . |
(package private) boolean |
isAttached() |
boolean |
isEditable()
This method gets the editable status of this object.
|
boolean |
isReorderable()
This method determines if this object can be reordered.
|
boolean |
isResizable()
This method determines if this object is resizable.
|
boolean |
isSortable()
This method determines if this object can be sorted.
|
(package private) void |
setAttached(boolean attached) |
void |
setCurrentIndex(int currentIndex) |
void |
setEditable(boolean editableFlag)
This method set the
editable status. |
(package private) void |
setPropertyAccessor(PropertyAccessor<ROW,CELL> propertyAccessor) |
void |
setReorderable(boolean reorderable)
This method sets the
reorderable attribute. |
void |
setResizable(boolean resizable)
This method sets the
resizable attribute. |
void |
setSortable(boolean sortable)
This method sets the
sortable attribute. |
void |
setSortComparator(Comparator<CELL> sortComparator)
This method sets the
sort-comparator attribute. |
void |
setSortOrder(SortOrder order) |
void |
setTitle(String title)
This method sets the title of this object.
|
(package private) void |
setWidgetFactory(UiSingleWidgetFactory<? extends UiWidgetWithValue<CELL>> widgetFactory) |
void |
sort()
Like
UiWidgetTableColumn.sort(SortOrder) but will toggle the SortOrder state of this column. |
void |
sort(SortOrder order)
This method sorts the
table-data according to this column using the sort-comparator and the given
order . |
addChangeHandler, 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, setFocused, setId, setIdPrefix, setMode, setMode, setModeFixed, setParent, setPrimaryStyle, setStyles, setTooltip, setVisible, setVisible, toString, visibilityChanged
addEventHandler, 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, setValue
addValidatorMandatory, createValidationFailure, getValue, getValueAndValidate, handleGetValueError, resetValue, setValue, setValueForUser, validate
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
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
addValidator, removeValidator
resetValue, setValue, setValueForUser
getValue
private static final int DEFAULT_WIDTH
public static final TypedProperty<Boolean> PROPERTY_SELECTED
public static final TypedProperty<Integer> PROPERTY_ROW_NUMBER
private final AbstractUiWidgetAbstractDataTable<?,?,ROW,?> dataTable
getDataTable()
private final TypedProperty<CELL> typedProperty
getTypedProperty()
private PropertyAccessor<ROW,CELL> propertyAccessor
setPropertyAccessor(PropertyAccessor)
private Comparator<CELL> sortComparator
getSortComparator()
private String title
getTitle()
private boolean reorderable
isReorderable()
private boolean editable
isEditable()
private boolean resizable
isResizable()
private boolean sortable
isSortable()
private UiSingleWidgetFactory<? extends UiWidgetWithValue<CELL>> widgetFactory
getWidgetFactory()
private SortOrder sortOrder
getSortOrder()
private boolean attached
isAttached()
private int currentIndex
getCurrentIndex()
public AbstractUiWidgetTableColumn(UiContext context, AbstractUiWidgetAbstractDataTable<?,?,ROW,?> listTable, TypedProperty<CELL> typedProperty, ADAPTER widgetAdapter)
context
- is the context
.listTable
- is the list table
this column is connected to.typedProperty
- is the typed property
of the column to create. May be
null
.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 AbstractUiWidgetNative<ADAPTER extends UiWidgetAdapterTableColumn,CELL>
adapter
- is the UiWidgetAdapter
to initialize.public TypedProperty<CELL> getTypedProperty()
TypedProperty
identifying the property managed with this column. May be
null
if the column was created with an explicit property accessor
. In such case the widget factory
shall not be
null
or cells with null
values can not be handled.public PropertyAccessor<ROW,CELL> getPropertyAccessor()
PropertyAccessor
.void setPropertyAccessor(PropertyAccessor<ROW,CELL> propertyAccessor)
propertyAccessor
- is the propertyAccessor to setpublic UiSingleWidgetFactory<? extends UiWidgetWithValue<CELL>> getWidgetFactory()
UiSingleWidgetFactory
used to create widgets
to view (and
potentially edit) the values of a cell in this column.UiWidgetAbstractDataTable.createColumn(PropertyAccessor,
UiSingleWidgetFactory, Comparator)
void setWidgetFactory(UiSingleWidgetFactory<? extends UiWidgetWithValue<CELL>> widgetFactory)
widgetFactory
- is the new widget factory
.boolean isAttached()
void setAttached(boolean attached)
attached
- is the attached to setpublic String getTitle()
getTitle
in interface AttributeReadStringTitle
getTitle
in interface AttributeReadTitle<String>
public void setTitle(String title)
setTitle
in interface AttributeWriteStringTitle
setTitle
in interface AttributeWriteTitle<String>
title
- is the new title.AttributeReadStringTitle.getTitle()
public boolean isReorderable()
isReorderable
in interface AttributeReadReorderable
true
if the object can be reordered (by the end-user) - typically via drag and drop,
false
otherwise.public void setReorderable(boolean reorderable)
reorderable
attribute.setReorderable
in interface AttributeWriteReorderable
reorderable
- is the new value of AttributeReadReorderable.isReorderable()
.public boolean isEditable()
edit mode
(e.g. a data table that allows inline editing). If the editable
feature is turned
off, the user can no longer edit the data. AttributeReadEnabled.isEnabled()
. However turning off the
editable-flag
is weaker than disabling
a UI object. An enabled
but NOT editable
object may still allow user-interaction (e.g. a combobox that still allows selection out of a
predefined list but no editing of the text). Further the visualization is softer (no grey out of the
entire object). mode
or enabled flag
. This
method only returns the editable flag (as set via AttributeWriteEditable.setEditable(boolean)
)
and therefore only tells if the object is potentially editable.isEditable
in interface AttributeReadEditable
true
if this object is editable, false
otherwise.public void setEditable(boolean editableFlag)
editable
status.setEditable
in interface AttributeWriteEditable
editableFlag
- if true
the object will become editable, if false
the
object will become un-editable.public boolean isResizable()
isResizable
in interface AttributeReadResizable
true
if the object can be
resized
(by the end-user), false
otherwise.public void setResizable(boolean resizable)
resizable
attribute.setResizable
in interface AttributeWriteResizable
resizable
- is the new value of AttributeReadResizable.isResizable()
.public void setSortComparator(Comparator<CELL> sortComparator)
sort-comparator
attribute. If <VALUE>
implements Comparable
you may simple provide
ComparableComparator.getInstance()
as argument (unless a more specific
sorting is required here).setSortComparator
in interface AttributeWriteSortComparator<CELL>
sortComparator
- is the new value of AttributeReadSortComparator.getSortComparator()
. May be null
to
disable sorting.public Comparator<CELL> getSortComparator()
Comparator
used to compare
and
sort the values.getSortComparator
in interface AttributeReadSortComparator<CELL>
Comparator
used to sort the values. May be null
if NOT set what will
prevent sorting.public boolean isSortable()
isSortable
in interface AttributeReadSortable
isSortable
in interface UiWidgetTableColumn<ROW,CELL>
true
if a sort comparator
is
set
and this column allows sorting
, false
otherwise (if AttributeReadSortComparator.getSortComparator()
is null
).public void setSortable(boolean sortable)
sortable
attribute.setSortable
in interface AttributeWriteSortable
sortable
- is the new value of AttributeReadSortable.isSortable()
.public void sort()
UiWidgetTableColumn.sort(SortOrder)
but will toggle the SortOrder
state of this column.sort
in interface UiWidgetTableColumn<ROW,CELL>
public void sort(SortOrder order)
table-data
according to this column using the sort-comparator
and the given
order
.sort
in interface UiWidgetTableColumn<ROW,CELL>
order
- is the SortOrder
.public SortOrder getSortOrder()
SortOrder
of this column. May be null
for no order.public void setSortOrder(SortOrder order)
order
- is the new SortOrder
. May be null
to remove order.public AbstractUiWidgetAbstractDataTable<?,?,ROW,?> getDataTable()
list table
owning this column.public int getCurrentIndex()
reordering
or internal technical columns (e.g. row-numbers or
checkboxes for multi-selection).public void setCurrentIndex(int currentIndex)
currentIndex
- is the new value of getCurrentIndex()
.Copyright © 2001–2016 mmm-Team. All rights reserved.