T
- item typepublic class RadioButtonGroup<T> extends AbstractSingleSelect<T> implements FieldEvents.FocusNotifier, FieldEvents.BlurNotifier, HasDataProvider<T>
DataProvider
. RadioButtons may have captions and icons.AbstractListing.AbstractListingExtension<T>
Component.ErrorEvent, Component.Event, Component.Focusable, Component.Listener
ClientConnector.AttachEvent, ClientConnector.AttachListener, ClientConnector.ConnectorErrorEvent, ClientConnector.DetachEvent, ClientConnector.DetachListener
Sizeable.Unit
HasValue.ValueChangeEvent<V>, HasValue.ValueChangeListener<V>
DESIGN_ATTR_PLAIN_TEXT
SIZE_UNDEFINED, UNITS_CM, UNITS_EM, UNITS_EX, UNITS_INCH, UNITS_MM, UNITS_PERCENTAGE, UNITS_PICAS, UNITS_PIXELS, UNITS_POINTS
Constructor and Description |
---|
RadioButtonGroup()
Constructs a new RadioButtonGroup.
|
RadioButtonGroup(String caption)
Constructs a new RadioButtonGroup with caption.
|
RadioButtonGroup(String caption,
Collection<T> items)
Constructs a new RadioButtonGroup with caption and DataProvider
containing given items.
|
RadioButtonGroup(String caption,
DataProvider<T,?> dataProvider)
Constructs a new RadioButtonGroup 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.
|
ItemCaptionGenerator<T> |
getItemCaptionGenerator()
Gets the item caption generator that is used to produce the strings shown
in the combo box for each item.
|
DescriptionGenerator<T> |
getItemDescriptionGenerator()
Gets the item description generator.
|
SerializablePredicate<T> |
getItemEnabledProvider()
Returns the item enabled predicate.
|
IconGenerator<T> |
getItemIconGenerator()
Gets the currently used item icon generator.
|
protected RadioButtonGroupState |
getState()
Returns the shared state bean with information to be sent from the server
to the client.
|
protected RadioButtonGroupState |
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 |
setItemCaptionGenerator(ItemCaptionGenerator<T> itemCaptionGenerator)
Sets the item caption generator that is used to produce the strings shown
in the combo box for each item.
|
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 radiobutton group.
|
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, getCustomAttributes, getSelectedItem, getValue, isReadOnly, isRequiredIndicatorVisible, isSelected, keyToItem, setReadOnly, setRequiredIndicatorVisible, setSelectedItem, setSelectedItem, setValue, updateSelectedItemState
addDataGenerator, deserializeDeclarativeRepresentation, doReadDesign, doWriteDesign, focus, getDataCommunicator, getTabIndex, internalGetDataProvider, internalSetDataProvider, internalSetDataProvider, readDesign, readItem, removeDataGenerator, serializeDeclarativeRepresentation, setTabIndex, writeDesign, writeItems
addContextClickListener, 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, setWidthUndefined
addAttachListener, 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, updateDiffstate
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
setItems
addListener, 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, writeDesign
addAttachListener, addDetachListener, beforeClientResponse, detach, encodeState, getErrorHandler, getExtensions, getRpcManager, getStateType, handleConnectorRequest, isAttached, isConnectorEnabled, markAsDirty, markAsDirtyRecursive, removeAttachListener, removeDetachListener, removeExtension, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler
getConnectorId
getHeight, getHeightUnits, getWidth, getWidthUnits, setHeight, setHeight, setHeightFull, setHeightUndefined, setSizeFull, setSizeUndefined, setWidth, setWidth, setWidthFull, setWidthUndefined
clear, getDefaultValidator, getEmptyValue, getOptionalValue, isEmpty
public RadioButtonGroup(String caption)
caption
- caption textpublic RadioButtonGroup(String caption, DataProvider<T,?> dataProvider)
caption
- the caption textdataProvider
- the data provider, not nullHasDataProvider.setDataProvider(DataProvider)
public RadioButtonGroup(String caption, Collection<T> items)
caption
- the caption textitems
- the data items to use, not nullHasItems.setItems(Collection)
public RadioButtonGroup()
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 RadioButtonGroupState getState()
AbstractComponent
getState
in class AbstractSingleSelect<T>
protected RadioButtonGroupState getState(boolean markAsDirty)
AbstractClientConnector
getState
in class AbstractSingleSelect<T>
markAsDirty
- true if the connector should automatically be marked dirty,
false otherwiseAbstractClientConnector.getState()
public IconGenerator<T> getItemIconGenerator()
AbstractListing
Implementations that support item icons make this method public.
getItemIconGenerator
in class AbstractListing<T>
IconGenerator
,
AbstractListing.setItemIconGenerator(IconGenerator)
public void setItemIconGenerator(IconGenerator<T> itemIconGenerator)
AbstractListing
Implementations that support item icons make this method public.
setItemIconGenerator
in class AbstractListing<T>
itemIconGenerator
- the item icon generator to set, not nullIconGenerator
public ItemCaptionGenerator<T> getItemCaptionGenerator()
AbstractListing
getItemCaptionGenerator
in class AbstractListing<T>
public void setItemCaptionGenerator(ItemCaptionGenerator<T> itemCaptionGenerator)
AbstractListing
String.valueOf(Object)
is used.setItemCaptionGenerator
in class AbstractListing<T>
itemCaptionGenerator
- the item caption provider to use, not nullpublic SerializablePredicate<T> getItemEnabledProvider()
setItemEnabledProvider(com.vaadin.server.SerializablePredicate<T>)
public void setItemEnabledProvider(SerializablePredicate<T> itemEnabledProvider)
itemEnabledProvider
- the item enable predicate, not nullpublic void setItemDescriptionGenerator(DescriptionGenerator<T> descriptionGenerator)
null
, no tooltip
is shown.descriptionGenerator
- the item description generator to set, not null
public DescriptionGenerator<T> getItemDescriptionGenerator()
public Registration addFocusListener(FieldEvents.FocusListener listener)
FieldEvents.FocusNotifier
FocusListener
to the Component which gets fired
when a Field
receives keyboard focus.addFocusListener
in interface FieldEvents.FocusNotifier
listener
- the focus listener to add, not nullFieldEvents.FocusListener
,
Registration
public Registration addBlurListener(FieldEvents.BlurListener listener)
FieldEvents.BlurNotifier
BlurListener
to the Component which gets fired
when a Field
loses keyboard focus.addBlurListener
in interface FieldEvents.BlurNotifier
listener
- the blur listener to add, not nullFieldEvents.BlurListener
,
Registration
protected void readItems(org.jsoup.nodes.Element design, DesignContext context)
AbstractListing
design
.readItems
in class AbstractSingleSelect<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)
AbstractSingleSelect
readItem
in class AbstractSingleSelect<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)
AbstractListing
writeItem
in class AbstractSingleSelect<T>
design
- the element into which to insert the itemitem
- the item to writecontext
- the DesignContext instance used in writingitem
public DataProvider<T,?> getDataProvider()
HasItems
getDataProvider
in interface HasItems<T>
public void setDataProvider(DataProvider<T,?> dataProvider)
HasDataProvider
setDataProvider
in interface HasDataProvider<T>
dataProvider
- the data provider, not nullCopyright © 2022 Vaadin Ltd. All rights reserved.