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

    Fields
    Modifier and Type
    Field
    Description
    protected com.vaadin.flow.component.orderedlayout.VerticalLayout
     
    protected Set<com.vaadin.flow.component.listbox.MultiSelectListBox<V>>
     
    protected Map<com.vaadin.flow.component.listbox.MultiSelectListBox<V>,Integer>
     
    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 List<V>
     
    protected Map<com.vaadin.flow.dom.Element,Integer>
     
    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 Map<com.vaadin.flow.dom.Element,Integer>
     
    protected com.vaadin.flow.component.button.Button
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected String
     
    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
     
    protected void
    setDataProvider(com.vaadin.flow.data.provider.DataProvider<V,?> dataProvider)
     
    void
    setHeight(String height)
     
    void
    setItemLabelGenerator(com.vaadin.flow.component.ItemLabelGenerator<V> itemLabelGenerator)
     
    setItems(com.vaadin.flow.data.provider.DataProvider<V,Void> dataProvider)
     
    setItems(com.vaadin.flow.data.provider.InMemoryDataProvider<V> inMemoryDataProvider)
     
    setItems(com.vaadin.flow.data.provider.ListDataProvider<V> dataProvider)
     
    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)
    Setting true 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
     

    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

      protected com.vaadin.flow.component.listbox.MultiSelectListBox<V> items
    • selectedItems

      protected com.vaadin.flow.component.listbox.MultiSelectListBox<V> 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

      protected List<V> itemsData
    • itemsListeners

      protected Map<com.vaadin.flow.dom.Element,Integer> itemsListeners
    • selectedItemsListeners

      protected Map<com.vaadin.flow.dom.Element,Integer> selectedItemsListeners
    • columnToScrollValue

      protected Map<com.vaadin.flow.component.listbox.MultiSelectListBox<V>,Integer> columnToScrollValue
    • columnsWithSavedScrollPosition

      protected Set<com.vaadin.flow.component.listbox.MultiSelectListBox<V>> columnsWithSavedScrollPosition
    • reorderable

      protected boolean reorderable
    • saveAndRestoreColumnsScrollTopPosition

      protected boolean saveAndRestoreColumnsScrollTopPosition
  • Constructor Details

    • JmixTwinColumn

      public JmixTwinColumn()
  • Method Details

    • setReorderable

      public void setReorderable(Boolean reorderable)
      Setting true keeps original items order in both columns. Setting false organize items in order of their selection or deselection.
      Parameters:
      reorderable - keep original order or not
    • isReorderable

      public Boolean isReorderable()
      Returns:
      true if component keeps original order of items in both columns
    • setSelectAllButtonsVisible

      public void setSelectAllButtonsVisible(Boolean selectAllButtonsVisible)
      Component provides the ability to select or deselect all items. This feature is disabled by default. Setting true shows two buttons to select or deselect all items.
    • isSelectAllButtonsVisible

      public Boolean isSelectAllButtonsVisible()
      Returns:
      true if the buttons for selecting and deselection all items are visible, false otherwise
    • setItemsColumnLabel

      public void setItemsColumnLabel(String itemsColumnLabel)
      Label text for the items column. It is placed under the items column
    • getItemsColumnLabel

      public String getItemsColumnLabel()
      Returns:
      the items column label text
    • setSelectedItemsColumnLabel

      public void setSelectedItemsColumnLabel(String selectedItemsColumnLabel)
      Label text for the selected items column. It is placed under the selected items column
    • getSelectedItemsColumnLabel

      public String getSelectedItemsColumnLabel()
      Returns:
      the selected items column label text
    • setReadOnly

      public void setReadOnly(boolean readOnly)
      Specified by:
      setReadOnly in interface com.vaadin.flow.component.HasValue<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<JmixTwinColumn<V>,Collection<V>>,Collection<V>>
      Specified by:
      setReadOnly in interface com.vaadin.flow.component.HasValueAndElement<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<JmixTwinColumn<V>,Collection<V>>,Collection<V>>
    • setMinWidth

      public void setMinWidth(String minWidth)
      Specified by:
      setMinWidth in interface com.vaadin.flow.component.HasSize
    • setWidth

      public void setWidth(String width)
      Specified by:
      setWidth in interface com.vaadin.flow.component.HasSize
    • setMaxWidth

      public void setMaxWidth(String maxWidth)
      Specified by:
      setMaxWidth in interface com.vaadin.flow.component.HasSize
    • setMinHeight

      public void setMinHeight(String minHeight)
      Specified by:
      setMinHeight in interface com.vaadin.flow.component.HasSize
    • setHeight

      public void setHeight(String height)
      Specified by:
      setHeight in interface com.vaadin.flow.component.HasSize
    • setMaxHeight

      public void setMaxHeight(String maxHeight)
      Specified by:
      setMaxHeight in interface com.vaadin.flow.component.HasSize
    • getDataProvider

      public com.vaadin.flow.data.provider.DataProvider<V,?> getDataProvider()
    • setItems

      public TwinColumnListDataView<V> setItems(com.vaadin.flow.data.provider.ListDataProvider<V> dataProvider)
      Specified by:
      setItems in interface com.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 interface com.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 interface com.vaadin.flow.data.provider.HasDataView<V,Void,TwinColumnDataView<V>>
    • getGenericDataView

      public TwinColumnDataView<V> getGenericDataView()
      Specified by:
      getGenericDataView in interface com.vaadin.flow.data.provider.HasDataView<V,Void,TwinColumnDataView<V>>
    • getListDataView

      public TwinColumnListDataView<V> getListDataView()
      Specified by:
      getListDataView in interface com.vaadin.flow.data.provider.HasListDataView<V,TwinColumnListDataView<V>>
    • setItemLabelGenerator

      public void setItemLabelGenerator(com.vaadin.flow.component.ItemLabelGenerator<V> itemLabelGenerator)
    • setDataProvider

      protected void setDataProvider(com.vaadin.flow.data.provider.DataProvider<V,?> dataProvider)
    • setPresentationValue

      protected void setPresentationValue(Collection<V> newPresentationValue)
      Specified by:
      setPresentationValue in class com.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

      protected com.vaadin.flow.component.listbox.MultiSelectListBox<V> 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

      protected void onDataChange(com.vaadin.flow.data.provider.DataChangeEvent<V> event)
    • columnItemDoubleClicked

      protected void columnItemDoubleClicked(com.vaadin.flow.component.listbox.MultiSelectListBox<V> from, com.vaadin.flow.component.listbox.MultiSelectListBox<V> to, Integer itemIndex)
    • recreateItems

      protected void recreateItems(Collection<V> newItems)
    • updateValueInternal

      protected void updateValueInternal(Collection<V> value)
    • applyColumnItemLabelFormat

      protected String applyColumnItemLabelFormat(V value)
    • updateColumnLabelPadding

      protected void updateColumnLabelPadding(com.vaadin.flow.component.html.NativeLabel label)