E - row item typepublic static interface Table.Column<E> extends Component.HasXmlDescriptor, HasHtmlCaption, HasFormatter
Use Table.addColumn(Object) and Table.addColumn(Object, int) methods to create
and add column to the Table.
| Modifier and Type | Interface and Description |
|---|---|
static class |
Table.Column.ClickEvent<E>
An event is fired when the user clicks inside the table cell that belongs to the current column.
|
| Modifier and Type | Method and Description |
|---|---|
io.jmix.core.common.event.Subscription |
addClickListener(java.util.function.Consumer<Table.Column.ClickEvent<E>> listener)
Adds a click listener for column.
|
AggregationInfo |
getAggregation() |
Table.ColumnAlignment |
getAlignment() |
float |
getExpandRatio() |
java.lang.Object |
getId()
Returns a column identifier.
|
java.lang.Integer |
getMaxTextLength() |
io.jmix.core.metamodel.model.MetaPropertyPath |
getMetaPropertyPath() |
io.jmix.core.metamodel.model.MetaPropertyPath |
getMetaPropertyPathNN() |
Table<E> |
getOwner() |
java.lang.String |
getStringId()
Returns a column identifier as a
String. |
java.lang.String |
getValueDescription() |
java.util.function.Function<E,java.lang.Object> |
getValueProvider() |
java.lang.Integer |
getWidth()
Returns default column width.
|
boolean |
isAggregationEditable()
When the aggregation is editable in conjunction with using
the
Table.setAggregationDistributionProvider(AggregationDistributionProvider) method,
this allows users to implement algorithms for distributing data between table rows. |
boolean |
isCollapsed() |
boolean |
isEditable()
Returns whether editing is allowed for the corresponding column in the table.
|
boolean |
isSortable()
Returns whether the user can sort the data by this column.
|
void |
setAggregation(AggregationInfo aggregation)
Sets an aggregation info in order to perform aggregation for this column.
|
void |
setAlignment(Table.ColumnAlignment alignment)
Sets a text alignment of column cells.
|
void |
setCollapsed(boolean collapsed)
Hides or shows the column.
|
default void |
setColumnGenerator(java.util.function.Function<E,Component> columnGenerator)
INTERNAL
|
void |
setEditable(boolean editable)
Sets whether editing is allowed for the corresponding column in the table.
|
void |
setExpandRatio(float ratio)
Sets the ratio with which the column expands.
|
void |
setMaxTextLength(java.lang.Integer maxTextLength)
Limits the number of characters in a cell.
|
void |
setOwner(Table<E> owner) |
void |
setSortable(boolean sortable)
Sets whether this column is sortable by the user.
|
void |
setValueDescription(java.lang.String valueDescription)
Defines a hint which is displayed in a popup when a user hovers the mouse cursor on the aggregated value.
|
void |
setValueProvider(java.util.function.Function<E,java.lang.Object> valueProvider)
Sets value provider for the column.
|
void |
setWidth(java.lang.Integer width)
Sets default column width.
|
getXmlDescriptor, setXmlDescriptorisCaptionAsHtml, setCaptionAsHtmlgetCaption, setCaptiongetDescription, setDescriptiongetFormatter, setFormatterjava.lang.Object getId()
String or an instance of MetaPropertyPath.java.lang.String getStringId()
String. If the id is an instance of MetaPropertyPath,
then the MetaPropertyPath.toPathString() will be returned.@Nullable io.jmix.core.metamodel.model.MetaPropertyPath getMetaPropertyPath()
MetaPropertyPath representing a relative path
to a property from certain MetaClass or nullio.jmix.core.metamodel.model.MetaPropertyPath getMetaPropertyPathNN()
MetaPropertyPath representing a relative path
to a property from certain MetaClassvoid setOwner(@Nullable
Table<E> owner)
owner - the Table this column belongs todefault void setColumnGenerator(java.util.function.Function<E,Component> columnGenerator)
Intended to install declarative columnGenerator instance.
columnGenerator - column generator instance@Nullable java.util.function.Function<E,java.lang.Object> getValueProvider()
void setValueProvider(@Nullable
java.util.function.Function<E,java.lang.Object> valueProvider)
valueProvider - a callback interface for providing column values from a given source@Nullable java.lang.String getValueDescription()
void setValueDescription(@Nullable
java.lang.String valueDescription)
valueDescription - a hintAggregationContainer.Typeboolean isEditable()
@StudioProperty(defaultValue="false") void setEditable(boolean editable)
editable - whether editing is allowed for the corresponding column in the table@Nullable Table.ColumnAlignment getAlignment()
@StudioProperty(name="align", type=ENUMERATION, defaultValue="LEFT", options={"LEFT","CENTER","RIGHT"}) void setAlignment(@Nullable Table.ColumnAlignment alignment)
Table.ColumnAlignment.LEFT.alignment - a text alignment of column cells@Nullable java.lang.Integer getWidth()
@StudioProperty(defaultValue="0") @PositiveOrZero void setWidth(@Nullable java.lang.Integer width)
width - default column widthboolean isCollapsed()
true if the column is currently hidden, false otherwise@StudioProperty(defaultValue="false") void setCollapsed(boolean collapsed)
collapsed - true to hide the column, false to showboolean isSortable()
true if the column is sortable by the user, false otherwise@StudioProperty(defaultValue="true") void setSortable(boolean sortable)
sortable - true if the user should be able to sort the
column, false otherwiseTable.setSortable(boolean)@Nullable java.lang.Integer getMaxTextLength()
@StudioProperty(defaultValue="0") void setMaxTextLength(@Nullable java.lang.Integer maxTextLength)
maxTextLength - the maximum number of characters in a cellAbbreviatedCellClickListener@Nullable AggregationInfo getAggregation()
void setAggregation(@Nullable
AggregationInfo aggregation)
aggregation - aggregation infoboolean isAggregationEditable()
Table.setAggregationDistributionProvider(AggregationDistributionProvider) method,
this allows users to implement algorithms for distributing data between table rows.@StudioProperty(name="expandRatio", defaultValue="-1.0") void setExpandRatio(float ratio)
By default (without expand ratios) the excess space is divided proportionally to columns natural widths.
ratio - the expand ratio of this column. 0 to not have it
expand at all. A negative number to clear the expand
value.float getExpandRatio()
io.jmix.core.common.event.Subscription addClickListener(java.util.function.Consumer<Table.Column.ClickEvent<E>> listener)
listener - a listener to add