Class SButton
java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.button.Button
com.vaadin.swingbridge.surrogates.SButton
- All Implemented Interfaces:
com.vaadin.flow.component.AttachNotifier, com.vaadin.flow.component.BlurNotifier<com.vaadin.flow.component.button.Button>, com.vaadin.flow.component.ClickNotifier<com.vaadin.flow.component.button.Button>, com.vaadin.flow.component.DetachNotifier, com.vaadin.flow.component.Focusable<com.vaadin.flow.component.button.Button>, com.vaadin.flow.component.FocusNotifier<com.vaadin.flow.component.button.Button>, com.vaadin.flow.component.HasAriaLabel, com.vaadin.flow.component.HasElement, com.vaadin.flow.component.HasEnabled, com.vaadin.flow.component.HasSize, com.vaadin.flow.component.HasStyle, com.vaadin.flow.component.HasText, com.vaadin.flow.component.HasTheme, com.vaadin.flow.component.shared.HasPrefix, com.vaadin.flow.component.shared.HasSuffix, com.vaadin.flow.component.shared.HasThemeVariant<com.vaadin.flow.component.button.ButtonVariant>, com.vaadin.flow.component.shared.HasTooltip, ComponentMixin, Serializable
Surrogate for Why not
Button — the AWT 1.0 push button, not
JButton. Extends Vaadin Button directly
(is-a) and picks up the AWT Component API from
ComponentMixin.
Why not AbstractButtonMixin
SJButton reaches its ActionEvent fan-out through
AbstractButtonMixin's ButtonModel
armed/pressed pulse. java.awt.Button has no model, no
Action, no icon, no mnemonic and no selected state — reusing the
Swing mixin would graft a ButtonModel state machine and a
getModel() / setAction() / isSelected() surface
onto a surrogate whose JDK original has none of them. The overlap is the
~40 lines of listener fan-out below, and duplicating it is the cheaper
mistake than a shared base with shallow commonality. The click wiring is
the same shape R_vaadin_first sanctions for a shared subscription: one Vaadin
ClickNotifier subscription drives an EventListenerList
fan-out.
State
actionCommand is stored (a single field, no Store class
warranted) — R_vaadin_first-legitimate because it is the ActionEvent payload,
i.e. UI functionality, not an API round-trip shadow. label is
not stored: it routes to the Vaadin Button's own
getText/setText, so setLabel(null) reads back as
"" (accepted R_vaadin_first loss, same contract as SJButton). The emulator
vaadinx.awt.Button keeps a field shadow so its getLabel()
returns null verbatim per R_swing_is_truth.- See Also:
-
Nested Class Summary
Nested 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.HasText
com.vaadin.flow.component.HasText.WhiteSpace -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidFalls back to the label when never set, matching AWT.getLabel()AWT's name for the caption.protected StringAWT'sButton.paramStringappends only the label.protected voidAWT's dispatch hook.voidvoidsetActionCommand(String command) voidsetEnabled(boolean enabled) VaadinHasEnabled's concrete default shadows the mixin'ssetEnabled(which carries SD_auto_pce's auto-PCE).voidMethods inherited from class com.vaadin.flow.component.button.Button
addBlurListener, addFocusListener, addFocusShortcut, bindEnabled, bindText, click, clickInClient, getIcon, getText, isAutofocus, isDisableOnClick, isIconAfterText, remove, setAutofocus, setDisableOnClick, setIcon, setIconAfterText, setTextMethods 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 com.vaadin.flow.component.AttachNotifier
addAttachListenerMethods 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, setToolTipText, transferFocus, transferFocusBackward, transferFocusUpCycle, update, validateMethods inherited from interface com.vaadin.flow.component.DetachNotifier
addDetachListenerMethods inherited from interface com.vaadin.flow.component.Focusable
blur, focus, focus, getTabIndex, setTabIndexMethods inherited from interface com.vaadin.flow.component.HasAriaLabel
getAriaLabel, getAriaLabelledBy, setAriaLabel, setAriaLabelledBy, setAriaLabelledByMethods 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.shared.HasPrefix
getPrefixComponent, setPrefixComponentMethods 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.shared.HasSuffix
getSuffixComponent, setSuffixComponentMethods inherited from interface com.vaadin.flow.component.HasText
getWhiteSpace, setWhiteSpaceMethods inherited from interface com.vaadin.flow.component.HasTheme
addThemeName, addThemeNames, bindThemeName, bindThemeNames, getThemeName, getThemeNames, hasThemeName, removeThemeName, removeThemeNames, setThemeName, setThemeNameMethods inherited from interface com.vaadin.flow.component.shared.HasThemeVariant
addThemeVariants, bindThemeVariant, bindThemeVariants, removeThemeVariants, setThemeVariant, setThemeVariants, setThemeVariantsMethods inherited from interface com.vaadin.flow.component.shared.HasTooltip
getTooltip, setTooltipMarkdown, setTooltipText
-
Constructor Details
-
SButton
public SButton() -
SButton
-
-
Method Details
-
getLabel
AWT's name for the caption. Reads the VaadinButtontext, so a label never set reads back as""rather than AWT's null — the R_vaadin_first loss the class javadoc names. -
setLabel
-
getActionCommand
Falls back to the label when never set, matching AWT. -
setActionCommand
-
addActionListener
-
removeActionListener
-
getActionListeners
-
processActionEvent
AWT's dispatch hook. Overriding it (and calling super) is the documented way forjava.awt.Buttonsubclasses to intercept every action before its listeners see it, so it stays the single funnel the peer click routes through. -
setEnabled
public void setEnabled(boolean enabled) VaadinHasEnabled's concrete default shadows the mixin'ssetEnabled(which carries SD_auto_pce's auto-PCE). Redirect explicitly, same asSJButton.- Specified by:
setEnabledin interfaceComponentMixin- Specified by:
setEnabledin interfacecom.vaadin.flow.component.HasEnabled- Overrides:
setEnabledin classcom.vaadin.flow.component.button.Button
-
paramString
AWT'sButton.paramStringappends only the label. -
getAccessibleContext
-