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
FieldsModifier and TypeFieldDescriptionprotected AggregationInfoprotected Table.ColumnAlignmentprotected Stringprotected booleanprotected booleanprotected Stringprotected booleanprotected org.dom4j.Elementprotected EventHubprotected floatprotected Formatterprotected final Objectprotected Integerprotected AbstractTable<?,E> protected booleanprotected Stringprotected Integer -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddClickListener(Consumer<Table.Column.ClickEvent<E>> listener) Adds a click listener for column.booleanprotected EventHubfloatgetId()Returns a column identifier.getOwner()Returns a column identifier as aString.getWidth()Returns default column width.org.dom4j.ElementinthashCode()booleanWhen the aggregation is editable in conjunction with using theTable.setAggregationDistributionProvider(AggregationDistributionProvider)method, this allows users to implement algorithms for distributing data between table rows.booleanbooleanbooleanReturns whether editing is allowed for the corresponding column in the table.booleanReturns whether the user can sort the data by this column.protected voidprotected voidremoveClickListener(Consumer<Table.Column.ClickEvent<E>> listener) voidsetAggregation(AggregationInfo aggregation) Sets an aggregation info in order to perform aggregation for this column.voidsetAlignment(Table.ColumnAlignment alignment) Sets a text alignment of column cells.voidsetCaption(String caption) Sets the component's caption.voidsetCaptionAsHtml(boolean captionAsHtml) Sets whether the caption is rendered as HTML.voidsetCollapsed(boolean collapsed) Hides or shows the column.voidsetDescription(String description) Sets the component's description.voidsetEditable(boolean editable) Sets whether editing is allowed for the corresponding column in the table.voidsetExpandRatio(float ratio) Sets the ratio with which the column expands.voidsetFormatter(Formatter formatter) voidsetMaxTextLength(Integer maxTextLength) Limits the number of characters in a cell.voidvoidsetSortable(boolean sortable) Sets whether this column is sortable by the user.voidsetValueDescription(String valueDescription) Defines a hint which is displayed in a popup when a user hovers the mouse cursor on the aggregated value.voidsetValueProvider(Function<E, Object> valueProvider) Sets value provider for the column.voidSets default column width.voidsetXmlDescriptor(org.dom4j.Element element) toString()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface io.jmix.ui.component.Table.Column
setColumnGenerator
-
Field Details
-
id
-
caption
-
captionAsHtml
protected boolean captionAsHtml -
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.ColumnReturns a column identifier. It could be aStringor an instance ofMetaPropertyPath.- Specified by:
getIdin interfaceTable.Column<E>- Returns:
- id of a column
-
getStringId
Description copied from interface:Table.ColumnReturns a column identifier as aString. If the id is an instance ofMetaPropertyPath, then theMetaPropertyPath.toPathString()will be returned.- Specified by:
getStringIdin interfaceTable.Column<E>- Returns:
- a column identifier as a string
-
getMetaPropertyPath
- Specified by:
getMetaPropertyPathin interfaceTable.Column<E>- Returns:
- the instance of
MetaPropertyPathrepresenting a relative path to a property from certain MetaClass or null
-
getMetaPropertyPathNN
- Specified by:
getMetaPropertyPathNNin interfaceTable.Column<E>- Returns:
- the instance of
MetaPropertyPathrepresenting a relative path to a property from certain MetaClass
-
getOwner
- Specified by:
getOwnerin interfaceTable.Column<E>- Returns:
- the Table this column belongs to
-
setOwner
- Specified by:
setOwnerin interfaceTable.Column<E>- Parameters:
owner- the Table this column belongs to
-
getCaption
- Specified by:
getCaptionin interfaceComponent.HasCaption- Returns:
- the caption of the component
-
setCaption
Description copied from interface:Component.HasCaptionSets the component's caption.- Specified by:
setCaptionin interfaceComponent.HasCaption- Parameters:
caption- the new component's caption
-
isCaptionAsHtml
public boolean isCaptionAsHtml()- Specified by:
isCaptionAsHtmlin interfaceHasHtmlCaption- Returns:
trueif the caption is rendered as HTML,falseif rendered as plain text
-
setCaptionAsHtml
public void setCaptionAsHtml(boolean captionAsHtml) Description copied from interface:HasHtmlCaptionSets whether the caption is rendered as HTML.- Specified by:
setCaptionAsHtmlin interfaceHasHtmlCaption- Parameters:
captionAsHtml-trueif the caption is rendered as HTML,falseif rendered as plain text- See Also:
-
getDescription
- Specified by:
getDescriptionin interfaceComponent.HasDescription- Returns:
- the components description, used in tooltips
-
setDescription
Description copied from interface:Component.HasDescriptionSets the component's description.- Specified by:
setDescriptionin interfaceComponent.HasDescription- Parameters:
description- the new description to set
-
getXmlDescriptor
@Nullable public org.dom4j.Element getXmlDescriptor()- Specified by:
getXmlDescriptorin interfaceComponent.HasXmlDescriptor
-
setXmlDescriptor
public void setXmlDescriptor(@Nullable org.dom4j.Element element) - Specified by:
setXmlDescriptorin interfaceComponent.HasXmlDescriptor
-
getFormatter
- Specified by:
getFormatterin interfaceHasFormatter<E>
-
setFormatter
- Specified by:
setFormatterin interfaceHasFormatter<E>
-
getValueProvider
- Specified by:
getValueProviderin interfaceTable.Column<E>- Returns:
- a value provider or null
-
setValueProvider
Description copied from interface:Table.ColumnSets 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:
setValueProviderin interfaceTable.Column<E>- Parameters:
valueProvider- a callback interface for providing column values from a given source
-
getValueDescription
- Specified by:
getValueDescriptionin 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.ColumnDefines 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:
setValueDescriptionin interfaceTable.Column<E>- Parameters:
valueDescription- a hint- See Also:
-
isEditable
public boolean isEditable()Description copied from interface:Table.ColumnReturns whether editing is allowed for the corresponding column in the table.- Specified by:
isEditablein 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.ColumnSets whether editing is allowed for the corresponding column in the table. NOTE: changing this property at runtime is not supported.- Specified by:
setEditablein interfaceTable.Column<E>- Parameters:
editable- whether editing is allowed for the corresponding column in the table
-
getAlignment
- Specified by:
getAlignmentin interfaceTable.Column<E>- Returns:
- a text alignment of column cells
-
setAlignment
Description copied from interface:Table.ColumnSets a text alignment of column cells. The default alignment isTable.ColumnAlignment.LEFT.- Specified by:
setAlignmentin interfaceTable.Column<E>- Parameters:
alignment- a text alignment of column cells
-
getWidth
Description copied from interface:Table.ColumnReturns default column width. May contain only numeric values in pixels.- Specified by:
getWidthin interfaceTable.Column<E>- Returns:
- default column width
-
setWidth
Description copied from interface:Table.ColumnSets default column width. May contain only numeric values in pixels.- Specified by:
setWidthin interfaceTable.Column<E>- Parameters:
width- default column width
-
isCollapsed
public boolean isCollapsed()- Specified by:
isCollapsedin interfaceTable.Column<E>- Returns:
trueif the column is currently hidden,falseotherwise
-
setCollapsed
public void setCollapsed(boolean collapsed) Description copied from interface:Table.ColumnHides or shows the column. By default columns are visible before explicitly hiding them.- Specified by:
setCollapsedin interfaceTable.Column<E>- Parameters:
collapsed-trueto hide the column,falseto show
-
isSortable
public boolean isSortable()Description copied from interface:Table.ColumnReturns whether the user can sort the data by this column.- Specified by:
isSortablein interfaceTable.Column<E>- Returns:
trueif the column is sortable by the user,falseotherwise
-
setSortable
public void setSortable(boolean sortable) Description copied from interface:Table.ColumnSets 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:
setSortablein interfaceTable.Column<E>- Parameters:
sortable-trueif the user should be able to sort the column,falseotherwise- See Also:
-
getMaxTextLength
- Specified by:
getMaxTextLengthin interfaceTable.Column<E>- Returns:
- the maximum number of characters in a cell
-
setMaxTextLength
Description copied from interface:Table.ColumnLimits 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:
setMaxTextLengthin interfaceTable.Column<E>- Parameters:
maxTextLength- the maximum number of characters in a cell- See Also:
-
getAggregation
- Specified by:
getAggregationin interfaceTable.Column<E>- Returns:
- an aggregation info
-
setAggregation
Description copied from interface:Table.ColumnSets an aggregation info in order to perform aggregation for this column.- Specified by:
setAggregationin interfaceTable.Column<E>- Parameters:
aggregation- aggregation info
-
isAggregationEditable
public boolean isAggregationEditable()Description copied from interface:Table.ColumnWhen 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:
isAggregationEditablein interfaceTable.Column<E>- Returns:
- whether aggregation info is editable
-
setExpandRatio
public void setExpandRatio(float ratio) Description copied from interface:Table.ColumnSets 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:
setExpandRatioin interfaceTable.Column<E>- Parameters:
ratio- the expand ratio of this column.0to not have it expand at all. A negative number to clear the expand value.
-
getExpandRatio
public float getExpandRatio()- Specified by:
getExpandRatioin interfaceTable.Column<E>- Returns:
- the ratio with which the column expands
-
addClickListener
Description copied from interface:Table.ColumnAdds a click listener for column.- Specified by:
addClickListenerin 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
-