Class SJRadioButton
java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.AbstractField<VaadinRadioButton, Boolean>
com.vaadin.flow.component.AbstractSinglePropertyField<VaadinRadioButton, Boolean>
com.vaadin.swingbridge.surrogates.VaadinRadioButton
com.vaadin.swingbridge.surrogates.SJRadioButton
- All Implemented Interfaces:
com.vaadin.flow.component.AttachNotifier, com.vaadin.flow.component.BlurNotifier<VaadinRadioButton>, com.vaadin.flow.component.ClickNotifier<VaadinRadioButton>, com.vaadin.flow.component.DetachNotifier, com.vaadin.flow.component.Focusable<VaadinRadioButton>, com.vaadin.flow.component.FocusNotifier<VaadinRadioButton>, com.vaadin.flow.component.HasElement, com.vaadin.flow.component.HasEnabled, com.vaadin.flow.component.HasLabel, com.vaadin.flow.component.HasSize, com.vaadin.flow.component.HasStyle, com.vaadin.flow.component.HasValue<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<VaadinRadioButton, Boolean>, Boolean>, com.vaadin.flow.component.HasValueAndElement<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<VaadinRadioButton, Boolean>, Boolean>, ComponentMixin, ContainerMixin, AbstractButtonMixin, JComponentMixin, ItemSelectable, Serializable
Surrogate for Override surface against
Identical to SJToggleButton's list:
JRadioButton.
Extends VaadinRadioButton (our re-host of the public
vaadin-radio-button web component, since Vaadin's own
RadioButton Java wrapper is package-private) so it reaches
the migrator either through the :emulators JRadioButton
as peer, or as a standalone Vaadin radio button in its own right.
Mirrors SJToggleButton's override surface (SD_toggle_checkbox_first_cut precedent)
JDK'sJRadioButton extends JToggleButton — both use
JToggleButton.ToggleButtonModel, both deliver ButtonModel-driven
Item / Change / Action fan-out, both render a toggleable widget that
fires ValueChange on browser-side click. The only difference
is the chosen peer (Vaadin Checkbox vs.
VaadinRadioButton) and the rendered glyph (square check vs.
circular radio). The peer hierarchy is parallel-not-shared (Vaadin
Checkbox and our VaadinRadioButton have no common
ancestor below Component), so this surrogate duplicates
SJToggleButton's overrides verbatim — same constraint that drove SD_sjpasswordfield
(SJPasswordField duplicating SJTextField).
ButtonGroup mutex lives in the model it is given (D_emulator_button_model)
The surrogate carries no awareness of anyButtonGroup. Under the
emulator-side JRadioButton + vaadinx.swing.ButtonGroup, this
surrogate renders a model whose setSelected consults the group: the
group deselects the previous selection's model, and that sibling's model→peer
push wire drives checked=false under preventPeerEvents — the
same path as a programmatic setSelected from any other caller. A click
the model declines (the lone selection) is re-shown as the model's state.
Standalone (no group): clicks toggle on/off like a checkbox per the underlying ToggleButtonModel pulse. The "radio stays selected when clicked while already-selected" behaviour is a ButtonGroup-vetoes-deselect effect that only materialises once an emulator-layer group is wired around it.
Override surface against AbstractButtonMixin
Identical to SJToggleButton's list: installButtonBindings() (use
ToggleButtonModel + ValueChange wire), setModel(ButtonModel) (extra
model→peer push), setText(String) / getText() (route through
peer's label slot, normalise null→""), setEnabled(boolean) (Java
"classes beat interfaces" redirect), layout setters drop-and-WARN
(shadow DOM doesn't honor host flex), getUIClassID() returns
"RadioButtonUI".- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class com.vaadin.flow.component.AbstractField
com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<C,V> Nested classes/interfaces inherited from interface AbstractButtonMixin
AbstractButtonMixin.ButtonActionPropertyChangeListenerNested classes/interfaces inherited from interface com.vaadin.flow.component.BlurNotifier
com.vaadin.flow.component.BlurNotifier.BlurEvent<C>Nested classes/interfaces inherited from interface com.vaadin.flow.component.FocusNotifier
com.vaadin.flow.component.FocusNotifier.FocusEvent<C>Nested classes/interfaces inherited from interface com.vaadin.flow.component.HasValue
com.vaadin.flow.component.HasValue.ValueChangeEvent<V>, com.vaadin.flow.component.HasValue.ValueChangeListener<E>Nested classes/interfaces inherited from interface JComponentMixin
JComponentMixin.ActionStandin -
Field Summary
Fields inherited from interface JComponentMixin
TOOL_TIP_TEXT_KEY, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW -
Constructor Summary
ConstructorsConstructorDescriptionSJRadioButton(String text) SJRadioButton(String text, boolean selected) SJRadioButton(String text, Icon icon) SJRadioButton(String text, Icon icon, boolean selected) SJRadioButton(Action action) SJRadioButton(Icon icon) SJRadioButton(Icon icon, boolean selected) -
Method Summary
Modifier and TypeMethodDescriptionintintintReads CSSgapback as an int.JDK default is null; no Vaadin counterpart.getText()Abstract — each concrete AbstractButton-lineage surrogate provides its owngetTextvia the parent Vaadin component'sHasTextcontract.Deliberate no-op — L&F key.intintvoidOverride of the mixin's default.protected StringJDK JRadioButton's paramString is essentially empty (returns AbstractButton's).voidsetEnabled(boolean enabled) Java "classes beat interfaces" rule shadows the mixin chain's setEnabled (which carries SD_auto_pce auto-PCE + propagates to model) withHasEnabled's default.voidsetHorizontalAlignment(int alignment) voidsetHorizontalTextPosition(int pos) voidsetIconTextGap(int gap) voidsetModel(ButtonModel newModel) Override ofAbstractButtonMixin.setModel(ButtonModel)to additionally install a model→peer push ItemListener.voidAbstract — each concrete surrogate implements via super (its Vaadin parent's HasText.setText, e.g.voidsetVerticalAlignment(int alignment) voidsetVerticalTextPosition(int pos) Methods inherited from class VaadinRadioButton
getLabel, setLabelMethods inherited from class com.vaadin.flow.component.AbstractSinglePropertyField
getSynchronizationRegistration, hasValidValue, setPresentationValue, setSynchronizedEventMethods inherited from class com.vaadin.flow.component.AbstractField
addValueChangeListener, bindValue, getEmptyValue, getValue, isEmpty, setModelValue, setValue, valueEqualsMethods inherited from class com.vaadin.flow.component.Component
addListener, bindVisible, findAncestor, fireEvent, from, get, getChildren, getElement, getEventBus, getId, getListeners, getLocale, getParent, getTestId, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, onAttach, onDetach, onEnabledStateChanged, removeFromParent, scrollIntoView, scrollIntoView, set, setElement, setId, setTestId, setVisible, whenAttachedMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface AbstractButtonMixin
actionPropertyChanged, addActionListener, addChangeListener, addItemListener, configurePropertiesFromAction, createActionPropertyChangeListener, doClick, doClick, fireActionPerformed, fireItemStateChanged, fireStateChanged, getAction, getActionCommand, getActionListeners, getChangeListeners, getDisabledIcon, getDisabledSelectedIcon, getDisplayedMnemonicIndex, getHideActionText, getItemListeners, getLabel, getMnemonic, getModel, getMultiClickThreshhold, getPressedIcon, getRolloverIcon, getRolloverSelectedIcon, getSelectedIcon, getSelectedObjects, isBorderPainted, isContentAreaFilled, isFocusPainted, isRolloverEnabled, isSelected, removeActionListener, removeChangeListener, removeItemListener, setAction, setActionCommand, setBorderPainted, setContentAreaFilled, setDisabledIcon, setDisabledSelectedIcon, setDisplayedMnemonicIndex, setFocusPainted, setHideActionText, setIcon, setLabel, setMargin, setMnemonic, setMnemonic, setMultiClickThreshhold, setPressedIcon, setRolloverEnabled, setRolloverIcon, setRolloverSelectedIcon, setSelected, setSelectedIcon, synthesizePeerClick, updateUIMethods inherited from interface com.vaadin.flow.component.AttachNotifier
addAttachListenerMethods inherited from interface com.vaadin.flow.component.BlurNotifier
addBlurListenerMethods inherited from interface com.vaadin.flow.component.ClickNotifier
addClickListener, addClickShortcut, addDoubleClickListener, addSingleClickListenerMethods inherited from interface ComponentMixin
_installSwingClass, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, dispatchEvent, doLayout, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getComponentListeners, getCursor, getFocusListeners, getFont, getForeground, getGraphics, getHierarchyBoundsListeners, getHierarchyListeners, getKeyListeners, getLocation, getMaximumSize, getMinimumSize, getMouseListeners, getName, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolTipText, getX, getY, grabFocus, hasFocus, invalidate, isDisplayable, isFocusable, isFocusOwner, isShowing, paint, paintAll, print, printAll, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, revalidate, setBackground, setBounds, setBounds, setCursor, setFocusable, setFont, setForeground, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, transferFocus, transferFocusBackward, transferFocusUpCycle, update, validateMethods inherited from interface ContainerMixin
addContainerListener, getContainerListeners, getLayout, paintComponents, printComponents, removeContainerListener, setLayoutMethods inherited from interface com.vaadin.flow.component.DetachNotifier
addDetachListenerMethods inherited from interface com.vaadin.flow.component.Focusable
addFocusShortcut, blur, focus, focus, getTabIndex, setTabIndexMethods inherited from interface com.vaadin.flow.component.FocusNotifier
addFocusListenerMethods inherited from interface com.vaadin.flow.component.HasElement
getElementMethods inherited from interface com.vaadin.flow.component.HasEnabled
bindEnabled, isEnabledMethods inherited from interface com.vaadin.flow.component.HasSize
bindHeight, bindWidth, getHeight, getHeightUnit, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getWidth, getWidthUnit, setHeight, setHeight, setHeightFull, setMaxHeight, setMaxHeight, setMaxWidth, setMaxWidth, setMinHeight, setMinHeight, setMinWidth, setMinWidth, setSizeFull, setSizeUndefined, setWidth, setWidth, setWidthFullMethods inherited from interface com.vaadin.flow.component.HasStyle
addClassName, addClassNames, bindClassName, bindClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassNameMethods inherited from interface com.vaadin.flow.component.HasValue
clear, getOptionalValueMethods inherited from interface com.vaadin.flow.component.HasValueAndElement
bindReadOnly, bindRequiredIndicatorVisible, isReadOnly, isRequiredIndicatorVisible, setReadOnly, setRequiredIndicatorVisibleMethods inherited from interface JComponentMixin
addAncestorListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getLocation, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, isDoubleBuffered, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paintImmediately, paintImmediately, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeVetoableChangeListener, requestDefaultFocus, resetKeyboardActions, reshape, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDoubleBuffered, setFocusTraversalKeys, setInheritsPopupMenu, setInputMap, setInputVerifier, setNextFocusableComponent, setOpaque, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, unregisterKeyboardAction
-
Constructor Details
-
SJRadioButton
public SJRadioButton() -
SJRadioButton
-
SJRadioButton
-
SJRadioButton
-
SJRadioButton
-
SJRadioButton
-
SJRadioButton
-
SJRadioButton
-
-
Method Details
-
installButtonBindings
public void installButtonBindings()Override of the mixin's default. Same three differences from the default as SJToggleButton: ToggleButtonModel as default,ValueChangeListeneron the peer (HasValue<Boolean>) for browser-originated toggle, no inline-flex CSS seed (the radio-button shadow DOM doesn't honor hostflex-*either). Idempotent.- Specified by:
installButtonBindingsin interfaceAbstractButtonMixin
-
setModel
Override ofAbstractButtonMixin.setModel(ButtonModel)to additionally install a model→peer push ItemListener. Mirrors SJToggleButton's identically-shaped override; catches directmyModel.setSelected(...)mutations in addition to mixin-routed ones.- Specified by:
setModelin interfaceAbstractButtonMixin
-
getText
Description copied from interface:AbstractButtonMixinAbstract — each concrete AbstractButton-lineage surrogate provides its owngetTextvia the parent Vaadin component'sHasTextcontract. SJButton's inheritedButton.getText()(which readstextNode) satisfies this requirement automatically. Mixin-internal callers (e.g.AbstractButtonMixin.getActionCommand()'s text fallback,AbstractButtonMixin.setDisplayedMnemonicIndex(int)'s length validation) reach the concrete impl via virtual dispatch.Pulled out of the mixin's default-implementation surface so the mixin doesn't need a reentry-flag dance to call back into the parent's HasText methods — the rendered text path is owned by the concrete surrogate, end of story.
- Specified by:
getTextin interfaceAbstractButtonMixin
-
setText
Description copied from interface:AbstractButtonMixinAbstract — each concrete surrogate implements via super (its Vaadin parent's HasText.setText, e.g. Button.setText → textSupport) plus the"text"PCE fire. Pulled out of the mixin's default surface for the same reason asAbstractButtonMixin.getText().- Specified by:
setTextin interfaceAbstractButtonMixin
-
setEnabled
public void setEnabled(boolean enabled) Java "classes beat interfaces" rule shadows the mixin chain's setEnabled (which carries SD_auto_pce auto-PCE + propagates to model) withHasEnabled's default. Redirect explicitly so the mixin chain runs.- Specified by:
setEnabledin interfaceComponentMixin- Specified by:
setEnabledin interfacecom.vaadin.flow.component.HasEnabled- Specified by:
setEnabledin interfaceJComponentMixin
-
getHorizontalAlignment
public int getHorizontalAlignment()- Specified by:
getHorizontalAlignmentin interfaceAbstractButtonMixin
-
setHorizontalAlignment
public void setHorizontalAlignment(int alignment) - Specified by:
setHorizontalAlignmentin interfaceAbstractButtonMixin
-
getVerticalAlignment
public int getVerticalAlignment()- Specified by:
getVerticalAlignmentin interfaceAbstractButtonMixin
-
setVerticalAlignment
public void setVerticalAlignment(int alignment) - Specified by:
setVerticalAlignmentin interfaceAbstractButtonMixin
-
getHorizontalTextPosition
public int getHorizontalTextPosition()- Specified by:
getHorizontalTextPositionin interfaceAbstractButtonMixin
-
setHorizontalTextPosition
public void setHorizontalTextPosition(int pos) - Specified by:
setHorizontalTextPositionin interfaceAbstractButtonMixin
-
getVerticalTextPosition
public int getVerticalTextPosition()- Specified by:
getVerticalTextPositionin interfaceAbstractButtonMixin
-
setVerticalTextPosition
public void setVerticalTextPosition(int pos) - Specified by:
setVerticalTextPositionin interfaceAbstractButtonMixin
-
getIconTextGap
public int getIconTextGap()Description copied from interface:AbstractButtonMixinReads CSSgapback as an int. Lossy CSS round-trip per R_vaadin_first — agapCSS value with a non-px unit (we only ever write"Npx") would parse to the JDK default 4.- Specified by:
getIconTextGapin interfaceAbstractButtonMixin
-
setIconTextGap
public void setIconTextGap(int gap) - Specified by:
setIconTextGapin interfaceAbstractButtonMixin
-
getMargin
Description copied from interface:AbstractButtonMixinJDK default is null; no Vaadin counterpart.- Specified by:
getMarginin interfaceAbstractButtonMixin
-
getUIClassID
Description copied from interface:JComponentMixinDeliberate no-op — L&F key.- Specified by:
getUIClassIDin interfaceAbstractButtonMixin- Specified by:
getUIClassIDin interfaceJComponentMixin
-
paramString
JDK JRadioButton's paramString is essentially empty (returns AbstractButton's). Mirrors SJToggleButton's empty body. -
getAccessibleContext
-