For the latest stable version, please use Spring Shell 3.3.3!spring-doc.cn

MenuBarView

MenuBarView is a base implementation providing functionality to draw a menu bar. Inherits BoxView.spring-doc.cn

┌─────────────────────────────┐
│ File Help                   │
└─────────────────────────────┘

MenuBarView is constructed with instances of MenuBarItem. MenuBarItem itself takes instances of MenuItem. MenuItem can define its style and action. MenuBarItem can also define a hot key which is used to active particular menu.spring-doc.cn

Runnable quitAction = () -> {};
Runnable aboutAction = () -> {};
MenuBarView menuBar = MenuBarView.of(
	MenuBarItem.of("File",
			MenuItem.of("Quit", MenuItemCheckStyle.NOCHECK, quitAction))
		.setHotKey(Key.f | KeyMask.AltMask),
	MenuBarItem.of("Help",
			MenuItem.of("About", MenuItemCheckStyle.NOCHECK, aboutAction))
);

Default Bindings

Default key bindigs are:spring-doc.cn

Table 1. Key
Command Description

CursorLeftspring-doc.cn

Move selection leftspring-doc.cn

CursorRightspring-doc.cn

Move selection rightspring-doc.cn

Default mouse bindigs are:spring-doc.cn

Table 2. Mouse
Command Description

Released | Button1spring-doc.cn

Choose itemspring-doc.cn

Events

Does not have any events.spring-doc.cn