- java.lang.Object
-
- com.googlecode.lanterna.gui2.AbstractComponent<T>
-
- com.googlecode.lanterna.gui2.AbstractInteractableComponent<MenuItem>
-
- com.googlecode.lanterna.gui2.menu.MenuItem
-
- com.googlecode.lanterna.gui2.menu.Menu
-
- All Implemented Interfaces:
Component
,Interactable
,TextGUIElement
public class Menu extends MenuItem
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.googlecode.lanterna.gui2.menu.MenuItem
MenuItem.DefaultMenuItemRenderer, MenuItem.MenuItemRenderer
-
Nested classes/interfaces inherited from interface com.googlecode.lanterna.gui2.Interactable
Interactable.FocusChangeDirection, Interactable.Result
-
-
Constructor Summary
Constructors Constructor Description Menu(java.lang.String label)
Creates a menu with the specified label
-
Method Summary
All Methods Instance Methods Concrete Methods 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.-
Methods inherited from class com.googlecode.lanterna.gui2.menu.MenuItem
createDefaultRenderer, getLabel, handleKeyStroke
-
Methods inherited from class com.googlecode.lanterna.gui2.AbstractInteractableComponent
afterEnterFocus, afterLeaveFocus, getCursorLocation, getInputFilter, getRenderer, handleInput, isActivationStroke, isEnabled, isFocusable, isFocused, isKeyboardActivationStroke, isMouseActivationStroke, isMouseDown, isMouseDrag, isMouseMove, isMouseUp, onEnterFocus, onLeaveFocus, setEnabled, setInputFilter, takeFocus
-
Methods inherited from class com.googlecode.lanterna.gui2.AbstractComponent
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
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.googlecode.lanterna.gui2.Component
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
-
Methods inherited from interface com.googlecode.lanterna.gui2.TextGUIElement
draw, isInvalid
-
-
-
-
Field Detail
-
subItems
private final java.util.List<MenuItem> subItems
-
-
Method Detail
-
add
public Menu add(MenuItem menuItem)
- Parameters:
menuItem
- The item to add to this menu- Returns:
- Itself
-
onActivated
protected boolean onActivated()
Description copied from class:MenuItem
Method to invoke when a menu item is "activated" by pressing the Enter key.- Overrides:
onActivated
in classMenuItem
- Returns:
- Returns
true
if the action was performed successfully, otherwisefalse
, which will not automatically close the popup window itself.
-
-