public final class TwinColGrid<T> extends com.vaadin.flow.component.orderedlayout.VerticalLayout implements com.vaadin.flow.component.HasValue<com.vaadin.flow.component.HasValue.ValueChangeEvent<Set<T>>,Set<T>>, com.vaadin.flow.component.HasComponents, com.vaadin.flow.component.HasSize
| Modifier and Type | Field and Description |
|---|---|
protected com.vaadin.flow.component.grid.Grid<T> |
leftGrid |
protected com.vaadin.flow.data.provider.ListDataProvider<T> |
leftGridDataProvider |
protected com.vaadin.flow.component.grid.Grid<T> |
rightGrid |
protected com.vaadin.flow.data.provider.ListDataProvider<T> |
rightGridDataProvider |
| Constructor and Description |
|---|
TwinColGrid()
Constructs a new TwinColGrid with an empty
ListDataProvider. |
TwinColGrid(Collection<T> options)
Constructs a new TwinColGrid with the given options.
|
TwinColGrid(Collection<T> options,
String caption)
Constructs a new TwinColGrid with caption and the given options.
|
TwinColGrid(com.vaadin.flow.data.provider.ListDataProvider<T> dataProvider,
String caption)
Constructs a new TwinColGrid with data provider for options.
|
| Modifier and Type | Method and Description |
|---|---|
TwinColGrid<T> |
addColumn(com.vaadin.flow.component.ItemLabelGenerator<T> itemLabelGenerator,
String header)
Adds a new text column to this
Grid with a value provider. |
void |
addLeftGridSelectionListener(com.vaadin.flow.data.selection.SelectionListener<com.vaadin.flow.component.grid.Grid<T>,T> listener) |
void |
addRightGridSelectionListener(com.vaadin.flow.data.selection.SelectionListener<com.vaadin.flow.component.grid.Grid<T>,T> listener) |
com.vaadin.flow.shared.Registration |
addValueChangeListener(com.vaadin.flow.component.HasValue.ValueChangeListener<? super com.vaadin.flow.component.HasValue.ValueChangeEvent<Set<T>>> listener) |
String |
getLeftColumnCaption()
Returns the text shown above the left column.
|
String |
getRightColumnCaption()
Returns the text shown above the right column.
|
Set<T> |
getValue()
Returns the current value of this object which is an immutable set of the currently selected items.
|
boolean |
isReadOnly() |
boolean |
isRequiredIndicatorVisible() |
void |
setItems(Collection<T> items) |
void |
setItems(Stream<T> items) |
void |
setReadOnly(boolean readOnly) |
void |
setRequiredIndicatorVisible(boolean visible) |
void |
setValue(Set<T> value) |
TwinColGrid<T> |
withDragAndDropSupport()
Adds drag n drop support between grids.
|
TwinColGrid<T> |
withLeftColumnCaption(String leftColumnCaption)
Sets the text shown above the left column.
|
TwinColGrid<T> |
withoutAddAllButton() |
TwinColGrid<T> |
withoutAddButton() |
TwinColGrid<T> |
withoutRemoveAllButton() |
TwinColGrid<T> |
withoutRemoveButton() |
TwinColGrid<T> |
withRightColumnCaption(String rightColumnCaption)
Sets the text shown above the right column.
|
TwinColGrid<T> |
withSizeFull() |
addAndExpand, getAlignItems, getAlignSelf, getDefaultHorizontalComponentAlignment, getHorizontalComponentAlignment, setAlignItems, setAlignSelf, setDefaultHorizontalComponentAlignment, setHorizontalComponentAlignment, setPadding, setSpacingaddListener, fireEvent, from, get, getChildren, getElement, getEventBus, getId, getLocale, getParent, getTranslation, getTranslation, getUI, hasListener, isTemplateMapped, isVisible, onAttach, onDetach, onEnabledStateChanged, set, setElement, setId, setVisibleclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitclear, getEmptyValue, getOptionalValue, isEmptyadd, add, addComponentAsFirst, addComponentAtIndex, remove, removeAllgetHeight, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getWidth, setHeight, setHeightFull, setMaxHeight, setMaxWidth, setMinHeight, setMinWidth, setSizeFull, setSizeUndefined, setWidth, setWidthFullgetBoxSizing, getThemeList, isMargin, isPadding, isSpacing, setBoxSizing, setMarginexpand, getFlexGrow, getJustifyContentMode, replace, setFlexGrow, setJustifyContentModegetComponentAt, getComponentCount, indexOfaddClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassNameprotected final com.vaadin.flow.component.grid.Grid<T> leftGrid
protected final com.vaadin.flow.component.grid.Grid<T> rightGrid
protected com.vaadin.flow.data.provider.ListDataProvider<T> leftGridDataProvider
protected com.vaadin.flow.data.provider.ListDataProvider<T> rightGridDataProvider
public TwinColGrid()
ListDataProvider.public TwinColGrid(com.vaadin.flow.data.provider.ListDataProvider<T> dataProvider, String caption)
dataProvider - the data provider, not nullpublic TwinColGrid(Collection<T> options)
options - the options, cannot be nullpublic TwinColGrid(Collection<T> options, String caption)
caption - the caption to set, can be nulloptions - the options, cannot be nullpublic void setItems(Collection<T> items)
public TwinColGrid<T> withRightColumnCaption(String rightColumnCaption)
null clears the caption.rightColumnCaption - The text to show, null to clearpublic TwinColGrid<T> withLeftColumnCaption(String leftColumnCaption)
null clears the caption.leftColumnCaption - The text to show, null to clearpublic TwinColGrid<T> addColumn(com.vaadin.flow.component.ItemLabelGenerator<T> itemLabelGenerator, String header)
Grid with a value provider. The column will use a TextRenderer. The value is converted to a String using
Object.toString(). In-memory sorting will use the natural ordering of elements if they are mutually comparable and otherwise fall back to
comparing the string representations of the values.valueProvider - the value providerpublic TwinColGrid<T> withoutAddAllButton()
public TwinColGrid<T> withoutRemoveAllButton()
public TwinColGrid<T> withoutAddButton()
public TwinColGrid<T> withoutRemoveButton()
public TwinColGrid<T> withSizeFull()
public TwinColGrid<T> withDragAndDropSupport()
public String getRightColumnCaption()
null if not set.public String getLeftColumnCaption()
null if not set.public Set<T> getValue()
public com.vaadin.flow.shared.Registration addValueChangeListener(com.vaadin.flow.component.HasValue.ValueChangeListener<? super com.vaadin.flow.component.HasValue.ValueChangeEvent<Set<T>>> listener)
public boolean isReadOnly()
public boolean isRequiredIndicatorVisible()
public void setReadOnly(boolean readOnly)
public void setRequiredIndicatorVisible(boolean visible)
public void addLeftGridSelectionListener(com.vaadin.flow.data.selection.SelectionListener<com.vaadin.flow.component.grid.Grid<T>,T> listener)
Copyright © 2017–2020 Flowing Code. All rights reserved.