Class Button
java.lang.Object
vaadinx.awt.Component
vaadinx.awt.Button
- All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible
Emulator for
Button — a thin delegating shell over its
SButton peer. Not to be confused with
JButton: this is the AWT 1.0 push button, whose
entire API is twelve methods with no ButtonModel, no
Action, no icon, no mnemonic and no selected state. Everything a
migrator touches beyond the members below — setBounds,
setFont, setBackground, setEnabled,
addMouseListener, requestFocus — is inherited
Component.
Responsibility split with the peer:
- Surrogate — the rendered Vaadin Button, the
ClickNotifier→ActionEventfan-out, and the actionCommand-falls-back-to-label rule. - Emulator (here) — the AWT-shape API migrated code compiles
against:
ActionListenerwithsource == thisButton, and alabelfield shadow sogetLabel()returns null verbatim where the surrogate's Vaadin-backedgetText()would say""(R_swing_is_truth over the accepted R_vaadin_first loss).
Leaf peer is locked down per R_leaf_peer_lockdown: java.awt.Button has no
public subclass in java.awt, so there is no protected
(Component peer) ctor and every instance peers over an
SButton.
- See Also:
-
Field Summary
Fields inherited from class Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, FILL_CHROME, FILL_DEFAULT, LEFT_ALIGNMENT, listenerList, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidgetLabel()protected Stringprotected voidThe single funnel every action reaches the listeners through — both the peer click bridge and a user-codeprocessEventcall.protected voidvoidvoidsetActionCommand(String command) voidMethods inherited from class Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addPropertyChangeListener, addPropertyChangeListener, applyBackgroundToPeer, applyComponentOrientation, applyVisibleToPeer, areFocusTraversalKeysSet, awtListeners, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, defaultFillCssClass, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, fireComponentEvent, fireHierarchyEvent, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAlignmentX, getAlignmentY, getBackground, getBaseline, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeys, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusCycleRoot, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isThemeDefault, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paint, paintAll, peerIs, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, revalidate, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setFont, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setMixingCutoutShape, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, suppressMouseBridge, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, update, validate, withPeer, withPeerOnLiveUI
-
Constructor Details
-
Button
JDK chains the no-arg ctor tothis("")— the label is empty, not null.- Throws:
HeadlessException
-
Button
- Parameters:
label- null is legal and reads back fromgetLabel()verbatim- Throws:
HeadlessException- never in practice — the clause is kept for signature fidelity, matchingFrame
-
-
Method Details
-
addNotify
-
getLabel
-
setLabel
-
getActionCommand
-
setActionCommand
-
addActionListener
-
removeActionListener
-
getActionListeners
-
processEvent
- Overrides:
processEventin classComponent
-
processActionEvent
The single funnel every action reaches the listeners through — both the peer click bridge and a user-codeprocessEventcall. AWT subclasses override this (calling super) to intercept actions wholesale, so it must stay the only dispatch path. -
paramString
- Overrides:
paramStringin classComponent
-
getAccessibleContext
- Specified by:
getAccessibleContextin interfaceAccessible- Overrides:
getAccessibleContextin classComponent
-