Enum Class MenuItem.Role
- All Implemented Interfaces:
Serializable,Comparable<MenuItem.Role>,Constable
- Enclosing class:
MenuItem
ABOUT, SETTINGS and QUIT are written where the item
lives in a window's menu bar (Help, Edit, File) and change nothing there. Where the system
keeps the menu bar outside the window, which is macOS, the item leaves that menu: About and
Settings are shown in the application's own menu under the system's label and accelerator
and run the item's action, and Quit is the system's, which asks
Backend.requestQuit() and does not run the item.
The editing roles make the item the command: it has no action of its own, it is
enabled while the widget that has the keyboard can do the command, and choosing it does the
command there, on every system. See MenuItem.of(Role).
A 1.x minor release may add constants to this enum: a switch over it needs a
default branch.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionShows what the application is.An ordinary item.Ends the application.Opens the application's settings. -
Method Summary
Modifier and TypeMethodDescription@Nullable EditCommandstatic MenuItem.RoleReturns the enum constant of this class with the specified name.static MenuItem.Role[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
NONE
An ordinary item. -
ABOUT
Shows what the application is. -
SETTINGS
Opens the application's settings. -
QUIT
Ends the application. -
UNDO
-
REDO
-
CUT
-
COPY
-
PASTE
-
SELECT_ALL
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
editCommand
- Returns:
- the editing command this role is, or
nullfor the other four
-