Package org.apache.pivot.wtk.content
Class MenuItemDataRenderer
- java.lang.Object
-
- org.apache.pivot.wtk.Component
-
- org.apache.pivot.wtk.Container
-
- org.apache.pivot.wtk.TablePane
-
- org.apache.pivot.wtk.content.MenuItemDataRenderer
-
- All Implemented Interfaces:
java.lang.Iterable<Component>
,Sequence<Component>
,Button.DataRenderer
,ConstrainedVisual
,Renderer
,Visual
public class MenuItemDataRenderer extends TablePane implements Button.DataRenderer
Default menu item data renderer.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.pivot.wtk.TablePane
TablePane.Column, TablePane.ColumnSequence, TablePane.Filler, TablePane.Row, TablePane.RowSequence, TablePane.Skin
-
Nested classes/interfaces inherited from class org.apache.pivot.wtk.Container
Container.EDTChecker
-
Nested classes/interfaces inherited from class org.apache.pivot.wtk.Component
Component.DecoratorSequence, Component.StyleDictionary, Component.UserDataDictionary
-
Nested classes/interfaces inherited from interface org.apache.pivot.collections.Sequence
Sequence.Tree<T>
-
-
Field Summary
Fields Modifier and Type Field Description protected ImageView
imageView
protected Label
keyboardShortcutLabel
protected Label
textLabel
-
Fields inherited from class org.apache.pivot.wtk.TablePane
RELATIVE_SIZE_INDICATOR
-
-
Constructor Summary
Constructors Constructor Description MenuItemDataRenderer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
render(java.lang.Object data, Button button, boolean highlighted)
Prepares the renderer for layout or paint.void
setSize(int width, int height)
NOTE This method should only be called during layout.java.lang.String
toString(java.lang.Object data)
Converts button data to a string representation.-
Methods inherited from class org.apache.pivot.wtk.TablePane
getCellComponent, getColumnAt, getColumnBounds, getColumns, getColumnSpan, getRowAt, getRowBounds, getRows, getRowSpan, getTablePaneAttributeListeners, getTablePaneListeners, remove, setColumnSpan, setRowSpan, setSkin
-
Methods inherited from class org.apache.pivot.wtk.Container
add, assertEventDispatchThread, assertEventDispatchThread, clear, containsFocus, descendantAdded, descendantGainedFocus, descendantLostFocus, descendantRemoved, get, getComponentAt, getContainerListeners, getContainerMouseListeners, getDescendantAt, getFocusTraversalPolicy, getGraphics, getLength, getNamedComponent, indexOf, insert, invalidate, isAncestor, isDoubleBuffered, iterator, layout, load, mouseClick, mouseDown, mouseMove, mouseOut, mouseUp, mouseWheel, move, paint, remove, removeAll, repaint, requestFocus, setDoubleBuffered, setEventDispatchThreadChecker, setFocusTraversalPolicy, setParent, setVisible, store, transferFocus, update
-
Methods inherited from class org.apache.pivot.wtk.Component
checkSkin, clearFocus, contains, copyStyle, copyStyle, getAncestor, getAncestor, getAttribute, getAutomationID, getBaseline, getBaseline, getBounds, getComponentClassListeners, getComponentDataListeners, getComponentDecoratorListeners, getComponentKeyListeners, getComponentListeners, getComponentMouseButtonListeners, getComponentMouseListeners, getComponentMouseWheelListeners, getComponentStateListeners, getComponentStyleListeners, getComponentTooltipListeners, getCursor, getDecoratedBounds, getDecorators, getDisplay, getDragSource, getDropTarget, getFocusedComponent, getHeight, getHeightLimits, getLocation, getMaximumHeight, getMaximumWidth, getMenuHandler, getMinimumHeight, getMinimumWidth, getMouseLocation, getName, getNamedStyles, getParent, getPreferredHeight, getPreferredHeight, getPreferredSize, getPreferredWidth, getPreferredWidth, getScreenBounds, getSize, getSkin, getStyle, getStyle, getStyleBoolean, getStyleBoolean, getStyleColor, getStyleColor, getStyleFont, getStyleFont, getStyleInt, getStyleInt, getStyles, getTextInputMethodListener, getTooltipDelay, getTooltipText, getTooltipWrapText, getTypedStyles, getUserData, getVisibleArea, getVisibleArea, getVisibleArea, getWidth, getWidthLimits, getWindow, getX, getY, indexBoundsCheck, installSkin, isBlocked, isEnabled, isFocusable, isFocused, isMouseOver, isOpaque, isPreferredHeightSet, isPreferredSizeSet, isPreferredWidthSet, isShowing, isValid, isVisible, keyPressed, keyReleased, keyTyped, mapPointFromAncestor, mapPointFromAncestor, mapPointToAncestor, mapPointToAncestor, mouseOver, offsetToScreen, putStyle, putStyle, reenterMouse, repaint, repaint, repaint, repaint, repaint, scrollAreaToVisible, scrollAreaToVisible, setAttribute, setAutomationID, setAutomationID, setCursor, setDragSource, setDropTarget, setEnabled, setFocused, setHeight, setHeightLimits, setHeightLimits, setLocation, setLocation, setMaximumHeight, setMaximumWidth, setMenuHandler, setMinimumHeight, setMinimumWidth, setName, setPreferredHeight, setPreferredSize, setPreferredSize, setPreferredWidth, setSize, setStyleName, setStyleNames, setStyleNames, setStyles, setStyles, setTooltipDelay, setTooltipText, setTooltipWrapText, setWidth, setWidthLimits, setWidthLimits, setX, setY, toString, transferFocus, validate
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.pivot.wtk.ConstrainedVisual
getBaseline, getPreferredHeight, getPreferredSize, getPreferredWidth, setSize
-
-
-
-
Method Detail
-
setSize
public void setSize(int width, int height)
Description copied from class:Component
NOTE This method should only be called during layout. Callers should useComponent.setPreferredSize(int, int)
.- Specified by:
setSize
in interfaceConstrainedVisual
- Overrides:
setSize
in classComponent
- Parameters:
width
- Final computed widthheight
- Final computed height
-
render
public void render(java.lang.Object data, Button button, boolean highlighted)
Description copied from interface:Button.DataRenderer
Prepares the renderer for layout or paint.- Specified by:
render
in interfaceButton.DataRenderer
- Parameters:
data
- The data to render, ornull
if called to calculate preferred height for skins that assume a fixed renderer height.button
- The host component.highlighted
- Iftrue
, the item is highlighted.
-
toString
public java.lang.String toString(java.lang.Object data)
Description copied from interface:Button.DataRenderer
Converts button data to a string representation.- Specified by:
toString
in interfaceButton.DataRenderer
- Parameters:
data
- The button's data.- Returns:
- The data's string representation, or
null
if the data does not have a string representation.Note that this method may be called often during keyboard navigation, so implementations should avoid unnecessary string allocations.
-
-