Class RadioButtonGroup<T>
- java.lang.Object
-
- com.vaadin.flow.component.Component
-
- com.vaadin.flow.component.AbstractField<C,T>
-
- com.vaadin.flow.component.AbstractSinglePropertyField<R,T>
-
- com.vaadin.flow.component.radiobutton.GeneratedVaadinRadioGroup<RadioButtonGroup<T>,T>
-
- com.vaadin.flow.component.radiobutton.RadioButtonGroup<T>
-
- All Implemented Interfaces:
AttachNotifier,DetachNotifier,HasComponents,HasElement,HasEnabled,HasHelper,HasLabel,HasSize,HasStyle,HasTheme,HasValidation,HasValue<AbstractField.ComponentValueChangeEvent<RadioButtonGroup<T>,T>,T>,HasValueAndElement<AbstractField.ComponentValueChangeEvent<RadioButtonGroup<T>,T>,T>,HasTooltip,HasItemComponents<T>,HasValidator<T>,HasDataView<T,Void,RadioButtonGroupDataView<T>>,HasListDataView<T,RadioButtonGroupListDataView<T>>,SingleSelect<RadioButtonGroup<T>,T>,Serializable
@NpmPackage(value="@vaadin/radio-group",version="23.5.4") @NpmPackage(value="@vaadin/vaadin-radio-button",version="23.5.4") public class RadioButtonGroup<T> extends GeneratedVaadinRadioGroup<RadioButtonGroup<T>,T> implements HasItemComponents<T>, SingleSelect<RadioButtonGroup<T>,T>, HasListDataView<T,RadioButtonGroupListDataView<T>>, HasDataView<T,Void,RadioButtonGroupDataView<T>>, HasValidation, HasHelper, HasSize, HasLabel, HasTooltip, HasValidator<T>
Radio Button Group allows the user to select exactly one value from a list of related but mutually exclusive options.- Author:
- Vaadin Ltd.
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.vaadin.flow.component.radiobutton.GeneratedVaadinRadioGroup
GeneratedVaadinRadioGroup.InvalidChangeEvent<R extends GeneratedVaadinRadioGroup<R,?>>
-
Nested classes/interfaces inherited from class com.vaadin.flow.component.AbstractField
AbstractField.ComponentValueChangeEvent<C extends Component,V>
-
Nested classes/interfaces inherited from interface com.vaadin.flow.data.binder.HasItemComponents
HasItemComponents.ItemComponent<T>
-
Nested classes/interfaces inherited from interface com.vaadin.flow.component.HasValue
HasValue.ValueChangeEvent<V>, HasValue.ValueChangeListener<E extends HasValue.ValueChangeEvent<?>>
-
-
Constructor Summary
Constructors Constructor Description RadioButtonGroup()Default constructor.RadioButtonGroup(HasValue.ValueChangeListener<AbstractField.ComponentValueChangeEvent<RadioButtonGroup<T>,T>> listener)Constructs a radio button group with a value change listener.RadioButtonGroup(String label)Creates an empty radio button group with the defined label.RadioButtonGroup(String label, HasValue.ValueChangeListener<AbstractField.ComponentValueChangeEvent<RadioButtonGroup<T>,T>> listener)Constructs a radio button group with the defined label and a value change listener.RadioButtonGroup(String label, HasValue.ValueChangeListener<AbstractField.ComponentValueChangeEvent<RadioButtonGroup<T>,T>> listener, T... items)Constructs a radio button group with the defined label, a value change listener and populated with the items in the array.RadioButtonGroup(String label, Collection<T> items)Creates a radio button group with the defined label and populated with the items in the collection.RadioButtonGroup(String label, T... items)Creates a radio button group with the defined label and populated with the items in the array.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidadd(Component... components)Deprecated.since v23.3.voidadd(String text)Deprecated.since v23.3.voidadd(Collection<Component> components)Deprecated.since v23.3.voidaddComponentAsFirst(Component component)Deprecated.since v23.3.voidaddComponentAtIndex(int index, Component component)Deprecated.since v23.3.voidaddComponents(T afterItem, Component... components)Deprecated.since v23.3.voidaddThemeVariants(RadioGroupVariant... variants)Adds theme variants to the component.DataProvider<T,?>getDataProvider()Deprecated.usegetListDataView()orgetGenericDataView()insteadStringgetErrorMessage()Gets the current error message from the radio button group.RadioButtonGroupDataView<T>getGenericDataView()Gets the generic data view for the RadioButtonGroup.SerializablePredicate<T>getItemEnabledProvider()Returns the item enabled predicate.ItemLabelGenerator<T>getItemLabelGenerator()Gets the item label generator that is used to produce the strings shown in the radio button group for each item.intgetItemPosition(T item)Deprecated.since v23.3.ComponentRenderer<? extends Component,T>getItemRenderer()Returns the item component renderer.StringgetLabel()String used for the label element.RadioButtonGroupListDataView<T>getListDataView()Gets the list data view for the RadioButtonGroup.protected booleanhasValidValue()Checks whether the element property has a value that can be converted to the model type.booleanisInvalid()Returnstrueif component input is invalid,falseotherwise.booleanisReadOnly()Returns whether thisHasValueis in read-only mode or not.booleanisRequired()Specifies that the user must select a valueprotected voidonAttach(AttachEvent attachEvent)Called when the component is attached to a UI.protected voidonDetach(DetachEvent detachEvent)Called when the component is detached from a UI.voidonEnabledStateChanged(boolean enabled)Handle component enable state when the enabled state changes.voidprependComponents(T beforeItem, Component... components)Deprecated.since v23.3.voidremove(Component... components)Deprecated.since v23.3.voidremove(Collection<Component> components)Deprecated.since v23.3.voidremoveAll()Deprecated.since v23.3.voidremoveThemeVariants(RadioGroupVariant... variants)Removes theme variants from the component.voidsetDataProvider(DataProvider<T,?> dataProvider)Deprecated.use instead one of thesetItemsmethods which provide access to eitherRadioButtonGroupListDataVieworRadioButtonGroupDataViewvoidsetErrorMessage(String errorMessage)Description copied from corresponding location in WebComponent:voidsetInvalid(boolean invalid)Description copied from corresponding location in WebComponent:voidsetItemEnabledProvider(SerializablePredicate<T> itemEnabledProvider)Sets the item enabled predicate for this radio button group.voidsetItemLabelGenerator(ItemLabelGenerator<T> itemLabelGenerator)Sets the item label generator that is used to produce the strings shown in the radio button group for each item.RadioButtonGroupDataView<T>setItems(DataProvider<T,Void> dataProvider)Set a generic data provider for the component to use and returns the baseDataViewthat provides API to get information on the items.RadioButtonGroupDataView<T>setItems(InMemoryDataProvider<T> inMemoryDataProvider)Sets an in-memory data provider for the component to useRadioButtonGroupListDataView<T>setItems(ListDataProvider<T> dataProvider)Sets a ListDataProvider for the component to use and returns aListDataViewthat provides information and allows operations on the items.voidsetItems(Stream<T> streamOfItems)Deprecated.Because the stream is collected to a list anyway, useHasListDataView.setItems(Collection)instead.voidsetLabel(String label)Sets the label for the field.voidsetReadOnly(boolean readOnly)Sets the read-only mode of thisHasValueto given mode.voidsetRenderer(ComponentRenderer<? extends Component,T> renderer)Sets the item renderer for this radio button group.voidsetRequired(boolean required)Specifies that the user must select in a value.voidsetValue(T value)Sets the value of this object.protected booleanvalueEquals(T value1, T value2)Compares two value instances to each other to determine whether they are equal.-
Methods inherited from class com.vaadin.flow.component.radiobutton.GeneratedVaadinRadioGroup
addInvalidChangeListener, checkValidity, getErrorMessageString, getLabelString, isDisabledBoolean, isInvalidBoolean, isReadonlyBoolean, isRequiredBoolean, setDisabled, setReadonly, validate
-
Methods inherited from class com.vaadin.flow.component.AbstractSinglePropertyField
getSynchronizationRegistration, setPresentationValue, setSynchronizedEvent
-
Methods inherited from class com.vaadin.flow.component.AbstractField
addValueChangeListener, getEmptyValue, getValue, isEmpty, setModelValue
-
Methods inherited from class com.vaadin.flow.component.Component
addListener, findAncestor, fireEvent, from, get, getChildren, getElement, getEventBus, getId, getListeners, getLocale, getParent, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, scrollIntoView, set, setElement, setId, setVisible
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.vaadin.flow.component.AttachNotifier
addAttachListener
-
Methods inherited from interface com.vaadin.flow.component.DetachNotifier
addDetachListener
-
Methods inherited from interface com.vaadin.flow.component.HasElement
getElement
-
Methods inherited from interface com.vaadin.flow.component.HasEnabled
isEnabled, setEnabled
-
Methods inherited from interface com.vaadin.flow.component.HasHelper
getHelperComponent, getHelperText, setHelperComponent, setHelperText
-
Methods inherited from interface com.vaadin.flow.data.provider.HasListDataView
setItems, setItems
-
Methods inherited from interface com.vaadin.flow.component.HasSize
getHeight, getHeightUnit, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getWidth, getWidthUnit, setHeight, setHeight, setHeightFull, setMaxHeight, setMaxHeight, setMaxWidth, setMaxWidth, setMinHeight, setMinHeight, setMinWidth, setMinWidth, setSizeFull, setSizeUndefined, setWidth, setWidth, setWidthFull
-
Methods inherited from interface com.vaadin.flow.component.HasStyle
addClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassName
-
Methods inherited from interface com.vaadin.flow.component.HasTheme
addThemeName, addThemeNames, getThemeName, getThemeNames, hasThemeName, removeThemeName, removeThemeNames, setThemeName, setThemeName
-
Methods inherited from interface com.vaadin.flow.component.shared.HasTooltip
getTooltip, setTooltipText
-
Methods inherited from interface com.vaadin.flow.data.binder.HasValidator
addValidationStatusChangeListener, getDefaultValidator
-
Methods inherited from interface com.vaadin.flow.component.HasValue
addValueChangeListener, clear, getEmptyValue, getOptionalValue, getValue, isEmpty
-
Methods inherited from interface com.vaadin.flow.component.HasValueAndElement
isRequiredIndicatorVisible, setRequiredIndicatorVisible
-
-
-
-
Constructor Detail
-
RadioButtonGroup
public RadioButtonGroup()
Default constructor. Creates an empty radio button group.
-
RadioButtonGroup
public RadioButtonGroup(String label)
Creates an empty radio button group with the defined label.- Parameters:
label- the label describing the radio button group- See Also:
setLabel(String)
-
RadioButtonGroup
public RadioButtonGroup(String label, Collection<T> items)
Creates a radio button group with the defined label and populated with the items in the collection.- Parameters:
label- the label describing the radio button groupitems- the items to be shown in the list of the radio button group- See Also:
setLabel(String),HasListDataView.setItems(Collection)
-
RadioButtonGroup
@SafeVarargs public RadioButtonGroup(String label, T... items)
Creates a radio button group with the defined label and populated with the items in the array.- Parameters:
label- the label describing the radio button groupitems- the items to be shown in the list of the radio button group- See Also:
setLabel(String),HasListDataView.setItems(Object...)
-
RadioButtonGroup
public RadioButtonGroup(HasValue.ValueChangeListener<AbstractField.ComponentValueChangeEvent<RadioButtonGroup<T>,T>> listener)
Constructs a radio button group with a value change listener.- Parameters:
listener- the value change listener to add- See Also:
AbstractField.addValueChangeListener(ValueChangeListener)
-
RadioButtonGroup
public RadioButtonGroup(String label, HasValue.ValueChangeListener<AbstractField.ComponentValueChangeEvent<RadioButtonGroup<T>,T>> listener)
Constructs a radio button group with the defined label and a value change listener.- Parameters:
label- the label describing the radio button grouplistener- the value change listener to add- See Also:
setLabel(String),AbstractField.addValueChangeListener(ValueChangeListener)
-
RadioButtonGroup
@SafeVarargs public RadioButtonGroup(String label, HasValue.ValueChangeListener<AbstractField.ComponentValueChangeEvent<RadioButtonGroup<T>,T>> listener, T... items)
Constructs a radio button group with the defined label, a value change listener and populated with the items in the array.- Parameters:
label- the label describing the radio button grouplistener- the value change listener to additems- the items to be shown in the list of the radio button group- See Also:
setLabel(String),AbstractField.addValueChangeListener(ValueChangeListener),HasListDataView.setItems(Object...)
-
-
Method Detail
-
setItems
public RadioButtonGroupDataView<T> setItems(DataProvider<T,Void> dataProvider)
Description copied from interface:HasDataViewSet a generic data provider for the component to use and returns the baseDataViewthat provides API to get information on the items.This method should be used only when the data provider type is not either
ListDataProviderorBackEndDataProvider.- Specified by:
setItemsin interfaceHasDataView<T,Void,RadioButtonGroupDataView<T>>- Parameters:
dataProvider- DataProvider instance to use, notnull- Returns:
- DataView providing information on the data
-
setItems
public RadioButtonGroupDataView<T> setItems(InMemoryDataProvider<T> inMemoryDataProvider)
Description copied from interface:HasDataViewSets an in-memory data provider for the component to useNote! Using a
ListDataProviderinstead of aInMemoryDataProvideris recommended to get access toListDataViewAPI by usingHasListDataView.setItems(ListDataProvider).- Specified by:
setItemsin interfaceHasDataView<T,Void,RadioButtonGroupDataView<T>>- Parameters:
inMemoryDataProvider- InMemoryDataProvider to use, notnull- Returns:
- DataView providing information on the data
-
setItems
public RadioButtonGroupListDataView<T> setItems(ListDataProvider<T> dataProvider)
Description copied from interface:HasListDataViewSets a ListDataProvider for the component to use and returns aListDataViewthat provides information and allows operations on the items.- Specified by:
setItemsin interfaceHasListDataView<T,RadioButtonGroupListDataView<T>>- Parameters:
dataProvider- ListDataProvider providing items to the component.- Returns:
- ListDataView providing access to the items
-
setItems
@Deprecated public void setItems(Stream<T> streamOfItems)
Deprecated.Because the stream is collected to a list anyway, useHasListDataView.setItems(Collection)instead.
-
getListDataView
public RadioButtonGroupListDataView<T> getListDataView()
Gets the list data view for the RadioButtonGroup. This data view should only be used when the items are in-memory and set with: If the items are not in-memory an exception is thrown.- Specified by:
getListDataViewin interfaceHasListDataView<T,RadioButtonGroupListDataView<T>>- Returns:
- the list data view that provides access to the data bound to the RadioButtonGroup
-
getGenericDataView
public RadioButtonGroupDataView<T> getGenericDataView()
Gets the generic data view for the RadioButtonGroup. This data view should only be used whengetListDataView()is not applicable for the underlying data provider.- Specified by:
getGenericDataViewin interfaceHasDataView<T,Void,RadioButtonGroupDataView<T>>- Returns:
- the generic DataView instance implementing
RadioButtonGroupDataView
-
hasValidValue
protected boolean hasValidValue()
Description copied from class:AbstractSinglePropertyFieldChecks whether the element property has a value that can be converted to the model type. Property changes from the element will be ignored if this method returnsfalse. The default implementation always returntrue.- Overrides:
hasValidValuein classAbstractSinglePropertyField<RadioButtonGroup<T>,T>- Returns:
trueif the element property value can be converted to the model type; otherwisefalse
-
setDataProvider
@Deprecated public void setDataProvider(DataProvider<T,?> dataProvider)
Deprecated.use instead one of thesetItemsmethods which provide access to eitherRadioButtonGroupListDataVieworRadioButtonGroupDataView
-
setItemLabelGenerator
public void setItemLabelGenerator(ItemLabelGenerator<T> itemLabelGenerator)
Sets the item label generator that is used to produce the strings shown in the radio button group for each item. By default,String.valueOf(Object)is used.- Parameters:
itemLabelGenerator- the item label provider to use, not null
-
getItemLabelGenerator
public ItemLabelGenerator<T> getItemLabelGenerator()
Gets the item label generator that is used to produce the strings shown in the radio button group for each item.- Returns:
- the item label generator used, not null
-
setValue
public void setValue(T value)
Description copied from interface:HasValueSets the value of this object. If the new value is not equal togetValue(), fires a value change event. May throwIllegalArgumentExceptionif the value is not acceptable.Implementation note: the implementing class should document whether null values are accepted or not, and override
HasValue.getEmptyValue()if the empty value is notnull.- Specified by:
setValuein interfaceHasValue<AbstractField.ComponentValueChangeEvent<RadioButtonGroup<T>,T>,T>- Overrides:
setValuein classAbstractField<RadioButtonGroup<T>,T>- Parameters:
value- the new value
-
onAttach
protected void onAttach(AttachEvent attachEvent)
Description copied from class:ComponentCalled when the component is attached to a UI.The default implementation does nothing.
This method is invoked before the
AttachEventis fired for the component.
-
onDetach
protected void onDetach(DetachEvent detachEvent)
Description copied from class:ComponentCalled when the component is detached from a UI.The default implementation does nothing.
This method is invoked before the
DetachEventis fired for the component.
-
getDataProvider
@Deprecated public DataProvider<T,?> getDataProvider()
Deprecated.usegetListDataView()orgetGenericDataView()insteadGets the data provider.- Returns:
- the data provider, not
null
-
getItemEnabledProvider
public SerializablePredicate<T> getItemEnabledProvider()
Returns the item enabled predicate.- Returns:
- the item enabled predicate
- See Also:
setItemEnabledProvider(com.vaadin.flow.function.SerializablePredicate<T>)
-
setItemEnabledProvider
public void setItemEnabledProvider(SerializablePredicate<T> itemEnabledProvider)
Sets the item enabled predicate for this radio button group. The predicate is applied to each item to determine whether the item should be enabled (true) 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).- Parameters:
itemEnabledProvider- the item enable predicate, notnull
-
getItemRenderer
public ComponentRenderer<? extends Component,T> getItemRenderer()
Returns the item component renderer.- Returns:
- the item renderer
- See Also:
setRenderer(ComponentRenderer)
-
setRenderer
public void setRenderer(ComponentRenderer<? extends Component,T> renderer)
Sets the item renderer for this radio button group. The renderer is applied to each item to create a component which represents the item.Note: Component acts as a label to the button and clicks on it trigger the radio button. Hence interactive components like DatePicker or ComboBox cannot be used.
- Parameters:
renderer- the item renderer, notnull
-
onEnabledStateChanged
public void onEnabledStateChanged(boolean enabled)
Description copied from class:ComponentHandle component enable state when the enabled state changes.By default this sets or removes the 'disabled' attribute from the element. This can be overridden to have custom handling.
- Overrides:
onEnabledStateChangedin classComponent- Parameters:
enabled- the new enabled state of the component
-
setReadOnly
public void setReadOnly(boolean readOnly)
Description copied from interface:HasValueSets the read-only mode of thisHasValueto given mode. The user can't change the value when in read-only mode.A
HasValuewith a visual component in read-only mode typically looks visually different to signal to the user that the value cannot be edited.- Specified by:
setReadOnlyin interfaceHasValue<AbstractField.ComponentValueChangeEvent<RadioButtonGroup<T>,T>,T>- Specified by:
setReadOnlyin interfaceHasValueAndElement<AbstractField.ComponentValueChangeEvent<RadioButtonGroup<T>,T>,T>- Parameters:
readOnly- a boolean value specifying whether the component is put read-only mode or not
-
isReadOnly
public boolean isReadOnly()
Description copied from interface:HasValueReturns whether thisHasValueis in read-only mode or not.- Specified by:
isReadOnlyin interfaceHasValue<AbstractField.ComponentValueChangeEvent<RadioButtonGroup<T>,T>,T>- Specified by:
isReadOnlyin interfaceHasValueAndElement<AbstractField.ComponentValueChangeEvent<RadioButtonGroup<T>,T>,T>- Returns:
falseif the user can modify the value,trueif not.
-
setRequired
public void setRequired(boolean required)
Specifies that the user must select in a value.NOTE: The required indicator will not be visible, if there is no
labelproperty set for the RadioButtonGroup.- Overrides:
setRequiredin classGeneratedVaadinRadioGroup<RadioButtonGroup<T>,T>- Parameters:
required- the boolean value to set
-
isRequired
public boolean isRequired()
Specifies that the user must select a valueThis property is not synchronized automatically from the client side, so the returned value may not be the same as in client side.
- Returns:
- the
requiredproperty from the webcomponent
-
setErrorMessage
public void setErrorMessage(String errorMessage)
Description copied from class:GeneratedVaadinRadioGroupDescription copied from corresponding location in WebComponent:
Error to show when the input value is invalid.
- Specified by:
setErrorMessagein interfaceHasValidation- Overrides:
setErrorMessagein classGeneratedVaadinRadioGroup<RadioButtonGroup<T>,T>- Parameters:
errorMessage- the String value to set
-
getErrorMessage
public String getErrorMessage()
Gets the current error message from the radio button group.- Specified by:
getErrorMessagein interfaceHasValidation- Returns:
- the current error message
-
setLabel
public void setLabel(String label)
Sets the label for the field.- Specified by:
setLabelin interfaceHasLabel- Overrides:
setLabelin classGeneratedVaadinRadioGroup<RadioButtonGroup<T>,T>- Parameters:
label- value for thelabelproperty in the webcomponent
-
getLabel
public String getLabel()
String used for the label element.
-
isInvalid
public boolean isInvalid()
Description copied from interface:HasValidationReturnstrueif component input is invalid,falseotherwise.- Specified by:
isInvalidin interfaceHasValidation- Returns:
- whether the component input is valid
-
setInvalid
public void setInvalid(boolean invalid)
Description copied from class:GeneratedVaadinRadioGroupDescription copied from corresponding location in WebComponent:
This property is set to true when the value is invalid.
- Specified by:
setInvalidin interfaceHasValidation- Overrides:
setInvalidin classGeneratedVaadinRadioGroup<RadioButtonGroup<T>,T>- Parameters:
invalid- the boolean value to set
-
valueEquals
protected boolean valueEquals(T value1, T value2)
Compares two value instances to each other to determine whether they are equal. Equality is used to determine whether to update internal state and fire an event whensetValue(Object)orAbstractField.setModelValue(Object, boolean)is called. Subclasses can override this method to define an alternative comparison method instead ofObject.equals(Object).- Overrides:
valueEqualsin classAbstractField<RadioButtonGroup<T>,T>- Parameters:
value1- the first instancevalue2- the second instance- Returns:
trueif the instances are equal; otherwisefalse
-
addThemeVariants
public void addThemeVariants(RadioGroupVariant... variants)
Adds theme variants to the component.- Overrides:
addThemeVariantsin classGeneratedVaadinRadioGroup<RadioButtonGroup<T>,T>- Parameters:
variants- theme variants to add
-
removeThemeVariants
public void removeThemeVariants(RadioGroupVariant... variants)
Removes theme variants from the component.- Overrides:
removeThemeVariantsin classGeneratedVaadinRadioGroup<RadioButtonGroup<T>,T>- Parameters:
variants- theme variants to remove
-
add
@Deprecated public void add(Component... components)
Deprecated.since v23.3. This component is not intended to be used as a generic component container, and its implementation ofHasComponentsandHasItemComponentswill be removed in v24.Description copied from interface:HasComponentsAdds the given components as children of this component.In case any of the specified components has already been added to another parent, it will be removed from there and added to this one.
- Specified by:
addin interfaceHasComponents- Parameters:
components- the components to add
-
add
@Deprecated public void add(Collection<Component> components)
Deprecated.since v23.3. This component is not intended to be used as a generic component container, and its implementation ofHasComponentsandHasItemComponentswill be removed in v24.Description copied from interface:HasComponentsAdds the given components as children of this component.In case any of the specified components has already been added to another parent, it will be removed from there and added to this one.
- Specified by:
addin interfaceHasComponents- Parameters:
components- the components to add
-
add
@Deprecated public void add(String text)
Deprecated.since v23.3. This component is not intended to be used as a generic component container, and its implementation ofHasComponentsandHasItemComponentswill be removed in v24.Description copied from interface:HasComponentsAdd the given text as a child of this component.- Specified by:
addin interfaceHasComponents- Parameters:
text- the text to add, notnull
-
remove
@Deprecated public void remove(Component... components)
Deprecated.since v23.3. This component is not intended to be used as a generic component container, and its implementation ofHasComponentsandHasItemComponentswill be removed in v24.Description copied from interface:HasComponentsRemoves the given child components from this component.- Specified by:
removein interfaceHasComponents- Parameters:
components- the components to remove
-
remove
@Deprecated public void remove(Collection<Component> components)
Deprecated.since v23.3. This component is not intended to be used as a generic component container, and its implementation ofHasComponentsandHasItemComponentswill be removed in v24.Description copied from interface:HasComponentsRemoves the given child components from this component.- Specified by:
removein interfaceHasComponents- Parameters:
components- the components to remove
-
removeAll
@Deprecated public void removeAll()
Deprecated.since v23.3. This component is not intended to be used as a generic component container, and its implementation ofHasComponentsandHasItemComponentswill be removed in v24.Description copied from interface:HasComponentsRemoves all contents from this component, this includes child components, text content as well as child elements that have been added directly to this component using theElementAPI. it also removes the children that were added only at the client-side.- Specified by:
removeAllin interfaceHasComponents
-
addComponentAtIndex
@Deprecated public void addComponentAtIndex(int index, Component component)
Deprecated.since v23.3. This component is not intended to be used as a generic component container, and its implementation ofHasComponentsandHasItemComponentswill be removed in v24.Description copied from interface:HasComponentsAdds the given component as child of this component at the specific index.In case the specified component has already been added to another parent, it will be removed from there and added to this one.
- Specified by:
addComponentAtIndexin interfaceHasComponents- Parameters:
index- the index, where the component will be added. The index must be non-negative and may not exceed the children countcomponent- the component to add, value should not be null
-
addComponentAsFirst
@Deprecated public void addComponentAsFirst(Component component)
Deprecated.since v23.3. This component is not intended to be used as a generic component container, and its implementation ofHasComponentsandHasItemComponentswill be removed in v24.Description copied from interface:HasComponentsAdds the given component as the first child of this component.In case the specified component has already been added to another parent, it will be removed from there and added to this one.
- Specified by:
addComponentAsFirstin interfaceHasComponents- Parameters:
component- the component to add, value should not be null
-
addComponents
@Deprecated public void addComponents(T afterItem, Component... components)
Deprecated.since v23.3. This component is not intended to be used as a generic component container, and its implementation ofHasComponentsandHasItemComponentswill be removed in v24.Description copied from interface:HasItemComponentsAdds the components after the given item.- Specified by:
addComponentsin interfaceHasItemComponents<T>- Parameters:
afterItem- item to add components aftercomponents- components to add after item
-
prependComponents
@Deprecated public void prependComponents(T beforeItem, Component... components)
Deprecated.since v23.3. This component is not intended to be used as a generic component container, and its implementation ofHasComponentsandHasItemComponentswill be removed in v24.Description copied from interface:HasItemComponentsAdds the components before the given item.- Specified by:
prependComponentsin interfaceHasItemComponents<T>- Parameters:
beforeItem- item to add components in front ofcomponents- components to add before item
-
getItemPosition
@Deprecated public int getItemPosition(T item)
Deprecated.since v23.3. This component is not intended to be used as a generic component container, and its implementation ofHasComponentsandHasItemComponentswill be removed in v24.Description copied from interface:HasItemComponentsGets the index of the child element that represents the given item.- Specified by:
getItemPositionin interfaceHasItemComponents<T>- Parameters:
item- the item to look for- Returns:
- the index of the child element that represents the item, or -1 if the item is not found
-
-