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
Nested ClassesModifier and TypeClassDescriptionstatic classThe 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
FieldsModifier and TypeFieldDescriptionprotected AccessManagerprotected org.springframework.context.ApplicationContextprotected booleanprotected booleanprotected com.vaadin.flow.shared.Registrationprotected KanbanItems<T>protected Messagesprotected MetadataToolsprotected static final Stringprotected KanbanSelectionModel<T>protected booleanFields 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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddItems(Collection<? extends T> items) com.vaadin.flow.shared.RegistrationaddSelectionListener(com.vaadin.flow.data.selection.SelectionListener<Kanban<T>, T> listener) Adds a listener that will be called when theKanbancomponent's selection model changes its state.protected voidaddTaskInternal(elemental.json.JsonValue taskData) voidprotected voidprotected voidbind(JmixKanbanItems<T> items) protected voidcheckEnumClass(Class<?> enumClass) protected KanbanActionsSupport<Kanban<?>>protected voidprotected JmixKanbanSerializervoidvoidDeselects all selected rows.protected voiddoClientSideSelection(T item) protected ObjectgetEnumValue(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 voidprotected voidbooleanprotected booleanisPropertyAvailableBySecurity(MetaClass metaClass, String attributeName) protected booleanisPropertyAvailableBySecurity(String attributeName) protected booleanisPropertyModifiableBySecurity(MetaClass metaClass, String attributeName) protected booleanisPropertyModifiableBySecurity(String attributeName) protected booleanprotected ObjectitemMapper(T item, String attributeName) protected voidonDetach(com.vaadin.flow.component.DetachEvent detachEvent) protected voidprotected voidprotected voidprotected voidremoveItems(Collection<? extends T> items) protected voidremoveTaskInternal(elemental.json.JsonValue taskId) voidselect(Collection<T> items) Selects the rows of this component for a given collection of items.voidSelects a row of this component for a given item.protected voidselectTaskInternal(elemental.json.JsonValue taskId) protected elemental.json.JsonValueserializeTask(T item) voidsetApplicationContext(org.springframework.context.ApplicationContext applicationContext) voidsetColumns(Class<?> enumClass) Sets enum class that will be used as columns properties.voidsetDragAllowed(boolean dragAllowed) Sets whether dragging tasks is allowed.protected voidsetDragAllowedInternal(boolean dragAllowed) voidsetDropAllowed(boolean dropAllowed) Sets whether dropping tasks is allowed.protected voidsetDropAllowedInternal(boolean dropAllowed) voidsetItems(KanbanItems<T> items) Sets theKanbanItemsinstance to use as data provider.voidsetPropertiesMapping(JmixKanban.PropertiesMapping propertiesMapping) Sets object for storing mapping of item attributes to properties of Kanban items.voidsetSwimlanes(Class<?> enumClass) Sets enum class that will be used as swimlane properties.voidsetTaskPriorityVisible(boolean taskPriorityVisible) Sets whether the task priority icon is visible.protected voidsetTaskPriorityVisibleInternal(boolean taskPriorityVisible) protected voidunbind()protected voidupdateItems(Collection<? extends T> items) protected voidupdateTaskInternal(elemental.json.JsonValue id, elemental.json.JsonValue jsonValue) protected voidMethods 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, updateItemValuesMethods 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, setVisibleMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.vaadin.flow.component.AttachNotifier
addAttachListenerMethods inherited from interface com.vaadin.flow.component.DetachNotifier
addDetachListenerMethods inherited from interface io.jmix.flowui.kit.component.HasActions
removeAction, removeAllActionsMethods inherited from interface com.vaadin.flow.component.HasElement
getElementMethods inherited from interface com.vaadin.flow.component.HasEnabled
isEnabled, setEnabledMethods 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, setWidthFullMethods 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:
setApplicationContextin interfaceorg.springframework.context.ApplicationContextAware- Throws:
org.springframework.beans.BeansException
-
afterPropertiesSet
public void afterPropertiesSet()- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean
-
autowireDependencies
protected void autowireDependencies() -
initComponent
protected void initComponent()- Overrides:
initComponentin classJmixKanban<T>
-
initLocale
protected void initLocale() -
setDragAllowed
public void setDragAllowed(boolean dragAllowed) Description copied from class:JmixKanbanSets whether dragging tasks is allowed.trueby default.- Overrides:
setDragAllowedin 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:JmixKanbanSets whether dropping tasks is allowed.trueby default.- Overrides:
setDropAllowedin classJmixKanban<T>- Parameters:
dropAllowed- whether dropping tasks is allowed
-
setDropAllowedInternal
protected void setDropAllowedInternal(boolean dropAllowed) -
setPropertiesMapping
Description copied from class:JmixKanbanSets object for storing mapping of item attributes to properties of Kanban items.- Overrides:
setPropertiesMappingin classJmixKanban<T>- Parameters:
propertiesMapping- object for storing mapping
-
setTaskPriorityVisible
public void setTaskPriorityVisible(boolean taskPriorityVisible) Description copied from class:JmixKanbanSets whether the task priority icon is visible.trueby default.- Overrides:
setTaskPriorityVisiblein 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:
getItemsin interfaceListDataComponent<T>- Overrides:
getItemsin classJmixKanban<T>- Returns:
- a Kanban data unit that holds component items
-
setItems
Sets theKanbanItemsinstance to use as data provider.- Parameters:
items- theKanbanItemsinstance to use
-
getSingleSelectedItem
Description copied from interface:ListDataComponentReturns 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:
getSingleSelectedItemin interfaceListDataComponent<T>- Returns:
- an item corresponding to the selected row of this component
-
getSelectedItems
Description copied from interface:ListDataComponentReturns a set of items corresponding to the selected rows of this component. If nothing is selected, the method returns aCollections.emptySet().- Specified by:
getSelectedItemsin interfaceListDataComponent<T>- Returns:
- a set of item instances corresponding to the selected rows of
this component, never
null
-
select
Description copied from interface:ListDataComponentSelects a row of this component for a given item.- Specified by:
selectin interfaceListDataComponent<T>- Parameters:
item- item instance to select the row
-
select
Description copied from interface:ListDataComponentSelects the rows of this component for a given collection of items.- Specified by:
selectin interfaceListDataComponent<T>- Parameters:
items- collection of items to select rows
-
deselect
- Specified by:
deselectin interfaceListDataComponent<T>
-
deselectAll
public void deselectAll()Description copied from interface:ListDataComponentDeselects all selected rows.- Specified by:
deselectAllin interfaceListDataComponent<T>
-
isMultiSelect
public boolean isMultiSelect()- Specified by:
isMultiSelectin interfaceListDataComponent<T>- Returns:
trueif 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 theKanbancomponent's selection model changes its state.- Specified by:
addSelectionListenerin 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:
createActionsSupportin 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:
onDetachin classcom.vaadin.flow.component.Component
-
getEnumValue
- Overrides:
getEnumValuein classJmixKanban<T>
-
checkEnumClass
-
refreshSecurityState
protected void refreshSecurityState() -
isTaskMovingAllowedBySecurity
protected boolean isTaskMovingAllowedBySecurity() -
isPropertyModifiableBySecurity
- Overrides:
isPropertyModifiableBySecurityin classJmixKanban<T>
-
isPropertyModifiableBySecurity
-
isPropertyAvailableBySecurity
-
isPropertyAvailableBySecurity
-
createSerializer
- Overrides:
createSerializerin classJmixKanban<T>
-