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>, 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>
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
     
     
     
    protected void
     
     
     
    protected void
     
    void
    setHeight(String height)
     
    void
    setMaxHeight(String maxHeight)
     
    void
    setMaxWidth(String maxWidth)
     
    void
    setMinHeight(String minHeight)
     
    void
    setMinWidth(String minWidth)
     
    void
    setOptionsColumnLabel(String optionsColumnLabel)
    Label text for the options column.
    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.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

    • optionsColumnLabel

      protected com.vaadin.flow.component.html.NativeLabel optionsColumnLabel
    • selectedItemsColumnLabel

      protected com.vaadin.flow.component.html.NativeLabel selectedItemsColumnLabel
    • options

      protected com.vaadin.flow.component.listbox.MultiSelectListBox<V> options
    • selected

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

      protected List<V> optionsData
    • optionsListeners

      protected Map<com.vaadin.flow.dom.Element,Integer> optionsListeners
    • selectedListeners

      protected Map<com.vaadin.flow.dom.Element,Integer> selectedListeners
    • 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
    • setOptionsColumnLabel

      public void setOptionsColumnLabel(String optionsColumnLabel)
      Label text for the options column. It is placed under the options column
    • getOptionsColumnLabel

      public String getOptionsColumnLabel()
      Returns:
      the options 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
    • 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)
    • columnItemDoubleClicked

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

      protected void recreateOptions(Collection<V> newOptions)
    • updateValueInternal

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

      protected String applyColumnItemLabelFormat(V value)
    • updateColumnLabelPadding

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