Package evo.search.io.service
Class MenuService
- java.lang.Object
-
- evo.search.io.service.MenuService
-
public class MenuService extends Object
DSLJMenu
andJPopupMenu
service.
-
-
Field Summary
Fields Modifier and Type Field Description static int
SEPARATOR
Const to add a separator to a menu.
-
Constructor Summary
Constructors Constructor Description MenuService()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static MenuItem
item(String label, ActionListener action)
Construct a menu item with a label and an action.static MenuItem
item(String label, ActionListener action, MenuShortcut s)
Construct a menu item with a label, an action and a shortcut.static Menu
menu(String text, Object... children)
Construct a named menu with some children.static MenuBar
menuBar(Menu... menus)
Construct a menu bar with some menus.static MenuShortcut
shortcut(char key)
Construct a new menu shortcut with a key char.static MenuShortcut
shortcut(char key, boolean useShiftModifier)
Construct a new menu shortcut with a key char and the shift modifier flag.static MenuShortcut
shortcut(int key)
Construct a new menu shortcut with a key code.static MenuShortcut
shortcut(int key, boolean useShiftModifier)
Construct a new menu shortcut with a key code and the shift modifier flag.
-
-
-
Field Detail
-
SEPARATOR
public static final int SEPARATOR
Const to add a separator to a menu.- See Also:
- Constant Field Values
-
-
Method Detail
-
menuBar
public static MenuBar menuBar(Menu... menus)
Construct a menu bar with some menus.- Parameters:
menus
- menus to add to the menu bar- Returns:
- menu bar with menus
-
menu
public static Menu menu(String text, Object... children)
Construct a named menu with some children.- Parameters:
text
- name of the menuchildren
- items in the menu- Returns:
- a named menu with given items
-
item
public static MenuItem item(String label, ActionListener action, MenuShortcut s)
Construct a menu item with a label, an action and a shortcut.- Parameters:
label
- menu labelaction
- menu actions
- menu item shortcut- Returns:
- menu item with label, action and shortcut
-
item
public static MenuItem item(String label, ActionListener action)
Construct a menu item with a label and an action.- Parameters:
label
- menu labelaction
- menu action- Returns:
- menu item with label, action and shortcut
-
shortcut
public static MenuShortcut shortcut(int key, boolean useShiftModifier)
Construct a new menu shortcut with a key code and the shift modifier flag.- Parameters:
key
- which key code to react touseShiftModifier
- shift must be pressed- Returns:
- menu shortcut
- See Also:
KeyEvent
-
shortcut
public static MenuShortcut shortcut(int key)
Construct a new menu shortcut with a key code. By default, the shift modifier flag is set tofalse
.- Parameters:
key
- which key code to react to- Returns:
- menu shortcut
- See Also:
KeyEvent
-
shortcut
public static MenuShortcut shortcut(char key, boolean useShiftModifier)
Construct a new menu shortcut with a key char and the shift modifier flag.- Parameters:
key
- which key char to react touseShiftModifier
- shift must be pressed- Returns:
- menu shortcut
-
shortcut
public static MenuShortcut shortcut(char key)
Construct a new menu shortcut with a key char. By default, the shift modifier flag is set tofalse
.- Parameters:
key
- which key char to react to- Returns:
- menu shortcut
-
-