- java.lang.Object
-
- com.googlecode.lanterna.gui2.AbstractBasePane<Window>
-
- com.googlecode.lanterna.gui2.AbstractWindow
-
- com.googlecode.lanterna.gui2.MenuPopupWindow
-
public class MenuPopupWindow extends AbstractWindow
This class is aWindow
implementation that automatically sets some common settings that you'd want on specifically popup windows with menu items. It ensures that the window is modal and has a fixed position (rather than letting the window manager choose).
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.googlecode.lanterna.gui2.AbstractBasePane
AbstractBasePane.ContentHolder
-
Nested classes/interfaces inherited from interface com.googlecode.lanterna.gui2.Window
Window.Hint
-
-
Field Summary
Fields Modifier and Type Field Description private Panel
menuItemPanel
-
Fields inherited from class com.googlecode.lanterna.gui2.AbstractBasePane
contentHolder, interactableLookupMap
-
-
Constructor Summary
Constructors Constructor Description MenuPopupWindow(Component parent)
Creates a new popup window with a relative position to the component supplied.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addMenuItem(MenuItem menuItem)
Adds a new menu item to this popup window.-
Methods inherited from class com.googlecode.lanterna.gui2.AbstractWindow
addWindowListener, close, draw, fromGlobal, fromGlobalToContentRelative, fromGlobalToDecoratedRelative, getDecoratedSize, getHints, getPosition, getPostRenderer, getPreferredSize, getSize, getTextGUI, getTitle, handleInput, isVisible, removeWindowListener, self, setCloseWindowWithEscape, setContentOffset, setDecoratedSize, setFixedSize, setHints, setPosition, setSize, setTextGUI, setTitle, setVisible, setWindowPostRenderer, toGlobal, toGlobalFromContentRelative, toGlobalFromDecoratedRelative, waitUntilClosed
-
Methods inherited from class com.googlecode.lanterna.gui2.AbstractBasePane
addBasePaneListener, getBasePaneListeners, getComponent, getCursorPosition, getFocusedInteractable, getMenuBar, getTheme, invalidate, isInvalid, removeBasePaneListener, setComponent, setEnableDirectionBasedMovements, setFocusedInteractable, setFocusedInteractable, setMenuBar, setStrictFocusChange, setTheme
-
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.BasePane
getTheme, setEnableDirectionBasedMovements, setStrictFocusChange, setTheme
-
Methods inherited from interface com.googlecode.lanterna.gui2.Window
getBounds, getComponent, getCursorPosition, getFocusedInteractable, getMenuBar, invalidate, isInvalid, setComponent, setFocusedInteractable, setMenuBar
-
-
-
-
Field Detail
-
menuItemPanel
private final Panel menuItemPanel
-
-
Constructor Detail
-
MenuPopupWindow
public MenuPopupWindow(Component parent)
Creates a new popup window with a relative position to the component supplied.- Parameters:
parent
- Component that this popup menu is triggered from
-
-
Method Detail
-
addMenuItem
public void addMenuItem(MenuItem menuItem)
Adds a new menu item to this popup window. The item will automatically be selected if it's the first one added.- Parameters:
menuItem
- Menu item to add to the popup window.
-
-