@JsModule(value="./src/fc-twin-col-grid-auto-resize.js") @CssImport(value="./styles/multiselect-cb-hide.css",themeFor="vaadin-grid") @CssImport(value="./styles/twin-col-grid-button.css") @CssImport(value="./styles/twincol-grid.css") public 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 | Class and Description |
|---|---|
static class |
TwinColGrid.Orientation
enumeration of all available orientation for TwinGolGrid component
|
| Modifier and Type | Field and Description |
|---|---|
protected com.vaadin.flow.component.grid.Grid<T> |
leftGrid
Deprecated.
Use getAvailableGrid()
|
protected com.vaadin.flow.data.provider.ListDataProvider<T> |
leftGridDataProvider
Deprecated.
Use getAvailableGrid().getDataProvider()
|
protected com.vaadin.flow.component.grid.Grid<T> |
rightGrid
Deprecated.
Use getSelectionGrid()
|
protected com.vaadin.flow.data.provider.ListDataProvider<T> |
rightGridDataProvider
Deprecated.
Use getSelectionGrid().getDataProvider()
|
| 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)
Deprecated.
|
TwinColGrid(@NonNull com.vaadin.flow.component.grid.Grid<T> availableGrid,
@NonNull com.vaadin.flow.component.grid.Grid<T> selectionGrid)
Constructs a new empty TwinColGrid, using the specified grids for each side.
|
TwinColGrid(com.vaadin.flow.data.provider.ListDataProvider<T> dataProvider,
String caption)
Deprecated.
|
TwinColGrid(String caption)
Deprecated.
Use
TwinColGrid() and {setCaption(String) |
TwinColGrid(String caption,
@NonNull com.vaadin.flow.component.grid.Grid<T> availableGrid,
@NonNull com.vaadin.flow.component.grid.Grid<T> selectionGrid)
Deprecated.
|
TwinColGrid(String caption,
Supplier<com.vaadin.flow.component.grid.Grid<T>> gridSupplier)
Deprecated.
|
TwinColGrid(Supplier<com.vaadin.flow.component.grid.Grid<T>> gridSupplier)
Constructs a new empty TwinColGrid, using the specified supplier for instantiating both grids.
|
| 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. |
TwinColGrid<T> |
addFilterableColumn(com.vaadin.flow.component.ItemLabelGenerator<T> itemLabelGenerator,
com.vaadin.flow.function.SerializableFunction<T,String> filterableValue,
String header,
String filterPlaceholder,
boolean enableClearButton) |
TwinColGrid<T> |
addFilterableColumn(com.vaadin.flow.component.ItemLabelGenerator<T> itemLabelGenerator,
com.vaadin.flow.function.SerializableFunction<T,String> filterableValue,
String header,
String filterPlaceholder,
boolean enableClearButton,
String key) |
TwinColGrid<T> |
addFilterableColumn(com.vaadin.flow.component.ItemLabelGenerator<T> itemLabelGenerator,
String header,
String filterPlaceholder,
boolean enableClearButton) |
TwinColGrid<T> |
addFilterableColumn(com.vaadin.flow.component.ItemLabelGenerator<T> itemLabelGenerator,
String header,
String filterPlaceholder,
boolean enableClearButton,
String key) |
void |
addLeftGridClassName(String classname)
Deprecated.
Use
getAvailableGrid().addClassName(classname) |
void |
addLeftGridSelectionListener(com.vaadin.flow.data.selection.SelectionListener<com.vaadin.flow.component.grid.Grid<T>,T> listener)
Deprecated.
Use
getAvailableGrid().addSelectionListener(listener); |
void |
addRightGridClassName(String classname)
Deprecated.
Use
getSelectionGrid().addClassName(classname) |
void |
addRightGridSelectionListener(com.vaadin.flow.data.selection.SelectionListener<com.vaadin.flow.component.grid.Grid<T>,T> listener)
Deprecated.
Use
getSelectionGrid().addSelectionListener(listener); |
TwinColGrid<T> |
addSortableColumn(com.vaadin.flow.component.ItemLabelGenerator<T> itemLabelGenerator,
Comparator<T> comparator,
String header)
Adds a new sortable text column to this
Grid with a value provider. |
TwinColGrid<T> |
addSortableColumn(com.vaadin.flow.component.ItemLabelGenerator<T> itemLabelGenerator,
Comparator<T> comparator,
String header,
String key)
Adds a new sortable text column to this
Grid with a value provider. |
com.vaadin.flow.shared.Registration |
addValueChangeListener(com.vaadin.flow.component.HasValue.ValueChangeListener<? super com.vaadin.flow.component.HasValue.ValueChangeEvent<Set<T>>> listener) |
com.vaadin.flow.component.HasValue<? extends com.vaadin.flow.component.HasValue.ValueChangeEvent<List<T>>,List<T>> |
asList() |
void |
clearAll() |
void |
forEachGrid(Consumer<com.vaadin.flow.component.grid.Grid<T>> consumer) |
com.vaadin.flow.component.grid.Grid<T> |
getAvailableGrid()
Return the grid that contains the available items.
|
String |
getAvailableGridCaption()
Returns the text shown above the grid with the available items.
|
String |
getCaption()
Returns the component caption.
|
Set<T> |
getEmptyValue() |
String |
getLeftColumnCaption()
Deprecated.
|
com.vaadin.flow.component.grid.Grid<T> |
getLeftGrid()
Deprecated.
Use
getAvailableGrid(). Depending on the orientation, the "left grid" may
not be located at the left side. |
TwinColGrid.Orientation |
getOrientation() |
String |
getRightColumnCaption()
Deprecated.
|
com.vaadin.flow.component.grid.Grid<T> |
getRightGrid()
Deprecated.
Use
getSelectionGrid(). Depending on the orientation, the "right grid" may
not be located at the right side. |
com.vaadin.flow.component.grid.Grid<T> |
getSelectionGrid()
Return the grid that contains the selected items.
|
String |
getSelectionGridCaption()
Returns the text shown above the grid with the selected items.
|
Set<T> |
getValue()
Returns the current value of this object which is an immutable set of the currently selected
items.
|
boolean |
isAutoResize()
Return whether autoResize is set or not.
|
boolean |
isReadOnly() |
boolean |
isRequiredIndicatorVisible() |
boolean |
isSelectionGridReorderingAllowed()
Return whether drag-and-drop within the selection grid is allowed.
|
void |
removeLeftGridClassName(String classname)
Deprecated.
Use
getAvailableGrid().removeClassName(classname) |
void |
removeRightGridClassName(String classname)
Deprecated.
Use
getSelectionGrid().removeClassName(classname) |
TwinColGrid<T> |
selectRowOnClick() |
void |
setAutoResize(boolean autoResize)
Sets whether component should update orientation on resize.
|
void |
setCaption(String captionText)
Sets the component caption.
|
void |
setItems(Collection<T> items) |
void |
setItems(Stream<T> items) |
void |
setLeftGridClassName(String classname)
Deprecated.
Use
getAvailableGrid().setClassName(classname) |
void |
setMoveItemsByDoubleClick(boolean value)
Sets whether a doubleclick event immediately moves an item to the other grid
|
void |
setReadOnly(boolean readOnly) |
void |
setRequiredIndicatorVisible(boolean requiredIndicatorVisible) |
void |
setRightGridClassName(String classname)
Deprecated.
Use
getSelectionGrid().setClassName(classname) |
void |
setSelectionGridReorderingAllowed(boolean value)
Configure whether drag-and-drop within the selection grid is allowed.
|
void |
setValue(Set<T> value)
Set
value to grid |
TwinColGrid<T> |
withAvailableGridCaption(String caption)
Sets the text shown above the grid with the available items.
|
TwinColGrid<T> |
withDragAndDropSupport()
Adds drag n drop support between grids.
|
TwinColGrid<T> |
withLeftColumnCaption(String caption)
Deprecated.
|
TwinColGrid<T> |
withOrientation(TwinColGrid.Orientation orientation)
Sets orientation for TwinColGridComponent
|
TwinColGrid<T> |
withoutAddAllButton() |
TwinColGrid<T> |
withoutAddButton() |
TwinColGrid<T> |
withoutRemoveAllButton() |
TwinColGrid<T> |
withoutRemoveButton() |
TwinColGrid<T> |
withRightColumnCaption(String caption)
Deprecated.
|
TwinColGrid<T> |
withSelectionGridCaption(String caption)
Sets the text shown above the grid with the selected items.
|
TwinColGrid<T> |
withSelectionGridReordering()
Allow drag-and-drop within the selection grid.
|
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, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, onAttach, onDetach, onEnabledStateChanged, set, setElement, setId, setVisibleclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitclear, getOptionalValue, isEmptyadd, add, addComponentAsFirst, addComponentAtIndex, remove, removeAllgetCssSize, getHeight, getHeightUnit, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getWidth, getWidthUnit, setHeight, setHeight, setHeightFull, setMaxHeight, setMaxHeight, setMaxWidth, setMaxWidth, setMinHeight, setMinHeight, setMinWidth, setMinWidth, setSizeFull, setSizeUndefined, setWidth, setWidth, setWidthFullgetBoxSizing, getThemeList, isMargin, isPadding, isSpacing, setBoxSizing, setMarginexpand, getFlexGrow, getJustifyContentMode, replace, setFlexGrow, setJustifyContentModegetChildren, getComponentAt, getComponentCount, indexOfaddClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassName@Deprecated protected final com.vaadin.flow.component.grid.Grid<T> leftGrid
@Deprecated protected final com.vaadin.flow.component.grid.Grid<T> rightGrid
@Deprecated protected com.vaadin.flow.data.provider.ListDataProvider<T> leftGridDataProvider
@Deprecated protected com.vaadin.flow.data.provider.ListDataProvider<T> rightGridDataProvider
public TwinColGrid()
ListDataProvider.@Deprecated public TwinColGrid(String caption)
TwinColGrid() and {setCaption(String)caption - the component caption@Deprecated public TwinColGrid(com.vaadin.flow.data.provider.ListDataProvider<T> dataProvider, String caption)
TwinColGrid() and setDataProvider(ListDataProvider),
setCaption(String)dataProvider - the data provider, not nullcaption - the component caption@Deprecated public TwinColGrid(String caption, Supplier<com.vaadin.flow.component.grid.Grid<T>> gridSupplier)
TwinColGrid(Supplier) and setCaption(String)caption - the component captiongridSupplier - a supplier for instantiating both gridspublic TwinColGrid(Supplier<com.vaadin.flow.component.grid.Grid<T>> gridSupplier)
gridSupplier - a supplier for instantiating both grids@Deprecated public TwinColGrid(String caption, @NonNull @NonNull com.vaadin.flow.component.grid.Grid<T> availableGrid, @NonNull @NonNull com.vaadin.flow.component.grid.Grid<T> selectionGrid)
TwinColGrid(Grid, Grid) and setCaption(String)caption - the component captionavailableGrid - the grid that contains the available itemsselectionGrid - the grid that contains the selected itemspublic TwinColGrid(@NonNull
@NonNull com.vaadin.flow.component.grid.Grid<T> availableGrid,
@NonNull
@NonNull com.vaadin.flow.component.grid.Grid<T> selectionGrid)
availableGrid - the grid that contains the available itemsselectionGrid - the grid that contains the selected itemspublic TwinColGrid(Collection<T> options)
options - the options, cannot be null@Deprecated public TwinColGrid(Collection<T> options, String caption)
TwinColGrid(Collection) and {setCaption(String)caption - the caption to set, can be nulloptions - the options, cannot be nullpublic void setCaption(String captionText)
captinText - the component caption.public String getCaption()
public TwinColGrid<T> withOrientation(TwinColGrid.Orientation orientation)
orientation - public TwinColGrid.Orientation getOrientation()
public com.vaadin.flow.component.grid.Grid<T> getAvailableGrid()
public com.vaadin.flow.component.grid.Grid<T> getSelectionGrid()
@Deprecated public com.vaadin.flow.component.grid.Grid<T> getLeftGrid()
getAvailableGrid(). Depending on the orientation, the "left grid" may
not be located at the left side.@Deprecated public com.vaadin.flow.component.grid.Grid<T> getRightGrid()
getSelectionGrid(). Depending on the orientation, the "right grid" may
not be located at the right side.public final void forEachGrid(Consumer<com.vaadin.flow.component.grid.Grid<T>> consumer)
public void setItems(Collection<T> items)
@Deprecated public void setLeftGridClassName(String classname)
getAvailableGrid().setClassName(classname)@Deprecated public void addLeftGridClassName(String classname)
getAvailableGrid().addClassName(classname)@Deprecated public void removeLeftGridClassName(String classname)
getAvailableGrid().removeClassName(classname)@Deprecated public void setRightGridClassName(String classname)
getSelectionGrid().setClassName(classname)@Deprecated public void addRightGridClassName(String classname)
getSelectionGrid().addClassName(classname)@Deprecated public void removeRightGridClassName(String classname)
getSelectionGrid().removeClassName(classname)public void clearAll()
public TwinColGrid<T> withAvailableGridCaption(String caption)
null clears the caption.caption - The text to show, null to clearpublic TwinColGrid<T> withSelectionGridCaption(String caption)
null clears the caption.caption - The text to show, null to clear@Deprecated public TwinColGrid<T> withRightColumnCaption(String caption)
withAvailableGridCaption(String)null clears the caption.caption - The text to show, null to clear@Deprecated public TwinColGrid<T> withLeftColumnCaption(String caption)
withSelectionGridCaption(String)null clears the caption.caption - 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 the provided itemLabelGenerator.itemLabelGenerator - the value providerheader - the column headerpublic TwinColGrid<T> addSortableColumn(com.vaadin.flow.component.ItemLabelGenerator<T> itemLabelGenerator, Comparator<T> comparator, String header)
Grid with a value provider. The column will use
a TextRenderer. The value is converted to a String using the provided itemLabelGenerator.itemLabelGenerator - the value providercomparator - the in-memory comparatorheader - the column headerpublic TwinColGrid<T> addSortableColumn(com.vaadin.flow.component.ItemLabelGenerator<T> itemLabelGenerator, Comparator<T> comparator, String header, String key)
Grid with a value provider. The column will use
a TextRenderer. The value is converted to a String using the provided itemLabelGenerator.itemLabelGenerator - the value providercomparator - the in-memory comparatorheader - the column headerheader - the column keypublic 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 getAvailableGridCaption()
null if not set.public String getSelectionGridCaption()
null if not set.@Deprecated public String getRightColumnCaption()
getSelectionGridCaption()null if not set.@Deprecated public String getLeftColumnCaption()
getAvailableGridCaption()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 requiredIndicatorVisible)
public TwinColGrid<T> withSelectionGridReordering()
public void setSelectionGridReorderingAllowed(boolean value)
public boolean isSelectionGridReorderingAllowed()
@Deprecated public void addLeftGridSelectionListener(com.vaadin.flow.data.selection.SelectionListener<com.vaadin.flow.component.grid.Grid<T>,T> listener)
getAvailableGrid().addSelectionListener(listener);@Deprecated public void addRightGridSelectionListener(com.vaadin.flow.data.selection.SelectionListener<com.vaadin.flow.component.grid.Grid<T>,T> listener)
getSelectionGrid().addSelectionListener(listener);public TwinColGrid<T> addFilterableColumn(com.vaadin.flow.component.ItemLabelGenerator<T> itemLabelGenerator, com.vaadin.flow.function.SerializableFunction<T,String> filterableValue, String header, String filterPlaceholder, boolean enableClearButton, String key)
public TwinColGrid<T> addFilterableColumn(com.vaadin.flow.component.ItemLabelGenerator<T> itemLabelGenerator, String header, String filterPlaceholder, boolean enableClearButton)
public TwinColGrid<T> addFilterableColumn(com.vaadin.flow.component.ItemLabelGenerator<T> itemLabelGenerator, com.vaadin.flow.function.SerializableFunction<T,String> filterableValue, String header, String filterPlaceholder, boolean enableClearButton)
public TwinColGrid<T> addFilterableColumn(com.vaadin.flow.component.ItemLabelGenerator<T> itemLabelGenerator, String header, String filterPlaceholder, boolean enableClearButton, String key)
public TwinColGrid<T> selectRowOnClick()
public com.vaadin.flow.component.HasValue<? extends com.vaadin.flow.component.HasValue.ValueChangeEvent<List<T>>,List<T>> asList()
public boolean isAutoResize()
public void setAutoResize(boolean autoResize)
autoResize - if true, component will update orientation on resizepublic void setMoveItemsByDoubleClick(boolean value)
value - if true, a a doubleclick event will immediately move an item to the other gridCopyright © 2017–2023 Flowing Code. All rights reserved.