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>

public static class AbstractTable.ColumnImpl<E> extends Object implements Table.Column<E>
  • Field Details

    • id

      protected final Object id
    • caption

      protected String caption
    • captionAsHtml

      protected boolean captionAsHtml
    • description

      protected String description
    • valueDescription

      protected String valueDescription
    • editable

      protected boolean editable
    • alignment

      protected Table.ColumnAlignment alignment
    • width

      protected Integer width
    • collapsed

      protected boolean collapsed
    • sortable

      protected boolean sortable
    • aggregation

      protected AggregationInfo aggregation
    • maxTextLength

      protected Integer maxTextLength
    • expandRatio

      protected float expandRatio
    • formatter

      protected Formatter formatter
    • valueProvider

      protected Function<E,Object> valueProvider
    • element

      protected org.dom4j.Element element
    • eventHub

      protected EventHub eventHub
    • owner

      protected AbstractTable<?,E> owner
  • Constructor Details

  • Method Details

    • getId

      public Object getId()
      Description copied from interface: Table.Column
      Returns a column identifier. It could be a String or an instance of MetaPropertyPath.
      Specified by:
      getId in interface Table.Column<E>
      Returns:
      id of a column
    • getStringId

      public String getStringId()
      Description copied from interface: Table.Column
      Returns a column identifier as a String. If the id is an instance of MetaPropertyPath, then the MetaPropertyPath.toPathString() will be returned.
      Specified by:
      getStringId in interface Table.Column<E>
      Returns:
      a column identifier as a string
    • getMetaPropertyPath

      @Nullable public MetaPropertyPath getMetaPropertyPath()
      Specified by:
      getMetaPropertyPath in interface Table.Column<E>
      Returns:
      the instance of MetaPropertyPath representing a relative path to a property from certain MetaClass or null
    • getMetaPropertyPathNN

      public MetaPropertyPath getMetaPropertyPathNN()
      Specified by:
      getMetaPropertyPathNN in interface Table.Column<E>
      Returns:
      the instance of MetaPropertyPath representing a relative path to a property from certain MetaClass
    • getOwner

      @Nullable public Table<E> getOwner()
      Specified by:
      getOwner in interface Table.Column<E>
      Returns:
      the Table this column belongs to
    • setOwner

      public void setOwner(@Nullable Table<E> owner)
      Specified by:
      setOwner in interface Table.Column<E>
      Parameters:
      owner - the Table this column belongs to
    • getCaption

      @Nullable public String getCaption()
      Specified by:
      getCaption in interface Component.HasCaption
      Returns:
      the caption of the component
    • setCaption

      public void setCaption(@Nullable String caption)
      Description copied from interface: Component.HasCaption
      Sets the component's caption.
      Specified by:
      setCaption in interface Component.HasCaption
      Parameters:
      caption - the new component's caption
    • isCaptionAsHtml

      public boolean isCaptionAsHtml()
      Specified by:
      isCaptionAsHtml in interface HasHtmlCaption
      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 interface HasHtmlCaption
      Parameters:
      captionAsHtml - true if the caption is rendered as HTML, false if rendered as plain text
      See Also:
    • getDescription

      @Nullable public String getDescription()
      Specified by:
      getDescription in interface Component.HasDescription
      Returns:
      the components description, used in tooltips
    • setDescription

      public void setDescription(@Nullable String description)
      Description copied from interface: Component.HasDescription
      Sets the component's description.
      Specified by:
      setDescription in interface Component.HasDescription
      Parameters:
      description - the new description to set
    • getXmlDescriptor

      @Nullable public org.dom4j.Element getXmlDescriptor()
      Specified by:
      getXmlDescriptor in interface Component.HasXmlDescriptor
    • setXmlDescriptor

      public void setXmlDescriptor(@Nullable org.dom4j.Element element)
      Specified by:
      setXmlDescriptor in interface Component.HasXmlDescriptor
    • getFormatter

      @Nullable public Formatter getFormatter()
      Specified by:
      getFormatter in interface HasFormatter<E>
    • setFormatter

      public void setFormatter(@Nullable Formatter formatter)
      Specified by:
      setFormatter in interface HasFormatter<E>
    • getValueProvider

      public Function<E,Object> getValueProvider()
      Specified by:
      getValueProvider in interface Table.Column<E>
      Returns:
      a value provider or null
    • setValueProvider

      public void setValueProvider(@Nullable Function<E,Object> valueProvider)
      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 interface Table.Column<E>
      Parameters:
      valueProvider - a callback interface for providing column values from a given source
    • getValueDescription

      @Nullable public String getValueDescription()
      Specified by:
      getValueDescription in interface Table.Column<E>
      Returns:
      a hint which is displayed in a popup when a user hovers the mouse cursor on the aggregated value
    • setValueDescription

      public void setValueDescription(@Nullable String valueDescription)
      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 interface Table.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 interface Table.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 interface Table.Column<E>
      Parameters:
      editable - whether editing is allowed for the corresponding column in the table
    • getAlignment

      @Nullable public Table.ColumnAlignment getAlignment()
      Specified by:
      getAlignment in interface Table.Column<E>
      Returns:
      a text alignment of column cells
    • setAlignment

      public void setAlignment(@Nullable Table.ColumnAlignment alignment)
      Description copied from interface: Table.Column
      Sets a text alignment of column cells. The default alignment is Table.ColumnAlignment.LEFT.
      Specified by:
      setAlignment in interface Table.Column<E>
      Parameters:
      alignment - a text alignment of column cells
    • getWidth

      @Nullable public Integer getWidth()
      Description copied from interface: Table.Column
      Returns default column width. May contain only numeric values in pixels.
      Specified by:
      getWidth in interface Table.Column<E>
      Returns:
      default column width
    • setWidth

      public void setWidth(@Nullable Integer width)
      Description copied from interface: Table.Column
      Sets default column width. May contain only numeric values in pixels.
      Specified by:
      setWidth in interface Table.Column<E>
      Parameters:
      width - default column width
    • isCollapsed

      public boolean isCollapsed()
      Specified by:
      isCollapsed in interface Table.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 interface Table.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 interface Table.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 interface Table.Column<E>
      Parameters:
      sortable - true if the user should be able to sort the column, false otherwise
      See Also:
    • getMaxTextLength

      @Nullable public Integer getMaxTextLength()
      Specified by:
      getMaxTextLength in interface Table.Column<E>
      Returns:
      the maximum number of characters in a cell
    • setMaxTextLength

      public void setMaxTextLength(@Nullable Integer maxTextLength)
      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 interface Table.Column<E>
      Parameters:
      maxTextLength - the maximum number of characters in a cell
      See Also:
    • getAggregation

      @Nullable public AggregationInfo getAggregation()
      Specified by:
      getAggregation in interface Table.Column<E>
      Returns:
      an aggregation info
    • setAggregation

      public void setAggregation(@Nullable AggregationInfo aggregation)
      Description copied from interface: Table.Column
      Sets an aggregation info in order to perform aggregation for this column.
      Specified by:
      setAggregation in interface Table.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 the Table.setAggregationDistributionProvider(AggregationDistributionProvider) method, this allows users to implement algorithms for distributing data between table rows.
      Specified by:
      isAggregationEditable in interface Table.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 interface Table.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 interface Table.Column<E>
      Returns:
      the ratio with which the column expands
    • addClickListener

      public Subscription addClickListener(Consumer<Table.Column.ClickEvent<E>> listener)
      Description copied from interface: Table.Column
      Adds a click listener for column.
      Specified by:
      addClickListener in interface Table.Column<E>
      Parameters:
      listener - a listener to add
      Returns:
      a registration object for removing an event listener
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • onClick

      protected void onClick(JmixEnhancedTable.TableCellClickEvent event)
    • removeClickListener

      protected void removeClickListener(Consumer<Table.Column.ClickEvent<E>> listener)
    • getEventHub

      protected EventHub getEventHub()
      Returns:
      the EventHub for the column