Class ShortcutManager

java.lang.Object
de.julianweinelt.datacat.dbx.api.ui.ShortcutManager

public class ShortcutManager extends Object
  • Constructor Details

    • ShortcutManager

      public ShortcutManager()
  • Method Details

    • instance

      public static ShortcutManager instance()
    • register

      public void register(ShortcutAction action)
    • register

      public void register(String name, String displayName, KeyStroke stroke)
      Registers a new shortcut action for use in the menu and the editor.
      Parameters:
      name - A String only containing alphanumerical upper case letters and underscores for identifying the action.
      displayName - A display name for better readability
      stroke - A KeyStroke object for the default keyboard shortcut of this action
      Throws:
      IllegalArgumentException - if the given name contains any illegal characters.
    • getAction

      @Deprecated(forRemoval=true, since="1.0.1") public ShortcutAction getAction(String name)
      Deprecated, for removal: This API element is subject to removal in a future version.
      in favor of getActionOptional(String) with null-safety
      Return a registered action by its internal name.
      Parameters:
      name - The internal name of the action
      Returns:
      An ShortcutAction object containing the action, or null if it doesn't exist
    • getActionOptional

      public Optional<ShortcutAction> getActionOptional(String name)