Component
, Interactable
, TextGUIElement
public class Menu extends MenuItem
Interactable.FocusChangeDirection, Interactable.Result
MenuItem.DefaultMenuItemRenderer, MenuItem.MenuItemRenderer
Constructor | Description |
---|---|
Menu(String label) |
Creates a menu with the specified label
|
Modifier and Type | Method | Description |
---|---|---|
Menu |
add(MenuItem menuItem) |
|
protected boolean |
onActivated() |
Method to invoke when a menu item is "activated" by pressing the Enter key.
|
addTo, calculatePreferredSize, draw, getBasePane, getGlobalPosition, getLayoutData, getParent, getPosition, getPreferredSize, getSize, getTextGUI, getTheme, getThemeDefinition, hasParent, invalidate, isInside, isInvalid, isVisible, onAdded, onAfterDrawing, onBeforeDrawing, onRemoved, runOnGUIThreadIfExistsOtherwiseRunDirect, self, setLayoutData, setPosition, setPreferredSize, setRenderer, setSize, setTheme, setVisible, toBasePane, toGlobal, withBorder
afterEnterFocus, afterLeaveFocus, getCursorLocation, getInputFilter, getRenderer, handleInput, isActivationStroke, isEnabled, isFocusable, isFocused, isKeyboardActivationStroke, isMouseActivationStroke, isMouseDown, isMouseDrag, isMouseMove, isMouseUp, onEnterFocus, onLeaveFocus, setEnabled, setInputFilter, takeFocus
addTo, getBasePane, getGlobalPosition, getLayoutData, getParent, getPosition, getPreferredSize, getSize, getTextGUI, getTheme, getThemeDefinition, hasParent, invalidate, isInside, isVisible, onAdded, onRemoved, setLayoutData, setPosition, setPreferredSize, setSize, setTheme, setVisible, toBasePane, toGlobal, withBorder
createDefaultRenderer, getLabel, handleKeyStroke
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
draw, isInvalid
public Menu(String label)
label
- Label to use for the menu item that will trigger this menu to pop uppublic Menu add(MenuItem menuItem)
menuItem
- The item to add to this menuprotected boolean onActivated()
MenuItem
onActivated
in class MenuItem
true
if the action was performed successfully, otherwise false
, which will not
automatically close the popup window itself.Copyright © 2020. All rights reserved.