Package io.jmix.ui.component.impl
Class AbstractTable.ColumnImpl<E>
java.lang.Object
io.jmix.ui.component.impl.AbstractTable.ColumnImpl<E>
- All Implemented Interfaces:
Component.HasCaption
,Component.HasDescription
,Component.HasXmlDescriptor
,HasFormatter
,HasHtmlCaption
,Table.Column<E>
- Direct Known Subclasses:
GroupTableImpl.GroupColumnImpl
- Enclosing class:
- AbstractTable<T extends com.vaadin.v7.ui.Table & JmixEnhancedTable,
E>
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.jmix.ui.component.Table.Column
Table.Column.ClickEvent<E>
-
Field Summary
Modifier and TypeFieldDescriptionprotected AggregationInfo
protected Table.ColumnAlignment
protected String
protected boolean
protected boolean
protected String
protected boolean
protected org.dom4j.Element
protected EventHub
protected float
protected Formatter
protected final Object
protected Integer
protected AbstractTable<?,
E> protected boolean
protected String
protected Integer
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddClickListener
(Consumer<Table.Column.ClickEvent<E>> listener) Adds a click listener for column.boolean
protected EventHub
float
getId()
Returns a column identifier.getOwner()
Returns a column identifier as aString
.getWidth()
Returns default column width.org.dom4j.Element
int
hashCode()
boolean
When the aggregation is editable in conjunction with using theTable.setAggregationDistributionProvider(AggregationDistributionProvider)
method, this allows users to implement algorithms for distributing data between table rows.boolean
boolean
boolean
Returns whether editing is allowed for the corresponding column in the table.boolean
Returns whether the user can sort the data by this column.protected void
protected void
removeClickListener
(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
(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
(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
(Integer maxTextLength) Limits the number of characters in a cell.void
void
setSortable
(boolean sortable) Sets whether this column is sortable by the user.void
setValueDescription
(String valueDescription) Defines a hint which is displayed in a popup when a user hovers the mouse cursor on the aggregated value.void
setValueProvider
(Function<E, Object> valueProvider) Sets value provider for the column.void
Sets default column width.void
setXmlDescriptor
(org.dom4j.Element element) toString()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface io.jmix.ui.component.Table.Column
setColumnGenerator
-
Field Details
-
id
-
description
-
valueDescription
-
editable
protected boolean editable -
alignment
-
width
-
collapsed
protected boolean collapsed -
sortable
protected boolean sortable -
aggregation
-
maxTextLength
-
expandRatio
protected float expandRatio -
formatter
-
valueProvider
-
element
protected org.dom4j.Element element -
eventHub
-
owner
-
-
Constructor Details
-
ColumnImpl
-
-
Method Details
-
getId
Description copied from interface:Table.Column
Returns a column identifier. It could be aString
or an instance ofMetaPropertyPath
.- Specified by:
getId
in interfaceTable.Column<E>
- Returns:
- id of a column
-
getStringId
Description copied from interface:Table.Column
Returns a column identifier as aString
. If the id is an instance ofMetaPropertyPath
, then theMetaPropertyPath.toPathString()
will be returned.- Specified by:
getStringId
in interfaceTable.Column<E>
- Returns:
- a column identifier as a string
-
getMetaPropertyPath
- Specified by:
getMetaPropertyPath
in interfaceTable.Column<E>
- Returns:
- the instance of
MetaPropertyPath
representing a relative path to a property from certain MetaClass or null
-
getMetaPropertyPathNN
- Specified by:
getMetaPropertyPathNN
in interfaceTable.Column<E>
- Returns:
- the instance of
MetaPropertyPath
representing a relative path to a property from certain MetaClass
-
getOwner
- Specified by:
getOwner
in interfaceTable.Column<E>
- Returns:
- the Table this column belongs to
-
setOwner
- Specified by:
setOwner
in interfaceTable.Column<E>
- Parameters:
owner
- the Table this column belongs to
-
getCaption
- Specified by:
getCaption
in interfaceComponent.HasCaption
- Returns:
- the caption of the component
-
setCaption
Description copied from interface:Component.HasCaption
Sets the component's caption.- Specified by:
setCaption
in interfaceComponent.HasCaption
- Parameters:
caption
- the new component's caption
-
isCaptionAsHtml
public boolean isCaptionAsHtml()- Specified by:
isCaptionAsHtml
in interfaceHasHtmlCaption
- Returns:
true
if the caption is rendered as HTML,false
if rendered as plain text
-
setCaptionAsHtml
public void setCaptionAsHtml(boolean captionAsHtml) Description copied from interface:HasHtmlCaption
Sets whether the caption is rendered as HTML.- Specified by:
setCaptionAsHtml
in interfaceHasHtmlCaption
- Parameters:
captionAsHtml
-true
if the caption is rendered as HTML,false
if rendered as plain text- See Also:
-
getDescription
- Specified by:
getDescription
in interfaceComponent.HasDescription
- Returns:
- the components description, used in tooltips
-
setDescription
Description copied from interface:Component.HasDescription
Sets the component's description.- Specified by:
setDescription
in interfaceComponent.HasDescription
- Parameters:
description
- the new description to set
-
getXmlDescriptor
@Nullable public org.dom4j.Element getXmlDescriptor()- Specified by:
getXmlDescriptor
in interfaceComponent.HasXmlDescriptor
-
setXmlDescriptor
public void setXmlDescriptor(@Nullable org.dom4j.Element element) - Specified by:
setXmlDescriptor
in interfaceComponent.HasXmlDescriptor
-
getFormatter
- Specified by:
getFormatter
in interfaceHasFormatter<E>
-
setFormatter
- Specified by:
setFormatter
in interfaceHasFormatter<E>
-
getValueProvider
- Specified by:
getValueProvider
in interfaceTable.Column<E>
- Returns:
- a value provider or null
-
setValueProvider
Description copied from interface:Table.Column
Sets value provider for the column. Value provider can be called 0 or more times depending on visibility of a cell and value type. Return type must be the same as type of the column.- Specified by:
setValueProvider
in interfaceTable.Column<E>
- Parameters:
valueProvider
- a callback interface for providing column values from a given source
-
getValueDescription
- Specified by:
getValueDescription
in interfaceTable.Column<E>
- Returns:
- a hint which is displayed in a popup when a user hovers the mouse cursor on the aggregated value
-
setValueDescription
Description copied from interface:Table.Column
Defines a hint which is displayed in a popup when a user hovers the mouse cursor on the aggregated value. For the operations listed above (SUM, AVG, COUNT, MIN, MAX), popup hints are already available by default.- Specified by:
setValueDescription
in interfaceTable.Column<E>
- Parameters:
valueDescription
- a hint- See Also:
-
isEditable
public boolean isEditable()Description copied from interface:Table.Column
Returns whether editing is allowed for the corresponding column in the table.- Specified by:
isEditable
in interfaceTable.Column<E>
- Returns:
- whether editing is allowed for the corresponding column in the table
-
setEditable
public void setEditable(boolean editable) Description copied from interface:Table.Column
Sets whether editing is allowed for the corresponding column in the table. NOTE: changing this property at runtime is not supported.- Specified by:
setEditable
in interfaceTable.Column<E>
- Parameters:
editable
- whether editing is allowed for the corresponding column in the table
-
getAlignment
- Specified by:
getAlignment
in interfaceTable.Column<E>
- Returns:
- a text alignment of column cells
-
setAlignment
Description copied from interface:Table.Column
Sets a text alignment of column cells. The default alignment isTable.ColumnAlignment.LEFT
.- Specified by:
setAlignment
in interfaceTable.Column<E>
- Parameters:
alignment
- a text alignment of column cells
-
getWidth
Description copied from interface:Table.Column
Returns default column width. May contain only numeric values in pixels.- Specified by:
getWidth
in interfaceTable.Column<E>
- Returns:
- default column width
-
setWidth
Description copied from interface:Table.Column
Sets default column width. May contain only numeric values in pixels.- Specified by:
setWidth
in interfaceTable.Column<E>
- Parameters:
width
- default column width
-
isCollapsed
public boolean isCollapsed()- Specified by:
isCollapsed
in interfaceTable.Column<E>
- Returns:
true
if the column is currently hidden,false
otherwise
-
setCollapsed
public void setCollapsed(boolean collapsed) Description copied from interface:Table.Column
Hides or shows the column. By default columns are visible before explicitly hiding them.- Specified by:
setCollapsed
in interfaceTable.Column<E>
- Parameters:
collapsed
-true
to hide the column,false
to show
-
isSortable
public boolean isSortable()Description copied from interface:Table.Column
Returns whether the user can sort the data by this column.- Specified by:
isSortable
in interfaceTable.Column<E>
- Returns:
true
if the column is sortable by the user,false
otherwise
-
setSortable
public void setSortable(boolean sortable) Description copied from interface:Table.Column
Sets whether this column is sortable by the user. The Table can be sorted by a sortable column by clicking or tapping the column's default header.- Specified by:
setSortable
in interfaceTable.Column<E>
- Parameters:
sortable
-true
if the user should be able to sort the column,false
otherwise- See Also:
-
getMaxTextLength
- Specified by:
getMaxTextLength
in interfaceTable.Column<E>
- Returns:
- the maximum number of characters in a cell
-
setMaxTextLength
Description copied from interface:Table.Column
Limits the number of characters in a cell. If the difference between the actual and the maximum allowed number of characters does not exceed the 10 character threshold, the extra characters remain unhidden. To see the entire record, users need to click on its visible part.- Specified by:
setMaxTextLength
in interfaceTable.Column<E>
- Parameters:
maxTextLength
- the maximum number of characters in a cell- See Also:
-
getAggregation
- Specified by:
getAggregation
in interfaceTable.Column<E>
- Returns:
- an aggregation info
-
setAggregation
Description copied from interface:Table.Column
Sets an aggregation info in order to perform aggregation for this column.- Specified by:
setAggregation
in interfaceTable.Column<E>
- Parameters:
aggregation
- aggregation info
-
isAggregationEditable
public boolean isAggregationEditable()Description copied from interface:Table.Column
When the aggregation is editable in conjunction with using theTable.setAggregationDistributionProvider(AggregationDistributionProvider)
method, this allows users to implement algorithms for distributing data between table rows.- Specified by:
isAggregationEditable
in interfaceTable.Column<E>
- Returns:
- whether aggregation info is editable
-
setExpandRatio
public void setExpandRatio(float ratio) Description copied from interface:Table.Column
Sets the ratio with which the column expands. The default value is -1.By default (without expand ratios) the excess space is divided proportionally to columns natural widths.
- Specified by:
setExpandRatio
in interfaceTable.Column<E>
- Parameters:
ratio
- the expand ratio of this column.0
to not have it expand at all. A negative number to clear the expand value.
-
getExpandRatio
public float getExpandRatio()- Specified by:
getExpandRatio
in interfaceTable.Column<E>
- Returns:
- the ratio with which the column expands
-
addClickListener
Description copied from interface:Table.Column
Adds a click listener for column.- Specified by:
addClickListener
in interfaceTable.Column<E>
- Parameters:
listener
- a listener to add- Returns:
- a registration object for removing an event listener
-
equals
-
hashCode
public int hashCode() -
toString
-
onClick
-
removeClickListener
-
getEventHub
- Returns:
- the EventHub for the column
-