T - item typepublic class CheckBoxGroup<T> extends AbstractMultiSelect<T> implements FieldEvents.FocusNotifier, FieldEvents.BlurNotifier, HasDataProvider<T>
DataProvider. Checkboxes may have captions and icons.AbstractListing.AbstractListingExtension<T>Component.ErrorEvent, Component.Event, Component.Focusable, Component.ListenerClientConnector.AttachEvent, ClientConnector.AttachListener, ClientConnector.ConnectorErrorEvent, ClientConnector.DetachEvent, ClientConnector.DetachListenerSizeable.UnitHasValue.ValueChangeEvent<V>, HasValue.ValueChangeListener<V>DESIGN_ATTR_PLAIN_TEXTSIZE_UNDEFINED, UNITS_CM, UNITS_EM, UNITS_EX, UNITS_INCH, UNITS_MM, UNITS_PERCENTAGE, UNITS_PICAS, UNITS_PIXELS, UNITS_POINTS| Constructor and Description |
|---|
CheckBoxGroup()
Constructs a new CheckBoxGroup.
|
CheckBoxGroup(String caption)
Constructs a new CheckBoxGroup with caption.
|
CheckBoxGroup(String caption,
Collection<T> items)
Constructs a new CheckBoxGroup with caption and DataProvider containing
given items.
|
CheckBoxGroup(String caption,
DataProvider<T,?> dataProvider)
Constructs a new CheckBoxGroup with caption and DataProvider.
|
| Modifier and Type | Method and Description |
|---|---|
Registration |
addBlurListener(FieldEvents.BlurListener listener)
Adds a
BlurListener to the Component which gets fired
when a Field loses keyboard focus. |
Registration |
addFocusListener(FieldEvents.FocusListener listener)
Adds a
FocusListener to the Component which gets fired
when a Field receives keyboard focus. |
DataProvider<T,?> |
getDataProvider()
Returns the source of data items used by this listing.
|
DescriptionGenerator<T> |
getItemDescriptionGenerator()
Gets the item description generator.
|
SerializablePredicate<T> |
getItemEnabledProvider()
Returns the item enabled provider for this multiselect.
|
IconGenerator<T> |
getItemIconGenerator()
Gets the currently used item icon generator.
|
protected CheckBoxGroupState |
getState()
Returns the shared state bean with information to be sent from the server
to the client.
|
protected CheckBoxGroupState |
getState(boolean markAsDirty)
Returns the shared state for this connector.
|
boolean |
isHtmlContentAllowed()
Checks whether captions are interpreted as html or plain text.
|
protected T |
readItem(org.jsoup.nodes.Element child,
Set<T> selected,
DesignContext context)
Reads an Item from a design and inserts it into the data source.
|
protected void |
readItems(org.jsoup.nodes.Element design,
DesignContext context)
Reads the data source items from the
design. |
void |
setDataProvider(DataProvider<T,?> dataProvider)
Sets the data provider for this listing.
|
void |
setHtmlContentAllowed(boolean htmlContentAllowed)
Sets whether html is allowed in the item captions.
|
void |
setItemDescriptionGenerator(DescriptionGenerator<T> descriptionGenerator)
Sets the description generator that is used for generating descriptions
for items.
|
void |
setItemEnabledProvider(SerializablePredicate<T> itemEnabledProvider)
Sets the item enabled predicate for this multiselect.
|
void |
setItemIconGenerator(IconGenerator<T> itemIconGenerator)
Sets the item icon generator that is used to produce custom icons for
shown items.
|
protected org.jsoup.nodes.Element |
writeItem(org.jsoup.nodes.Element design,
T item,
DesignContext context)
Writes a data source Item to a design.
|
addSelectionListener, addValueChangeListener, deselect, deselect, deselectAll, getCustomAttributes, getItemCaptionGenerator, getSelectedItems, getValue, isReadOnly, isRequiredIndicatorVisible, isSelected, select, setItemCaptionGenerator, setReadOnly, setRequiredIndicatorVisible, setValue, updateSelection, updateSelectionaddDataGenerator, deserializeDeclarativeRepresentation, doReadDesign, doWriteDesign, focus, getDataCommunicator, getTabIndex, internalGetDataProvider, internalSetDataProvider, internalSetDataProvider, readDesign, readItem, removeDataGenerator, serializeDeclarativeRepresentation, setTabIndex, writeDesign, writeItemsaddContextClickListener, addListener, addShortcutListener, addStyleName, attach, beforeClientResponse, detach, findAncestor, fireComponentErrorEvent, fireComponentEvent, getActionManager, getCaption, getComponentError, getData, getDebugId, getDescription, getErrorMessage, getHeight, getHeightUnits, getIcon, getId, getLocale, getParent, getPrimaryStyleName, getStyleName, getWidth, getWidthUnits, isCaptionAsHtml, isConnectorEnabled, isEnabled, isOrHasAncestor, isResponsive, isVisible, removeContextClickListener, removeListener, removeShortcutListener, removeStyleName, setCaption, setCaptionAsHtml, setComponentError, setData, setDebugId, setDescription, setDescription, setEnabled, setHeight, setHeight, setHeightFull, setHeightUndefined, setIcon, setId, setLocale, setParent, setPrimaryStyleName, setResponsive, setSizeFull, setSizeUndefined, setStyleName, setVisible, setWidth, setWidth, setWidthFull, setWidthUndefinedaddAttachListener, addDetachListener, addExtension, addListener, addListener, addListener, 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, removeListener, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler, setResource, updateDiffstateclone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitsetItemsaddListener, 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, setStyleName, setVisible, writeDesignaddAttachListener, addDetachListener, beforeClientResponse, detach, encodeState, getErrorHandler, getExtensions, getRpcManager, getStateType, handleConnectorRequest, isAttached, isConnectorEnabled, markAsDirty, markAsDirtyRecursive, removeAttachListener, removeDetachListener, removeExtension, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandlergetConnectorIdgetHeight, getHeightUnits, getWidth, getWidthUnits, setHeight, setHeight, setHeightFull, setHeightUndefined, setSizeFull, setSizeUndefined, setWidth, setWidth, setWidthFull, setWidthUndefineddeselect, getEmptyValue, selectclear, getDefaultValidator, getOptionalValue, isEmptypublic CheckBoxGroup(String caption)
caption - caption textpublic CheckBoxGroup(String caption, DataProvider<T,?> dataProvider)
caption - the caption textdataProvider - the data provider, not nullHasDataProvider.setDataProvider(DataProvider)public CheckBoxGroup(String caption, Collection<T> items)
caption - the caption textitems - the data items to use, not nullHasItems.setItems(Collection)public CheckBoxGroup()
public void setHtmlContentAllowed(boolean htmlContentAllowed)
htmlContentAllowed - true if the captions are used as html, false if used as plain
textpublic boolean isHtmlContentAllowed()
setHtmlContentAllowed(boolean)protected CheckBoxGroupState getState()
AbstractComponentgetState in class AbstractMultiSelect<T>protected CheckBoxGroupState getState(boolean markAsDirty)
AbstractClientConnectorgetState in class AbstractMultiSelect<T>markAsDirty - true if the connector should automatically be marked dirty,
false otherwiseAbstractClientConnector.getState()public IconGenerator<T> getItemIconGenerator()
AbstractListingImplementations that support item icons make this method public.
getItemIconGenerator in class AbstractListing<T>IconGenerator,
AbstractListing.setItemIconGenerator(IconGenerator)public void setItemIconGenerator(IconGenerator<T> itemIconGenerator)
AbstractListingImplementations that support item icons make this method public.
setItemIconGenerator in class AbstractListing<T>itemIconGenerator - the item icon generator to set, not nullIconGeneratorpublic SerializablePredicate<T> getItemEnabledProvider()
AbstractMultiSelect
Implementation note: Override this method and
AbstractMultiSelect.setItemEnabledProvider(SerializablePredicate) as public
and invoke super methods to support this feature in the
multiselect component.
getItemEnabledProvider in class AbstractMultiSelect<T>nullAbstractMultiSelect.setItemEnabledProvider(SerializablePredicate)public void setItemEnabledProvider(SerializablePredicate<T> itemEnabledProvider)
AbstractMultiSelecttrue) or disabled (false). Disabled items are displayed
as grayed out and the user cannot select them. The default predicate
always returns true (all the items are enabled).
Implementation note: Override this method and
AbstractMultiSelect.getItemEnabledProvider() as public and invoke
super methods to support this feature in the multiselect
component.
setItemEnabledProvider in class AbstractMultiSelect<T>itemEnabledProvider - the item enabled provider to set, not nullpublic Registration addFocusListener(FieldEvents.FocusListener listener)
FieldEvents.FocusNotifierFocusListener to the Component which gets fired
when a Field receives keyboard focus.addFocusListener in interface FieldEvents.FocusNotifierlistener - the focus listener to add, not nullFieldEvents.FocusListener,
Registrationpublic Registration addBlurListener(FieldEvents.BlurListener listener)
FieldEvents.BlurNotifierBlurListener to the Component which gets fired
when a Field loses keyboard focus.addBlurListener in interface FieldEvents.BlurNotifierlistener - the blur listener to add, not nullFieldEvents.BlurListener,
Registrationpublic void setItemDescriptionGenerator(DescriptionGenerator<T> descriptionGenerator)
null, no tooltip
is shown.descriptionGenerator - the item description generator to set, not nullpublic DescriptionGenerator<T> getItemDescriptionGenerator()
protected void readItems(org.jsoup.nodes.Element design,
DesignContext context)
AbstractListingdesign.readItems in class AbstractMultiSelect<T>design - The element to obtain the state fromcontext - The DesignContext instance used for parsing the designprotected T readItem(org.jsoup.nodes.Element child, Set<T> selected, DesignContext context)
AbstractMultiSelectreadItem in class AbstractMultiSelect<T>child - a child element representing the itemselected - A set accumulating selected items. If the item that is read is
marked as selected, its item id should be added to this set.context - the DesignContext instance used in parsingprotected org.jsoup.nodes.Element writeItem(org.jsoup.nodes.Element design,
T item,
DesignContext context)
AbstractListingwriteItem in class AbstractMultiSelect<T>design - the element into which to insert the itemitem - the item to writecontext - the DesignContext instance used in writingitempublic DataProvider<T,?> getDataProvider()
HasItemsgetDataProvider in interface HasItems<T>public void setDataProvider(DataProvider<T,?> dataProvider)
HasDataProvidersetDataProvider in interface HasDataProvider<T>dataProvider - the data provider, not nullCopyright © 2021 Vaadin Ltd. All rights reserved.