Class JmixTwinColumn<V>
java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.AbstractField<JmixTwinColumn<V>,Collection<V>>
io.jmix.flowui.kit.component.twincolumn.JmixTwinColumn<V>
- All Implemented Interfaces:
com.vaadin.flow.component.AttachNotifier
,com.vaadin.flow.component.DetachNotifier
,com.vaadin.flow.component.HasAriaLabel
,com.vaadin.flow.component.HasElement
,com.vaadin.flow.component.HasEnabled
,com.vaadin.flow.component.HasHelper
,com.vaadin.flow.component.HasLabel
,com.vaadin.flow.component.HasSize
,com.vaadin.flow.component.HasStyle
,com.vaadin.flow.component.HasTheme
,com.vaadin.flow.component.HasValue<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<JmixTwinColumn<V>,
,Collection<V>>, Collection<V>> com.vaadin.flow.component.HasValueAndElement<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<JmixTwinColumn<V>,
,Collection<V>>, Collection<V>> com.vaadin.flow.component.shared.HasThemeVariant<TwinColumnVariant>
,com.vaadin.flow.data.provider.HasDataView<V,
,Void, TwinColumnDataView<V>> com.vaadin.flow.data.provider.HasListDataView<V,
,TwinColumnListDataView<V>> Serializable
- Direct Known Subclasses:
TwinColumn
@Tag("jmix-twin-column")
@JsModule("./src/twin-column/jmix-twin-column.js")
public class JmixTwinColumn<V>
extends com.vaadin.flow.component.AbstractField<JmixTwinColumn<V>,Collection<V>>
implements com.vaadin.flow.component.HasSize, com.vaadin.flow.component.HasHelper, com.vaadin.flow.component.HasAriaLabel, com.vaadin.flow.component.HasLabel, com.vaadin.flow.component.shared.HasThemeVariant<TwinColumnVariant>, com.vaadin.flow.data.provider.HasListDataView<V,TwinColumnListDataView<V>>, com.vaadin.flow.data.provider.HasDataView<V,Void,TwinColumnDataView<V>>
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class com.vaadin.flow.component.AbstractField
com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<C extends com.vaadin.flow.component.Component,
V extends Object> Nested classes/interfaces inherited from interface com.vaadin.flow.component.HasValue
com.vaadin.flow.component.HasValue.ValueChangeEvent<V extends Object>, com.vaadin.flow.component.HasValue.ValueChangeListener<E extends com.vaadin.flow.component.HasValue.ValueChangeEvent<?>>
-
Field Summary
Modifier and TypeFieldDescriptionprotected com.vaadin.flow.component.orderedlayout.VerticalLayout
protected com.vaadin.flow.component.button.Button
protected com.vaadin.flow.component.button.Button
protected com.vaadin.flow.component.listbox.MultiSelectListBox<V>
protected com.vaadin.flow.component.html.NativeLabel
protected boolean
protected boolean
protected com.vaadin.flow.component.button.Button
protected com.vaadin.flow.component.listbox.MultiSelectListBox<V>
protected com.vaadin.flow.component.html.NativeLabel
protected com.vaadin.flow.component.button.Button
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected String
applyColumnItemLabelFormat
(V value) protected void
columnItemDoubleClicked
(com.vaadin.flow.component.listbox.MultiSelectListBox<V> from, com.vaadin.flow.component.listbox.MultiSelectListBox<V> to, Integer itemIndex) protected com.vaadin.flow.component.button.Button
createButton
(String className, com.vaadin.flow.component.icon.Icon icon, com.vaadin.flow.component.ComponentEventListener<com.vaadin.flow.component.ClickEvent<com.vaadin.flow.component.button.Button>> clickListener) protected void
protected com.vaadin.flow.component.listbox.MultiSelectListBox<V>
protected com.vaadin.flow.component.html.NativeLabel
protected void
protected void
protected void
com.vaadin.flow.data.provider.DataProvider<V,
?> protected void
protected void
onDataChange
(com.vaadin.flow.data.provider.DataChangeEvent<V> event) protected void
recreateItems
(Collection<V> newItems) protected void
setDataProvider
(com.vaadin.flow.data.provider.DataProvider<V, ?> dataProvider) void
void
setItemLabelGenerator
(com.vaadin.flow.component.ItemLabelGenerator<V> itemLabelGenerator) void
setItemsColumnLabel
(String itemsColumnLabel) Label text for the items column.void
setMaxHeight
(String maxHeight) void
setMaxWidth
(String maxWidth) void
setMinHeight
(String minHeight) void
setMinWidth
(String minWidth) protected void
setPresentationValue
(Collection<V> newPresentationValue) void
setReadOnly
(boolean readOnly) void
setReorderable
(Boolean reorderable) Settingtrue
keeps original items order in both columns.void
setSelectAllButtonsVisible
(Boolean selectAllButtonsVisible) Component provides the ability to select or deselect all items.void
setSelectedItemsColumnLabel
(String selectedItemsColumnLabel) Label text for the selected items column.void
protected void
updateColumnLabelPadding
(com.vaadin.flow.component.html.NativeLabel label) protected void
updateValueInternal
(Collection<V> value) Methods inherited from class com.vaadin.flow.component.AbstractField
addValueChangeListener, getEmptyValue, getValue, isEmpty, setModelValue, setValue, valueEquals
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, onDetach, 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 com.vaadin.flow.component.HasAriaLabel
getAriaLabel, getAriaLabelledBy, setAriaLabel, setAriaLabelledBy
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.HasHelper
getHelperComponent, getHelperText, setHelperComponent, setHelperText
Methods inherited from interface com.vaadin.flow.component.HasLabel
getLabel, setLabel
Methods inherited from interface com.vaadin.flow.data.provider.HasListDataView
setItems, setItems
Methods inherited from interface com.vaadin.flow.component.HasSize
getHeight, getHeightUnit, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getWidth, getWidthUnit, setHeight, setHeightFull, setMaxHeight, setMaxWidth, setMinHeight, setMinWidth, setSizeFull, setSizeUndefined, setWidth, setWidthFull
Methods inherited from interface com.vaadin.flow.component.HasStyle
addClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassName
Methods inherited from interface com.vaadin.flow.component.HasTheme
addThemeName, addThemeNames, getThemeName, getThemeNames, hasThemeName, removeThemeName, removeThemeNames, setThemeName, setThemeName
Methods inherited from interface com.vaadin.flow.component.shared.HasThemeVariant
addThemeVariants, removeThemeVariants
Methods inherited from interface com.vaadin.flow.component.HasValue
clear, getOptionalValue
Methods inherited from interface com.vaadin.flow.component.HasValueAndElement
isReadOnly, isRequiredIndicatorVisible, setRequiredIndicatorVisible
-
Field Details
-
itemsColumnLabel
protected com.vaadin.flow.component.html.NativeLabel itemsColumnLabel -
selectedItemsColumnLabel
protected com.vaadin.flow.component.html.NativeLabel selectedItemsColumnLabel -
items
-
selectedItems
-
actionsPanel
protected com.vaadin.flow.component.orderedlayout.VerticalLayout actionsPanel -
selectItems
protected com.vaadin.flow.component.button.Button selectItems -
selectAllItems
protected com.vaadin.flow.component.button.Button selectAllItems -
deselectItems
protected com.vaadin.flow.component.button.Button deselectItems -
deselectAllItems
protected com.vaadin.flow.component.button.Button deselectAllItems -
itemsData
-
itemsListeners
-
selectedItemsListeners
-
columnToScrollValue
-
columnsWithSavedScrollPosition
-
reorderable
protected boolean reorderable -
saveAndRestoreColumnsScrollTopPosition
protected boolean saveAndRestoreColumnsScrollTopPosition
-
-
Constructor Details
-
JmixTwinColumn
public JmixTwinColumn()
-
-
Method Details
-
setReorderable
Settingtrue
keeps original items order in both columns. Settingfalse
organize items in order of their selection or deselection.- Parameters:
reorderable
- keep original order or not
-
isReorderable
- Returns:
true
if component keeps original order of items in both columns
-
setSelectAllButtonsVisible
Component provides the ability to select or deselect all items. This feature is disabled by default. Settingtrue
shows two buttons to select or deselect all items. -
isSelectAllButtonsVisible
- Returns:
true
if the buttons for selecting and deselection all items are visible,false
otherwise
-
setItemsColumnLabel
Label text for the items column. It is placed under the items column -
getItemsColumnLabel
- Returns:
- the items column label text
-
setSelectedItemsColumnLabel
Label text for the selected items column. It is placed under the selected items column -
getSelectedItemsColumnLabel
- Returns:
- the selected items column label text
-
setReadOnly
public void setReadOnly(boolean readOnly) - Specified by:
setReadOnly
in interfacecom.vaadin.flow.component.HasValue<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<JmixTwinColumn<V>,
Collection<V>>, Collection<V>> - Specified by:
setReadOnly
in interfacecom.vaadin.flow.component.HasValueAndElement<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<JmixTwinColumn<V>,
Collection<V>>, Collection<V>>
-
setMinWidth
- Specified by:
setMinWidth
in interfacecom.vaadin.flow.component.HasSize
-
setWidth
- Specified by:
setWidth
in interfacecom.vaadin.flow.component.HasSize
-
setMaxWidth
- Specified by:
setMaxWidth
in interfacecom.vaadin.flow.component.HasSize
-
setMinHeight
- Specified by:
setMinHeight
in interfacecom.vaadin.flow.component.HasSize
-
setHeight
- Specified by:
setHeight
in interfacecom.vaadin.flow.component.HasSize
-
setMaxHeight
- Specified by:
setMaxHeight
in interfacecom.vaadin.flow.component.HasSize
-
getDataProvider
-
setItems
public TwinColumnListDataView<V> setItems(com.vaadin.flow.data.provider.ListDataProvider<V> dataProvider) - Specified by:
setItems
in interfacecom.vaadin.flow.data.provider.HasListDataView<V,
TwinColumnListDataView<V>>
-
setItems
public TwinColumnDataView<V> setItems(com.vaadin.flow.data.provider.DataProvider<V, Void> dataProvider) - Specified by:
setItems
in interfacecom.vaadin.flow.data.provider.HasDataView<V,
Void, TwinColumnDataView<V>>
-
setItems
public TwinColumnDataView<V> setItems(com.vaadin.flow.data.provider.InMemoryDataProvider<V> inMemoryDataProvider) - Specified by:
setItems
in interfacecom.vaadin.flow.data.provider.HasDataView<V,
Void, TwinColumnDataView<V>>
-
getGenericDataView
- Specified by:
getGenericDataView
in interfacecom.vaadin.flow.data.provider.HasDataView<V,
Void, TwinColumnDataView<V>>
-
getListDataView
- Specified by:
getListDataView
in interfacecom.vaadin.flow.data.provider.HasListDataView<V,
TwinColumnListDataView<V>>
-
setItemLabelGenerator
public void setItemLabelGenerator(com.vaadin.flow.component.ItemLabelGenerator<V> itemLabelGenerator) -
setDataProvider
-
setPresentationValue
- Specified by:
setPresentationValue
in classcom.vaadin.flow.component.AbstractField<JmixTwinColumn<V>,
Collection<V>>
-
initComponent
protected void initComponent() -
createContent
protected void createContent() -
createColumnLabels
protected void createColumnLabels() -
createColumns
protected void createColumns() -
createButtonsPanel
protected void createButtonsPanel() -
createColumnLabel
protected com.vaadin.flow.component.html.NativeLabel createColumnLabel() -
createColumn
-
createButton
protected com.vaadin.flow.component.button.Button createButton(String className, com.vaadin.flow.component.icon.Icon icon, com.vaadin.flow.component.ComponentEventListener<com.vaadin.flow.component.ClickEvent<com.vaadin.flow.component.button.Button>> clickListener) -
onDataChange
-
columnItemDoubleClicked
-
recreateItems
-
updateValueInternal
-
applyColumnItemLabelFormat
-
updateColumnLabelPadding
protected void updateColumnLabelPadding(com.vaadin.flow.component.html.NativeLabel label)
-