Class Kanban<T>

java.lang.Object
com.vaadin.flow.component.Component
io.jmix.kanbanflowui.kit.component.JmixKanban<T>
io.jmix.kanbanflowui.component.Kanban<T>
Type Parameters:
T - type of items contained
All Implemented Interfaces:
com.vaadin.flow.component.AttachNotifier, com.vaadin.flow.component.DetachNotifier, com.vaadin.flow.component.HasElement, com.vaadin.flow.component.HasEnabled, com.vaadin.flow.component.HasSize, com.vaadin.flow.component.HasStyle, ListDataComponent<T>, HasActions, SelectionChangeNotifier<Kanban<T>,T>, HasKanbanColumns, Serializable, org.springframework.beans.factory.Aware, org.springframework.beans.factory.InitializingBean, org.springframework.context.ApplicationContextAware

public class Kanban<T> extends JmixKanban<T> implements ListDataComponent<T>, SelectionChangeNotifier<Kanban<T>,T>, org.springframework.context.ApplicationContextAware, org.springframework.beans.factory.InitializingBean
Kanban represents a kanban board that visually depicts work at various stages of a process using cards to represent tasks and columns to represent each stage of the process.
See Also:
  • Field Details

    • PROPERTY_KANBAN_PRIORITY_READ_ONLY

      protected static final String PROPERTY_KANBAN_PRIORITY_READ_ONLY
      See Also:
    • kanbanItems

      protected KanbanItems<T> kanbanItems
    • itemsChangeRegistration

      protected com.vaadin.flow.shared.Registration itemsChangeRegistration
    • selectionModel

      protected KanbanSelectionModel<T> selectionModel
    • applicationContext

      protected org.springframework.context.ApplicationContext applicationContext
    • metadataTools

      protected MetadataTools metadataTools
    • messages

      protected Messages messages
    • accessManager

      protected AccessManager accessManager
    • dragAllowedExplicitly

      protected boolean dragAllowedExplicitly
    • dropAllowedExplicitly

      protected boolean dropAllowedExplicitly
    • taskPriorityVisibleExplicitly

      protected boolean taskPriorityVisibleExplicitly
  • Constructor Details

    • Kanban

      public Kanban()
  • Method Details

    • setApplicationContext

      public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException
      Specified by:
      setApplicationContext in interface org.springframework.context.ApplicationContextAware
      Throws:
      org.springframework.beans.BeansException
    • afterPropertiesSet

      public void afterPropertiesSet()
      Specified by:
      afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
    • autowireDependencies

      protected void autowireDependencies()
    • initComponent

      protected void initComponent()
      Overrides:
      initComponent in class JmixKanban<T>
    • initLocale

      protected void initLocale()
    • setDragAllowed

      public void setDragAllowed(boolean dragAllowed)
      Description copied from class: JmixKanban
      Sets whether dragging tasks is allowed. true by default.
      Overrides:
      setDragAllowed in class JmixKanban<T>
      Parameters:
      dragAllowed - whether dragging tasks is allowed
    • setDragAllowedInternal

      protected void setDragAllowedInternal(boolean dragAllowed)
    • setDropAllowed

      public void setDropAllowed(boolean dropAllowed)
      Description copied from class: JmixKanban
      Sets whether dropping tasks is allowed. true by default.
      Overrides:
      setDropAllowed in class JmixKanban<T>
      Parameters:
      dropAllowed - whether dropping tasks is allowed
    • setDropAllowedInternal

      protected void setDropAllowedInternal(boolean dropAllowed)
    • setPropertiesMapping

      public void setPropertiesMapping(@Nullable JmixKanban.PropertiesMapping propertiesMapping)
      Description copied from class: JmixKanban
      Sets object for storing mapping of item attributes to properties of Kanban items.
      Overrides:
      setPropertiesMapping in class JmixKanban<T>
      Parameters:
      propertiesMapping - object for storing mapping
    • setTaskPriorityVisible

      public void setTaskPriorityVisible(boolean taskPriorityVisible)
      Description copied from class: JmixKanban
      Sets whether the task priority icon is visible. true by default.
      Overrides:
      setTaskPriorityVisible in class JmixKanban<T>
      Parameters:
      taskPriorityVisible - whether the task priority icon is visible
    • setTaskPriorityVisibleInternal

      protected void setTaskPriorityVisibleInternal(boolean taskPriorityVisible)
    • setSwimlanes

      public void setSwimlanes(Class<?> enumClass)
      Sets enum class that will be used as swimlane properties. Enum constant's id will be task's 'swimlane' values, enum constant's localization will be swimlane 'label'.
      Parameters:
      enumClass - an enum class to use as columns properties
    • setColumns

      public void setColumns(Class<?> enumClass)
      Sets enum class that will be used as columns properties. Enum constant's id will be column's 'dataField', enum constant's localization will be column's 'label'.
      Parameters:
      enumClass - an enum class to use as columns properties
    • getItems

      public KanbanItems<T> getItems()
      Specified by:
      getItems in interface ListDataComponent<T>
      Overrides:
      getItems in class JmixKanban<T>
      Returns:
      a Kanban data unit that holds component items
    • setItems

      public void setItems(@Nullable KanbanItems<T> items)
      Sets the KanbanItems instance to use as data provider.
      Parameters:
      items - the KanbanItems instance to use
    • getSingleSelectedItem

      @Nullable public T getSingleSelectedItem()
      Description copied from interface: ListDataComponent
      Returns an item corresponding to the selected row of this component. If nothing is selected, the method returns null. If multiple selection mode is enabled, returns the first selected instance.
      Specified by:
      getSingleSelectedItem in interface ListDataComponent<T>
      Returns:
      an item corresponding to the selected row of this component
    • getSelectedItems

      public Set<T> getSelectedItems()
      Description copied from interface: ListDataComponent
      Returns a set of items corresponding to the selected rows of this component. If nothing is selected, the method returns a Collections.emptySet().
      Specified by:
      getSelectedItems in interface ListDataComponent<T>
      Returns:
      a set of item instances corresponding to the selected rows of this component, never null
    • select

      public void select(T item)
      Description copied from interface: ListDataComponent
      Selects a row of this component for a given item.
      Specified by:
      select in interface ListDataComponent<T>
      Parameters:
      item - item instance to select the row
    • select

      public void select(Collection<T> items)
      Description copied from interface: ListDataComponent
      Selects the rows of this component for a given collection of items.
      Specified by:
      select in interface ListDataComponent<T>
      Parameters:
      items - collection of items to select rows
    • deselect

      public void deselect(T item)
      Specified by:
      deselect in interface ListDataComponent<T>
    • deselectAll

      public void deselectAll()
      Description copied from interface: ListDataComponent
      Deselects all selected rows.
      Specified by:
      deselectAll in interface ListDataComponent<T>
    • isMultiSelect

      public boolean isMultiSelect()
      Specified by:
      isMultiSelect in interface ListDataComponent<T>
      Returns:
      true if multiple selection mode is enabled
    • getSelectionModel

      protected KanbanSelectionModel<T> getSelectionModel()
    • addSelectionListener

      public com.vaadin.flow.shared.Registration addSelectionListener(com.vaadin.flow.data.selection.SelectionListener<Kanban<T>,T> listener)
      Adds a listener that will be called when the Kanban component's selection model changes its state.
      Specified by:
      addSelectionListener in interface SelectionChangeNotifier<Kanban<T>,T>
      Parameters:
      listener - a listener to add
      Returns:
      a handle that can be used for removing the listener
    • createSelectionModel

      protected void createSelectionModel()
    • createActionsSupport

      protected KanbanActionsSupport<Kanban<?>> createActionsSupport()
      Overrides:
      createActionsSupport in class JmixKanban<T>
    • unbind

      protected void unbind()
    • bind

      protected void bind(JmixKanbanItems<T> items)
    • onItemsChanged

      protected void onItemsChanged(JmixKanbanItems.ItemsChangeEvent<T> event)
    • updateUsers

      protected void updateUsers()
    • refreshItems

      protected void refreshItems()
    • addItems

      protected void addItems(Collection<? extends T> items)
    • removeItems

      protected void removeItems(Collection<? extends T> items)
    • updateItems

      protected void updateItems(Collection<? extends T> items)
    • serializeTask

      protected elemental.json.JsonValue serializeTask(T item)
    • addTaskInternal

      protected void addTaskInternal(elemental.json.JsonValue taskData)
    • updateTaskInternal

      protected void updateTaskInternal(elemental.json.JsonValue id, elemental.json.JsonValue jsonValue)
    • removeTaskInternal

      protected void removeTaskInternal(elemental.json.JsonValue taskId)
    • doClientSideSelection

      protected void doClientSideSelection(@Nullable T item)
    • selectTaskInternal

      protected void selectTaskInternal(elemental.json.JsonValue taskId)
    • itemMapper

      @Nullable protected Object itemMapper(T item, @Nullable String attributeName)
    • onDetach

      protected void onDetach(com.vaadin.flow.component.DetachEvent detachEvent)
      Overrides:
      onDetach in class com.vaadin.flow.component.Component
    • getEnumValue

      @Nullable protected Object getEnumValue(T item, String propertyName, @Nullable String newValue)
      Overrides:
      getEnumValue in class JmixKanban<T>
    • checkEnumClass

      protected void checkEnumClass(Class<?> enumClass)
    • refreshSecurityState

      protected void refreshSecurityState()
    • isTaskMovingAllowedBySecurity

      protected boolean isTaskMovingAllowedBySecurity()
    • isPropertyModifiableBySecurity

      protected boolean isPropertyModifiableBySecurity(String attributeName)
      Overrides:
      isPropertyModifiableBySecurity in class JmixKanban<T>
    • isPropertyModifiableBySecurity

      protected boolean isPropertyModifiableBySecurity(MetaClass metaClass, @Nullable String attributeName)
    • isPropertyAvailableBySecurity

      protected boolean isPropertyAvailableBySecurity(@Nullable String attributeName)
    • isPropertyAvailableBySecurity

      protected boolean isPropertyAvailableBySecurity(MetaClass metaClass, @Nullable String attributeName)
    • createSerializer

      protected JmixKanbanSerializer createSerializer()
      Overrides:
      createSerializer in class JmixKanban<T>