Package io.jmix.kanbanflowui.component
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.-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
The server-side implementation of the interface that controlsKanban
's selection state.Nested classes/interfaces inherited from class io.jmix.kanbanflowui.kit.component.JmixKanban
JmixKanban.HierarchyMode, JmixKanban.KanbanI18n, JmixKanban.PropertiesMapping, JmixKanban.TaskPosition
-
Field Summary
Modifier and TypeFieldDescriptionprotected AccessManager
protected org.springframework.context.ApplicationContext
protected boolean
protected boolean
protected com.vaadin.flow.shared.Registration
protected KanbanItems<T>
protected Messages
protected MetadataTools
protected static final String
protected KanbanSelectionModel<T>
protected boolean
Fields inherited from class io.jmix.kanbanflowui.kit.component.JmixKanban
actionsSupport, COLUMN_FOOTER_RENDERER_NAME, COLUMN_HEADER_RENDERER_NAME, columnFooterRenderer, columnHeaderRenderer, columns, i18n, jmixKanbanItems, propertiesMapping, saveDelegate, serializer, swimlanes, TASK_RENDERER_NAME, taskRenderer
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
addItems
(Collection<? extends T> items) com.vaadin.flow.shared.Registration
addSelectionListener
(com.vaadin.flow.data.selection.SelectionListener<Kanban<T>, T> listener) Adds a listener that will be called when theKanban
component's selection model changes its state.protected void
addTaskInternal
(elemental.json.JsonValue taskData) void
protected void
protected void
bind
(JmixKanbanItems<T> items) protected void
checkEnumClass
(Class<?> enumClass) protected KanbanActionsSupport<Kanban<?>>
protected void
protected JmixKanbanSerializer
void
void
Deselects all selected rows.protected void
doClientSideSelection
(T item) protected Object
getEnumValue
(T item, String propertyName, String newValue) getItems()
Returns a set of items corresponding to the selected rows of this component.protected KanbanSelectionModel<T>
Returns an item corresponding to the selected row of this component.protected void
protected void
boolean
protected boolean
isPropertyAvailableBySecurity
(MetaClass metaClass, String attributeName) protected boolean
isPropertyAvailableBySecurity
(String attributeName) protected boolean
isPropertyModifiableBySecurity
(MetaClass metaClass, String attributeName) protected boolean
isPropertyModifiableBySecurity
(String attributeName) protected boolean
protected Object
itemMapper
(T item, String attributeName) protected void
onDetach
(com.vaadin.flow.component.DetachEvent detachEvent) protected void
protected void
protected void
protected void
removeItems
(Collection<? extends T> items) protected void
removeTaskInternal
(elemental.json.JsonValue taskId) void
select
(Collection<T> items) Selects the rows of this component for a given collection of items.void
Selects a row of this component for a given item.protected void
selectTaskInternal
(elemental.json.JsonValue taskId) protected elemental.json.JsonValue
serializeTask
(T item) void
setApplicationContext
(org.springframework.context.ApplicationContext applicationContext) void
setColumns
(Class<?> enumClass) Sets enum class that will be used as columns properties.void
setDragAllowed
(boolean dragAllowed) Sets whether dragging tasks is allowed.protected void
setDragAllowedInternal
(boolean dragAllowed) void
setDropAllowed
(boolean dropAllowed) Sets whether dropping tasks is allowed.protected void
setDropAllowedInternal
(boolean dropAllowed) void
setItems
(KanbanItems<T> items) Sets theKanbanItems
instance to use as data provider.void
setPropertiesMapping
(JmixKanban.PropertiesMapping propertiesMapping) Sets object for storing mapping of item attributes to properties of Kanban items.void
setSwimlanes
(Class<?> enumClass) Sets enum class that will be used as swimlane properties.void
setTaskPriorityVisible
(boolean taskPriorityVisible) Sets whether the task priority icon is visible.protected void
setTaskPriorityVisibleInternal
(boolean taskPriorityVisible) protected void
unbind()
protected void
updateItems
(Collection<? extends T> items) protected void
updateTaskInternal
(elemental.json.JsonValue id, elemental.json.JsonValue jsonValue) protected void
Methods inherited from class io.jmix.kanbanflowui.kit.component.JmixKanban
addAction, addAction, addColumn, addColumnClickListener, addColumnCollapseListener, addColumnDoubleClickListener, addColumnExpandListener, addColumnHideListener, addColumnReorderListener, addColumnShowListener, addDragEndListener, addDragStartListener, addSwimlane, addTaskClickListener, addTaskDoubleClickListener, appendChildColumns, expandAllColumns, getAction, getActions, getActionsSupport, getColumnByDataField, getColumnFooterRendererFunction, getColumnHeaderRendererFunction, getColumns, getColumnsWidth, getHierarchyMode, getI18n, getOwnColumns, getPropertiesMapping, getPropertySetupExpression, getSaveDelegate, getSwimlaneByDataField, getSwimlanes, getSwimlanesFrom, getSwimlanesTo, getTaskPosition, getTaskRendererFunction, initColumnListeners, initComponentProperties, initTaskListeners, isApplyColumnColorToTasksEnabled, isAutoColumnHeightEnabled, isCollapsible, isColumnActionsEnabled, isColumnColorEntireSurfaceEnabled, isColumnFooterVisible, isColumnHidingAllowed, isColumnReorderingAllowed, isColumnSummaryEnabled, isDragAllowed, isDropAllowed, isDropPlaceholderAllowed, isTaskColorEntireSurfaceEnabled, isTaskDueDateVisible, isTaskPriorityVisible, isTaskProgressVisible, isTaskTagsVisible, isTaskUserAvatarVisible, onColumnCollapse, onColumnExpand, onColumnHide, onColumnReorder, onColumnShow, onColumnStateChange, onTaskUpdate, refreshColumns, refreshSwimlanes, removeAction, removeColumn, removeColumnByDataField, removeSwimlane, removeSwimlaneByDataField, replaceColumn, runBeforeClientResponse, setApplyColumnColorToTasksEnabled, setAutoColumnHeightEnabled, setCollapsible, setColumnActionsEnabled, setColumnColorEntireSurfaceEnabled, setColumnFooterRendererFunction, setColumnFooterVisible, setColumnHeaderRendererFunction, setColumnHidingAllowed, setColumnReorderingAllowed, setColumns, setColumnSummaryEnabled, setColumnsWidth, setDropPlaceholderAllowed, setHierarchyMode, setI18n, setPropertyInternal, setSaveDelegate, setSwimlanes, setSwimlanesFrom, setSwimlanesTo, setTaskColorEntireSurfaceEnabled, setTaskDueDateVisible, setTaskPosition, setTaskProgressVisible, setTaskRendererFunction, setTaskTagsVisible, setTaskUserAvatarVisible, showAllColumns, updateItemValues
Methods inherited from class com.vaadin.flow.component.Component
addListener, findAncestor, fireEvent, from, get, getChildren, getElement, getEventBus, getId, getListeners, getLocale, getParent, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, onAttach, onEnabledStateChanged, removeFromParent, scrollIntoView, scrollIntoView, set, setElement, setId, setVisible
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.vaadin.flow.component.AttachNotifier
addAttachListener
Methods inherited from interface com.vaadin.flow.component.DetachNotifier
addDetachListener
Methods inherited from interface io.jmix.flowui.kit.component.HasActions
removeAction, removeAllActions
Methods inherited from interface com.vaadin.flow.component.HasElement
getElement
Methods inherited from interface com.vaadin.flow.component.HasEnabled
isEnabled, setEnabled
Methods inherited from interface com.vaadin.flow.component.HasSize
getHeight, getHeightUnit, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getWidth, getWidthUnit, setHeight, setHeight, setHeightFull, setMaxHeight, setMaxHeight, setMaxWidth, setMaxWidth, setMinHeight, setMinHeight, setMinWidth, setMinWidth, setSizeFull, setSizeUndefined, setWidth, setWidth, setWidthFull
Methods inherited from interface com.vaadin.flow.component.HasStyle
addClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassName
-
Field Details
-
PROPERTY_KANBAN_PRIORITY_READ_ONLY
- See Also:
-
kanbanItems
-
itemsChangeRegistration
protected com.vaadin.flow.shared.Registration itemsChangeRegistration -
selectionModel
-
applicationContext
protected org.springframework.context.ApplicationContext applicationContext -
metadataTools
-
messages
-
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 interfaceorg.springframework.context.ApplicationContextAware
- Throws:
org.springframework.beans.BeansException
-
afterPropertiesSet
public void afterPropertiesSet()- Specified by:
afterPropertiesSet
in interfaceorg.springframework.beans.factory.InitializingBean
-
autowireDependencies
protected void autowireDependencies() -
initComponent
protected void initComponent()- Overrides:
initComponent
in classJmixKanban<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 classJmixKanban<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 classJmixKanban<T>
- Parameters:
dropAllowed
- whether dropping tasks is allowed
-
setDropAllowedInternal
protected void setDropAllowedInternal(boolean dropAllowed) -
setPropertiesMapping
Description copied from class:JmixKanban
Sets object for storing mapping of item attributes to properties of Kanban items.- Overrides:
setPropertiesMapping
in classJmixKanban<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 classJmixKanban<T>
- Parameters:
taskPriorityVisible
- whether the task priority icon is visible
-
setTaskPriorityVisibleInternal
protected void setTaskPriorityVisibleInternal(boolean taskPriorityVisible) -
setSwimlanes
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
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
- Specified by:
getItems
in interfaceListDataComponent<T>
- Overrides:
getItems
in classJmixKanban<T>
- Returns:
- a Kanban data unit that holds component items
-
setItems
Sets theKanbanItems
instance to use as data provider.- Parameters:
items
- theKanbanItems
instance to use
-
getSingleSelectedItem
Description copied from interface:ListDataComponent
Returns an item corresponding to the selected row of this component. If nothing is selected, the method returnsnull
. If multiple selection mode is enabled, returns the first selected instance.- Specified by:
getSingleSelectedItem
in interfaceListDataComponent<T>
- Returns:
- an item corresponding to the selected row of this component
-
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 aCollections.emptySet()
.- Specified by:
getSelectedItems
in interfaceListDataComponent<T>
- Returns:
- a set of item instances corresponding to the selected rows of
this component, never
null
-
select
Description copied from interface:ListDataComponent
Selects a row of this component for a given item.- Specified by:
select
in interfaceListDataComponent<T>
- Parameters:
item
- item instance to select the row
-
select
Description copied from interface:ListDataComponent
Selects the rows of this component for a given collection of items.- Specified by:
select
in interfaceListDataComponent<T>
- Parameters:
items
- collection of items to select rows
-
deselect
- Specified by:
deselect
in interfaceListDataComponent<T>
-
deselectAll
public void deselectAll()Description copied from interface:ListDataComponent
Deselects all selected rows.- Specified by:
deselectAll
in interfaceListDataComponent<T>
-
isMultiSelect
public boolean isMultiSelect()- Specified by:
isMultiSelect
in interfaceListDataComponent<T>
- Returns:
true
if multiple selection mode is enabled
-
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 theKanban
component's selection model changes its state.- Specified by:
addSelectionListener
in interfaceSelectionChangeNotifier<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
- Overrides:
createActionsSupport
in classJmixKanban<T>
-
unbind
protected void unbind() -
bind
-
onItemsChanged
-
updateUsers
protected void updateUsers() -
refreshItems
protected void refreshItems() -
addItems
-
removeItems
-
updateItems
-
serializeTask
-
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
-
selectTaskInternal
protected void selectTaskInternal(elemental.json.JsonValue taskId) -
itemMapper
-
onDetach
protected void onDetach(com.vaadin.flow.component.DetachEvent detachEvent) - Overrides:
onDetach
in classcom.vaadin.flow.component.Component
-
getEnumValue
- Overrides:
getEnumValue
in classJmixKanban<T>
-
checkEnumClass
-
refreshSecurityState
protected void refreshSecurityState() -
isTaskMovingAllowedBySecurity
protected boolean isTaskMovingAllowedBySecurity() -
isPropertyModifiableBySecurity
- Overrides:
isPropertyModifiableBySecurity
in classJmixKanban<T>
-
isPropertyModifiableBySecurity
-
isPropertyAvailableBySecurity
-
isPropertyAvailableBySecurity
-
createSerializer
- Overrides:
createSerializer
in classJmixKanban<T>
-