public class TwinColGrid<T> extends com.vaadin.ui.CustomComponent implements com.vaadin.data.HasValue<Set<T>>
com.vaadin.data.HasValue.ValueChangeEvent<V>, com.vaadin.data.HasValue.ValueChangeListener<V>com.vaadin.ui.HasComponents.ComponentAttachDetachNotifier, com.vaadin.ui.HasComponents.ComponentAttachEvent, com.vaadin.ui.HasComponents.ComponentAttachListener, com.vaadin.ui.HasComponents.ComponentDetachEvent, com.vaadin.ui.HasComponents.ComponentDetachListenercom.vaadin.ui.Component.ErrorEvent, com.vaadin.ui.Component.Event, com.vaadin.ui.Component.Focusable, com.vaadin.ui.Component.Listenercom.vaadin.server.ClientConnector.AttachEvent, com.vaadin.server.ClientConnector.AttachListener, com.vaadin.server.ClientConnector.ConnectorErrorEvent, com.vaadin.server.ClientConnector.DetachEvent, com.vaadin.server.ClientConnector.DetachListener| Modifier and Type | Field and Description |
|---|---|
protected com.vaadin.ui.Grid<T> |
leftGrid |
protected com.vaadin.data.provider.ListDataProvider<T> |
leftGridDataProvider |
protected com.vaadin.ui.Grid<T> |
rightGrid |
protected com.vaadin.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(com.vaadin.data.provider.ListDataProvider<T> dataProvider)
Constructs a new TwinColGrid with data provider for options.
|
TwinColGrid(String caption,
Collection<T> options)
Constructs a new TwinColGrid with caption and the given options.
|
TwinColGrid(String caption,
com.vaadin.data.provider.ListDataProvider<T> dataProvider)
Constructs a new TwinColGrid with caption and data provider for options.
|
| Modifier and Type | Method and Description |
|---|---|
<V> TwinColGrid<T> |
addColumn(com.vaadin.data.ValueProvider<T,V> valueProvider,
String caption)
Adds a new text column to this
Grid with a value provider. |
com.vaadin.shared.Registration |
addLeftGridSelectionListener(com.vaadin.event.selection.SelectionListener<T> listener) |
com.vaadin.shared.Registration |
addRightGridSelectionListener(com.vaadin.event.selection.SelectionListener<T> listener) |
com.vaadin.shared.Registration |
addValueChangeListener(com.vaadin.data.HasValue.ValueChangeListener<Set<T>> listener) |
String |
getLeftColumnCaption()
Returns the text shown above the left column.
|
String |
getRightColumnCaption()
Returns the text shown above the right column.
|
int |
getRows()
Returns the number of rows in the selects.
|
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> |
showAddAllButton() |
TwinColGrid<T> |
showRemoveAllButton() |
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> |
withRightColumnCaption(String rightColumnCaption)
Sets the text shown above the right column.
|
TwinColGrid<T> |
withRows(int rows)
Sets the number of rows in the selects.
|
TwinColGrid<T> |
withSizeFull() |
getComponentCount, getCompositionRoot, getState, getState, iterator, setCompositionRootaddContextClickListener, addListener, addShortcutListener, addStyleName, attach, beforeClientResponse, detach, findAncestor, fireComponentErrorEvent, fireComponentEvent, focus, getActionManager, getCaption, getComponentError, getCustomAttributes, getData, getDebugId, getDescription, getErrorMessage, getHeight, getHeightUnits, getIcon, getId, getLocale, getParent, getPrimaryStyleName, getStyleName, getWidth, getWidthUnits, isCaptionAsHtml, isConnectorEnabled, isEnabled, isOrHasAncestor, isResponsive, isVisible, readDesign, removeContextClickListener, removeListener, removeShortcutListener, removeStyleName, setCaption, setCaptionAsHtml, setComponentError, setData, setDebugId, setDescription, setDescription, setEnabled, setHeight, setHeight, setHeightUndefined, setIcon, setId, setLocale, setParent, setPrimaryStyleName, setResponsive, setSizeFull, setSizeUndefined, setStyleName, setStyleName, setVisible, setWidth, setWidth, setWidthUndefined, writeDesignaddAttachListener, addDetachListener, addExtension, addListener, addListener, addListener, addMethodInvocationToQueue, createState, encodeState, equals, fireEvent, getAllChildrenIterable, getConnectorId, getErrorHandler, getExtensions, getListeners, getResource, getRpcManager, getRpcProxy, getSession, getStateType, getUI, handleConnectorRequest, hashCode, hasListeners, isAttached, isThis, markAsDirty, markAsDirtyRecursive, registerRpc, registerRpc, removeAttachListener, removeDetachListener, removeExtension, removeListener, removeListener, removeListener, removeListener, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler, setResource, updateDiffstateclone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitclear, getDefaultValidator, getEmptyValue, getOptionalValue, isEmptyaddListener, addStyleName, addStyleNames, attach, getCaption, getDescription, getIcon, getId, getLocale, getParent, getPrimaryStyleName, getStyleName, getUI, isEnabled, isVisible, readDesign, removeListener, removeStyleName, removeStyleNames, setCaption, setEnabled, setIcon, setId, setParent, setPrimaryStyleName, setStyleName, setVisible, writeDesignaddAttachListener, addDetachListener, beforeClientResponse, detach, encodeState, getErrorHandler, getExtensions, getRpcManager, getStateType, handleConnectorRequest, isAttached, isConnectorEnabled, markAsDirty, markAsDirtyRecursive, removeAttachListener, removeDetachListener, removeExtension, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandlergetHeight, getHeightUnits, getWidth, getWidthUnits, setHeight, setHeight, setHeightUndefined, setSizeFull, setSizeUndefined, setWidth, setWidth, setWidthUndefinedforEach, spliteratorprotected final com.vaadin.ui.Grid<T> leftGrid
protected final com.vaadin.ui.Grid<T> rightGrid
protected com.vaadin.data.provider.ListDataProvider<T> leftGridDataProvider
protected com.vaadin.data.provider.ListDataProvider<T> rightGridDataProvider
public TwinColGrid()
ListDataProvider.public TwinColGrid(com.vaadin.data.provider.ListDataProvider<T> dataProvider)
dataProvider - the data provider, not nullpublic TwinColGrid(Collection<T> options)
options - the options, cannot be nullpublic TwinColGrid(String caption, com.vaadin.data.provider.ListDataProvider<T> dataProvider)
caption - the caption to set, can be nulldataProvider - the data provider, not nullpublic TwinColGrid(String caption, Collection<T> options)
caption - the caption to set, can be nulloptions - the options, cannot be nullpublic void setItems(Collection<T> items)
public int getRows()
public TwinColGrid<T> withRows(int rows)
If a height if set (using AbstractComponent.setHeight(String) or Sizeable.setHeight(float, Unit)) it overrides the number of rows. Leave the height undefined to
use this method.
rows - the number of rows to set.public TwinColGrid<T> withRightColumnCaption(String rightColumnCaption)
null clears the caption.rightColumnCaption - The text to show, null to clearpublic <V> TwinColGrid<T> addColumn(com.vaadin.data.ValueProvider<T,V> valueProvider, String caption)
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> showAddAllButton()
public TwinColGrid<T> showRemoveAllButton()
public TwinColGrid<T> withSizeFull()
public TwinColGrid<T> withDragAndDropSupport()
public String getRightColumnCaption()
null if not set.public TwinColGrid<T> withLeftColumnCaption(String leftColumnCaption)
null clears the caption.leftColumnCaption - The text to show, null to clearpublic String getLeftColumnCaption()
null if not set.public Set<T> getValue()
public com.vaadin.shared.Registration addValueChangeListener(com.vaadin.data.HasValue.ValueChangeListener<Set<T>> listener)
public boolean isReadOnly()
public boolean isRequiredIndicatorVisible()
public void setReadOnly(boolean readOnly)
public void setRequiredIndicatorVisible(boolean visible)
public com.vaadin.shared.Registration addLeftGridSelectionListener(com.vaadin.event.selection.SelectionListener<T> listener)
public com.vaadin.shared.Registration addRightGridSelectionListener(com.vaadin.event.selection.SelectionListener<T> listener)
Copyright © 2017–2020 FlowingCode S.A.. All rights reserved.