Class KanbanColumn

java.lang.Object
io.jmix.kanbanflowui.kit.component.KanbanColumn
All Implemented Interfaces:
HasKanbanColumns, Serializable

public class KanbanColumn extends Object implements Serializable, HasKanbanColumns
A class representing JmixKanban column properties.
See Also:
  • Field Details

    • dataField

      protected final String dataField
    • label

      protected String label
    • collapsed

      protected boolean collapsed
    • collapsible

      protected boolean collapsible
    • visible

      protected boolean visible
    • reorder

      protected boolean reorder
    • orientation

      protected KanbanColumn.Orientation orientation
    • selected

      protected boolean selected
    • width

      protected Integer width
    • color

      protected String color
    • parent

      protected HasKanbanColumns parent
    • columns

      protected List<KanbanColumn> columns
  • Constructor Details

    • KanbanColumn

      public KanbanColumn(String dataField)
  • Method Details

    • getDataField

      public String getDataField()
      Returns:
      the column's data source bound field that corresponds to the status field in the data source
    • getLabel

      public String getLabel()
      Returns:
      text displayed in the column's header
    • setLabel

      public void setLabel(String label)
      Sets the text displayed in the column's header.
      Parameters:
      label - text to be displayed
    • withLabel

      public KanbanColumn withLabel(String label)
      Parameters:
      label - text to be displayed
      Returns:
      this
      See Also:
    • isCollapsed

      public boolean isCollapsed()
      Returns:
      whether the column is collapsed
    • setCollapsed

      public void setCollapsed(boolean collapsed)
      Sets whether the column is collapsed. false by default.
      Parameters:
      collapsed - whether the column is collapsed
    • setCollapsedSilently

      protected void setCollapsedSilently(boolean collapsed)
    • withCollapsed

      public KanbanColumn withCollapsed(boolean collapsed)
      Parameters:
      collapsed - whether the column is collapsed
      Returns:
      this
      See Also:
    • isCollapsible

      public boolean isCollapsible()
      Returns:
      whether the column is collapsible, this works in conjunction with the JmixKanban property of the same name
    • setCollapsible

      public void setCollapsible(boolean collapsible)
      Sets whether the column is collapsible. true by default.
      Parameters:
      collapsible - whether the column is collapsible
    • withCollapsible

      public KanbanColumn withCollapsible(boolean collapsible)
      Parameters:
      collapsible - whether the column is collapsible
      Returns:
      this
      See Also:
    • isVisible

      public boolean isVisible()
      Returns:
      whether a column is visible
    • setVisible

      public void setVisible(boolean visible)
      Sets whether a column is visible. true by default.
      Parameters:
      visible - whether a column is visible
    • setVisibleSilently

      protected void setVisibleSilently(boolean visible)
    • withVisible

      public KanbanColumn withVisible(boolean visible)
      Parameters:
      visible - whether a column is visible
      Returns:
      this
      See Also:
    • isReorder

      public boolean isReorder()
      Returns:
      whether a column can be reordered, this works in conjunction with the JmixKanban.setColumnReorderingAllowed(boolean)
    • setReorder

      public void setReorder(boolean reorder)
      Sets whether a column can be reordered. true by default.
      Parameters:
      reorder - whether a column can be reordered
    • withReorder

      public KanbanColumn withReorder(boolean reorder)
      Parameters:
      reorder - whether a column can be reordered
      Returns:
      this
      See Also:
    • getOrientation

      public KanbanColumn.Orientation getOrientation()
      Returns:
      the orientation of tasks in the column
    • setOrientation

      public void setOrientation(KanbanColumn.Orientation orientation)
      Sets the orientation of tasks in the column.
      Parameters:
      orientation - orientation to be set
    • withOrientation

      public KanbanColumn withOrientation(KanbanColumn.Orientation orientation)
      Parameters:
      orientation - orientation to be set
      Returns:
      this
      See Also:
    • isSelected

      public boolean isSelected()
      Returns:
      whether the current column is selected
    • setSelected

      public void setSelected(boolean selected)
      Sets whether the current column is selected. Only applicable to sub-columns when * hierarchy is tabs. true by default for the first tab.
      Parameters:
      selected - whether the current column is selected
    • withSelected

      public KanbanColumn withSelected(boolean selected)
      Parameters:
      selected - whether the current column is selected
      Returns:
      this
      See Also:
    • getWidth

      public Integer getWidth()
      Returns:
      the column width
    • setWidth

      public void setWidth(Integer width)
      Sets the column width. When this property is set a horizontal scrollbar may appear.
      Parameters:
      width - width to set in pixels
    • withWidth

      public KanbanColumn withWidth(Integer width)
      Parameters:
      width - width to set in pixels
      Returns:
      this
      See Also:
    • getColor

      public String getColor()
      Returns:
      color property of the column
    • setColor

      public void setColor(String color)
      Sets the color property of the column.
      Parameters:
      color - HEX color code or named color to set
    • withColor

      public KanbanColumn withColor(String color)
      Parameters:
      color - color to set
      Returns:
      this
      See Also:
    • getColumns

      @Nullable public List<KanbanColumn> getColumns()
      Specified by:
      getColumns in interface HasKanbanColumns
      Returns:
      an unmodifiable list of all KanbanColumn, including transitive columns
    • getOwnColumns

      public List<KanbanColumn> getOwnColumns()
      Specified by:
      getOwnColumns in interface HasKanbanColumns
      Returns:
      an unmodifiable list of KanbanColumn that are direct elements of this component
    • getColumnByDataField

      @Nullable public KanbanColumn getColumnByDataField(@Nullable String dataField)
      Specified by:
      getColumnByDataField in interface HasKanbanColumns
      Parameters:
      dataField - the dataField attribute of the column to get
      Returns:
      the column corresponding to the given column dataField, or null if no column has such dataField
      See Also:
    • removeColumn

      public void removeColumn(KanbanColumn column)
      Description copied from interface: HasKanbanColumns
      Removes a KanbanColumn from the component. Updates the client-side of the component.
      Specified by:
      removeColumn in interface HasKanbanColumns
      Parameters:
      column - the column to be removed, not null
    • removeColumnByDataField

      public void removeColumnByDataField(String dataField)
      Description copied from interface: HasKanbanColumns
      Removes a KanbanColumn with the given dataField from the component.
      Specified by:
      removeColumnByDataField in interface HasKanbanColumns
      Parameters:
      dataField - the dataField attribute of the column
    • replaceColumn

      public void replaceColumn(String dataField, KanbanColumn newColumn)
      Description copied from interface: HasKanbanColumns
      Finds a KanbanColumn with the passed dataField and replaces it with the new one.
      Specified by:
      replaceColumn in interface HasKanbanColumns
      Parameters:
      dataField - dataField attribute of the column being replaced
      newColumn - a column for replacement
    • addColumn

      public void addColumn(KanbanColumn column)
      Description copied from interface: HasKanbanColumns
      Adds a new column to the component.
      Specified by:
      addColumn in interface HasKanbanColumns
      Parameters:
      column - column to add, not null
    • setColumns

      public void setColumns(List<KanbanColumn> columns)
      Description copied from interface: HasKanbanColumns
      Sets a list of columns for a component.
      Specified by:
      setColumns in interface HasKanbanColumns
      Parameters:
      columns - list of columns to set
    • getParent

      protected HasKanbanColumns getParent()
    • setParent

      protected void setParent(HasKanbanColumns parent)
    • removerParent

      protected void removerParent()
    • appendChildColumns

      protected void appendChildColumns(List<KanbanColumn> columns, KanbanColumn column)