public static class AbstractTable.ColumnImpl<E> extends java.lang.Object implements Table.Column<E>
Table.Column.ClickEvent<E>
Modifier and Type | Field and Description |
---|---|
protected AggregationInfo |
aggregation |
protected Table.ColumnAlignment |
alignment |
protected java.lang.String |
caption |
protected boolean |
captionAsHtml |
protected boolean |
collapsed |
protected java.lang.String |
description |
protected boolean |
editable |
protected org.dom4j.Element |
element |
protected io.jmix.core.common.event.EventHub |
eventHub |
protected float |
expandRatio |
protected Formatter |
formatter |
protected java.lang.Object |
id |
protected java.lang.Integer |
maxTextLength |
protected AbstractTable<?,E> |
owner |
protected boolean |
sortable |
protected java.lang.String |
valueDescription |
protected java.util.function.Function<E,java.lang.Object> |
valueProvider |
protected java.lang.Integer |
width |
Constructor and Description |
---|
ColumnImpl(java.lang.Object id,
AbstractTable<?,E> owner) |
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.
|
boolean |
equals(java.lang.Object obj) |
AggregationInfo |
getAggregation() |
Table.ColumnAlignment |
getAlignment() |
java.lang.String |
getCaption() |
java.lang.String |
getDescription() |
protected io.jmix.core.common.event.EventHub |
getEventHub() |
float |
getExpandRatio() |
Formatter |
getFormatter() |
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.
|
org.dom4j.Element |
getXmlDescriptor() |
int |
hashCode() |
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 |
isCaptionAsHtml() |
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.
|
protected void |
onClick(JmixEnhancedTable.TableCellClickEvent event) |
protected void |
removeClickListener(java.util.function.Consumer<Table.Column.ClickEvent<E>> listener) |
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 |
setCaption(java.lang.String caption)
Sets the component's caption.
|
void |
setCaptionAsHtml(boolean captionAsHtml)
Sets whether the caption is rendered as HTML.
|
void |
setCollapsed(boolean collapsed)
Hides or shows the column.
|
void |
setDescription(java.lang.String description)
Sets the component's description.
|
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 |
setFormatter(Formatter formatter) |
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.
|
void |
setXmlDescriptor(org.dom4j.Element element) |
java.lang.String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
setColumnGenerator
protected final java.lang.Object id
protected java.lang.String caption
protected boolean captionAsHtml
protected java.lang.String description
protected java.lang.String valueDescription
protected boolean editable
protected Table.ColumnAlignment alignment
protected java.lang.Integer width
protected boolean collapsed
protected boolean sortable
protected AggregationInfo aggregation
protected java.lang.Integer maxTextLength
protected float expandRatio
protected Formatter formatter
protected java.util.function.Function<E,java.lang.Object> valueProvider
protected org.dom4j.Element element
protected io.jmix.core.common.event.EventHub eventHub
protected AbstractTable<?,E> owner
public ColumnImpl(java.lang.Object id, @Nullable AbstractTable<?,E> owner)
public java.lang.Object getId()
Table.Column
String
or an instance of MetaPropertyPath
.getId
in interface Table.Column<E>
public java.lang.String getStringId()
Table.Column
String
. If the id is an instance of MetaPropertyPath
,
then the MetaPropertyPath.toPathString()
will be returned.getStringId
in interface Table.Column<E>
@Nullable public io.jmix.core.metamodel.model.MetaPropertyPath getMetaPropertyPath()
getMetaPropertyPath
in interface Table.Column<E>
MetaPropertyPath
representing a relative path
to a property from certain MetaClass or nullpublic io.jmix.core.metamodel.model.MetaPropertyPath getMetaPropertyPathNN()
getMetaPropertyPathNN
in interface Table.Column<E>
MetaPropertyPath
representing a relative path
to a property from certain MetaClass@Nullable public Table<E> getOwner()
getOwner
in interface Table.Column<E>
public void setOwner(@Nullable Table<E> owner)
setOwner
in interface Table.Column<E>
owner
- the Table this column belongs to@Nullable public java.lang.String getCaption()
getCaption
in interface Component.HasCaption
public void setCaption(@Nullable java.lang.String caption)
Component.HasCaption
setCaption
in interface Component.HasCaption
caption
- the new component's captionpublic boolean isCaptionAsHtml()
isCaptionAsHtml
in interface HasHtmlCaption
true
if the caption is rendered as HTML,
false
if rendered as plain textpublic void setCaptionAsHtml(boolean captionAsHtml)
HasHtmlCaption
setCaptionAsHtml
in interface HasHtmlCaption
captionAsHtml
- true
if the caption is rendered as HTML,
false
if rendered as plain textComponent.HasCaption.setCaption(String)
@Nullable public java.lang.String getDescription()
getDescription
in interface Component.HasDescription
public void setDescription(@Nullable java.lang.String description)
Component.HasDescription
setDescription
in interface Component.HasDescription
description
- the new description to set@Nullable public org.dom4j.Element getXmlDescriptor()
getXmlDescriptor
in interface Component.HasXmlDescriptor
public void setXmlDescriptor(@Nullable org.dom4j.Element element)
setXmlDescriptor
in interface Component.HasXmlDescriptor
@Nullable public Formatter getFormatter()
getFormatter
in interface HasFormatter
public void setFormatter(@Nullable Formatter formatter)
setFormatter
in interface HasFormatter
public java.util.function.Function<E,java.lang.Object> getValueProvider()
getValueProvider
in interface Table.Column<E>
public void setValueProvider(@Nullable java.util.function.Function<E,java.lang.Object> valueProvider)
Table.Column
setValueProvider
in interface Table.Column<E>
valueProvider
- a callback interface for providing column values from a given source@Nullable public java.lang.String getValueDescription()
getValueDescription
in interface Table.Column<E>
public void setValueDescription(@Nullable java.lang.String valueDescription)
Table.Column
setValueDescription
in interface Table.Column<E>
valueDescription
- a hintAggregationContainer.Type
public boolean isEditable()
Table.Column
isEditable
in interface Table.Column<E>
public void setEditable(boolean editable)
Table.Column
setEditable
in interface Table.Column<E>
editable
- whether editing is allowed for the corresponding column in the table@Nullable public Table.ColumnAlignment getAlignment()
getAlignment
in interface Table.Column<E>
public void setAlignment(@Nullable Table.ColumnAlignment alignment)
Table.Column
Table.ColumnAlignment.LEFT
.setAlignment
in interface Table.Column<E>
alignment
- a text alignment of column cells@Nullable public java.lang.Integer getWidth()
Table.Column
getWidth
in interface Table.Column<E>
public void setWidth(@Nullable java.lang.Integer width)
Table.Column
setWidth
in interface Table.Column<E>
width
- default column widthpublic boolean isCollapsed()
isCollapsed
in interface Table.Column<E>
true
if the column is currently hidden, false
otherwisepublic void setCollapsed(boolean collapsed)
Table.Column
setCollapsed
in interface Table.Column<E>
collapsed
- true
to hide the column, false
to showpublic boolean isSortable()
Table.Column
isSortable
in interface Table.Column<E>
true
if the column is sortable by the user, false
otherwisepublic void setSortable(boolean sortable)
Table.Column
setSortable
in interface Table.Column<E>
sortable
- true
if the user should be able to sort the
column, false
otherwiseTable.setSortable(boolean)
@Nullable public java.lang.Integer getMaxTextLength()
getMaxTextLength
in interface Table.Column<E>
public void setMaxTextLength(@Nullable java.lang.Integer maxTextLength)
Table.Column
setMaxTextLength
in interface Table.Column<E>
maxTextLength
- the maximum number of characters in a cellAbbreviatedCellClickListener
@Nullable public AggregationInfo getAggregation()
getAggregation
in interface Table.Column<E>
public void setAggregation(@Nullable AggregationInfo aggregation)
Table.Column
setAggregation
in interface Table.Column<E>
aggregation
- aggregation infopublic boolean isAggregationEditable()
Table.Column
Table.setAggregationDistributionProvider(AggregationDistributionProvider)
method,
this allows users to implement algorithms for distributing data between table rows.isAggregationEditable
in interface Table.Column<E>
public void setExpandRatio(float ratio)
Table.Column
By default (without expand ratios) the excess space is divided proportionally to columns natural widths.
setExpandRatio
in interface Table.Column<E>
ratio
- the expand ratio of this column. 0
to not have it
expand at all. A negative number to clear the expand
value.public float getExpandRatio()
getExpandRatio
in interface Table.Column<E>
public io.jmix.core.common.event.Subscription addClickListener(java.util.function.Consumer<Table.Column.ClickEvent<E>> listener)
Table.Column
addClickListener
in interface Table.Column<E>
listener
- a listener to addpublic boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
protected void onClick(JmixEnhancedTable.TableCellClickEvent event)
protected void removeClickListener(java.util.function.Consumer<Table.Column.ClickEvent<E>> listener)
protected io.jmix.core.common.event.EventHub getEventHub()