Class JToolBar
java.lang.Object
vaadinx.awt.Component
vaadinx.awt.Container
vaadinx.swing.JComponent
vaadinx.swing.JToolBar
- All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, SwingConstants
Emulator for
JToolBar. See D_jtoolbar.- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA toolbar-specific separator, rendered as the same thin bar asJSeparator; its size is stored and read back but not rendered (R_layouts_close_enough). -
Field Summary
Fields inherited from class JComponent
TOOL_TIP_TEXT_KEY, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWFields 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, WIDTHFields inherited from interface SwingConstants
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidTurns aJToolBar.Separatorperpendicular to this toolbar and makes aJButtonnon-default-capable, then adds as usual.voidAppends aJToolBar.Separatorof the default size.voidaddSeparator(Dimension size) Appends aJToolBar.Separator.protected PropertyChangeListenerprotected JButtonThe buttonadd(javax.swing.Action)wraps an Action in: its text is hidden when the Action carries an icon, and its Action listener comes fromcreateActionChangeListener(JButton)when that returns one.protected StringChrome tint rather than the flat surface fill theDivpeer would otherwise select.getComponentAtIndex(int i) intSeparators occupy index positions, as in the JDK.intgetUI()booleanbooleanbooleanprotected StringvoidsetBorderPainted(boolean b) Stored and fired; the effect is declined — the CSS border installed throughJComponent.setBorder(Border)paints either way.voidsetFloatable(boolean b) Stored and fired; the effect is declined — a browser has no detachable toolbars.voidRendered as CSSpaddingon the peer;nullremoves it.voidsetOrientation(int o) Also turns everyJToolBar.Separatorchild perpendicular to the new orientation, as the L&F's listener does on the desktop.voidsetRollover(boolean rollover) Stored under "JToolBar.isRollover" in the client-property table, where the JDK puts it, so the"JToolBar.isRollover"PropertyChangeEvent isJComponent.putClientProperty(Object, Object)'s — which is why its old value isnullon the first call and why the values are boxed (D_property_fanout_audit).voidvoidupdateUI()Methods inherited from class JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, updateMethods inherited from class Container
add, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, addSlotChild, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, fireHierarchyEvent, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, peerContentElement, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, removeSlotChild, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTreeMethods inherited from class Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, applyBackgroundToPeer, applyVisibleToPeer, awtListeners, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, fireComponentEvent, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isThemeDefault, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, peerIs, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, suppressMouseBridge, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, withPeer, withPeerOnLiveUI
-
Constructor Details
-
JToolBar
public JToolBar() -
JToolBar
public JToolBar(int orientation) -
JToolBar
-
JToolBar
- Throws:
IllegalArgumentException- iforientationis neitherHORIZONTALnorVERTICAL, as in the JDK
-
-
Method Details
-
defaultFillCssClass
Chrome tint rather than the flat surface fill theDivpeer would otherwise select. A Swing tool bar reads as raised against the window it sits in, not as part of the page — measured in a browser, the base token is invisible here because it is the same colour as the content behind it, where the container token renders the strip a migrated app expects (D_theme_is_lookandfeel).- Overrides:
defaultFillCssClassin classComponent
-
getComponentIndex
Separators occupy index positions, as in the JDK. -
getComponentAtIndex
- Returns:
- the child at
i, ornullfor an invalid index — the JDK does not throw
-
setMargin
Rendered as CSSpaddingon the peer;nullremoves it. Unguarded, as the JDK's is, so a repeatednullstill fires. -
getMargin
- Returns:
- the margin as set, or a fresh zero
Insetswhile none is
-
isBorderPainted
public boolean isBorderPainted() -
setBorderPainted
public void setBorderPainted(boolean b) Stored and fired; the effect is declined — the CSS border installed throughJComponent.setBorder(Border)paints either way. -
isFloatable
public boolean isFloatable() -
setFloatable
public void setFloatable(boolean b) Stored and fired; the effect is declined — a browser has no detachable toolbars. -
getOrientation
public int getOrientation() -
setOrientation
public void setOrientation(int o) Also turns everyJToolBar.Separatorchild perpendicular to the new orientation, as the L&F's listener does on the desktop.- Throws:
IllegalArgumentException- ifois neitherHORIZONTALnorVERTICAL, even when unchanged — the JDK checks first
-
setRollover
public void setRollover(boolean rollover) Stored under "JToolBar.isRollover" in the client-property table, where the JDK puts it, so the"JToolBar.isRollover"PropertyChangeEvent isJComponent.putClientProperty(Object, Object)'s — which is why its old value isnullon the first call and why the values are boxed (D_property_fanout_audit). The effect is declined: Vaadin buttons paint their own hover state. -
isRollover
public boolean isRollover() -
addSeparator
public void addSeparator()Appends aJToolBar.Separatorof the default size. -
addSeparator
Appends aJToolBar.Separator. The size is stored on it but not rendered (R_layouts_close_enough): every separator paints as the same thin bar. -
add
-
createActionComponent
The buttonadd(javax.swing.Action)wraps an Action in: its text is hidden when the Action carries an icon, and its Action listener comes fromcreateActionChangeListener(JButton)when that returns one. -
createActionChangeListener
- Returns:
null, which keeps the button's default Action listener
-
addImpl
-
getUIClassID
- Overrides:
getUIClassIDin classJComponent
-
updateUI
public void updateUI()- Overrides:
updateUIin classJComponent
-
getUI
- Overrides:
getUIin classJComponent
-
setUI
-
getAccessibleContext
- Specified by:
getAccessibleContextin interfaceAccessible- Overrides:
getAccessibleContextin classComponent
-
paramString
- Overrides:
paramStringin classJComponent
-