Example #1
0
 /**
  * Set shortcut text displayed in this menu item. Displayed as keycode+keycode+keycode (eg.
  * Ctrl+Shift+F5 on Windows and Linux, on Mac ⌘⇧F5). CONTROL_LEFT and CONTROL_RIGHT are mapped to
  * Ctrl. The same goes for Alt and Shift. This DOES NOT set actual hot key for this menu item, it
  * only makes shortcut text visible in item.
  *
  * @param keycodes keycodes from {@link Keys} that are used to determine the shortcut text
  * @return this object for the purpose of chaining methods
  */
 public MenuItem setShortcut(int... keycodes) {
   shortcutLabel.setText(OsUtils.getShortcutFor(keycodes));
   packParentMenu();
   return this;
 }
Example #2
0
 /**
  * Set shortcuts text displayed in this menu item. This DOES NOT set actual hot key for this menu
  * item, it only makes shortcut text visible in item.
  *
  * @param text text that will be displayed
  * @return this object for the purpose of chaining methods
  */
 public MenuItem setShortcut(String text) {
   shortcutLabel.setText(text);
   packParentMenu();
   return this;
 }