Package org.apache.pivot.wtk
Class MenuButton
- java.lang.Object
-
- org.apache.pivot.wtk.Component
-
- org.apache.pivot.wtk.Button
-
- org.apache.pivot.wtk.MenuButton
-
- All Implemented Interfaces:
ConstrainedVisual
,Visual
@DefaultProperty("menu") public class MenuButton extends Button
Component that allows a user to select one of several menu options. The options are hidden until the user pushes the button.The repeatable flag is used to trigger "split button" behavior. When true, the button reflects the selected value and allows a user to repeatedly press the left half of the button, firing additional menu selection events for the selected item. Pressing the right half of the button continues to fire button press events and display the menu.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
MenuButton.Skin
MenuButton skin interface.-
Nested classes/interfaces inherited from class org.apache.pivot.wtk.Button
Button.ButtonDataBindMapping, Button.DataRenderer, Button.SelectedBindMapping, Button.State, Button.StateBindMapping
-
Nested classes/interfaces inherited from class org.apache.pivot.wtk.Component
Component.DecoratorSequence, Component.StyleDictionary, Component.UserDataDictionary
-
-
Constructor Summary
Constructors Constructor Description MenuButton()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Window
getListPopup()
Menu
getMenu()
ListenerList<MenuButtonListener>
getMenuButtonListeners()
void
setMenu(Menu menu)
protected void
setSkin(Skin skin)
Sets the skin, replacing any previous skin.void
setToggleButton(boolean toggleButton)
Sets the button's toggle state.-
Methods inherited from class org.apache.pivot.wtk.Button
clear, getAction, getButtonBindingListeners, getButtonData, getButtonDataBindMapping, getButtonDataBindType, getButtonDataKey, getButtonGroup, getButtonListeners, getButtonPressListeners, getButtonStateListeners, getDataRenderer, getQueuedActionDelay, getSelectedBindMapping, getSelectedBindType, getSelectedKey, getState, getStateBindMapping, getStateBindType, getStateKey, isQueuedAction, isSelected, isToggleButton, isTriState, load, press, setAction, setAction, setButtonData, setButtonDataBindMapping, setButtonDataBindType, setButtonDataKey, setButtonGroup, setDataRenderer, setEnabled, setQueuedAction, setQueuedActionDelay, setSelected, setSelectedBindMapping, setSelectedBindType, setSelectedKey, setState, setStateBindMapping, setStateBindType, setStateKey, setTriState, store
-
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, getGraphics, 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, invalidate, isBlocked, isEnabled, isFocusable, isFocused, isMouseOver, isOpaque, isPreferredHeightSet, isPreferredSizeSet, isPreferredWidthSet, isShowing, isValid, isVisible, keyPressed, keyReleased, keyTyped, layout, mapPointFromAncestor, mapPointFromAncestor, mapPointToAncestor, mapPointToAncestor, mouseClick, mouseDown, mouseMove, mouseOut, mouseOver, mouseUp, mouseWheel, offsetToScreen, paint, putStyle, putStyle, reenterMouse, repaint, repaint, repaint, repaint, repaint, repaint, requestFocus, scrollAreaToVisible, scrollAreaToVisible, setAttribute, setAutomationID, setAutomationID, setCursor, setDragSource, setDropTarget, setFocused, setHeight, setHeightLimits, setHeightLimits, setLocation, setLocation, setMaximumHeight, setMaximumWidth, setMenuHandler, setMinimumHeight, setMinimumWidth, setName, setParent, setPreferredHeight, setPreferredSize, setPreferredSize, setPreferredWidth, setSize, setSize, setStyleName, setStyleNames, setStyleNames, setStyles, setStyles, setTooltipDelay, setTooltipText, setTooltipWrapText, setVisible, setWidth, setWidthLimits, setWidthLimits, setX, setY, toString, transferFocus, validate
-
-
-
-
Method Detail
-
setSkin
protected void setSkin(Skin skin)
Description copied from class:Component
Sets the skin, replacing any previous skin.
-
getListPopup
public Window getListPopup()
- Returns:
- the popup window associated with this components skin
-
setToggleButton
@UnsupportedOperation public void setToggleButton(boolean toggleButton)
Description copied from class:Button
Sets the button's toggle state.- Overrides:
setToggleButton
in classButton
- Parameters:
toggleButton
- Whether or not this should be a toggle button.
-
getMenu
public Menu getMenu()
-
setMenu
public void setMenu(Menu menu)
-
getMenuButtonListeners
public ListenerList<MenuButtonListener> getMenuButtonListeners()
-
-