Interface Action

All Known Subinterfaces:
Layer1ExternalAction

public interface Action
Represents an action on which users can set shortcuts. This is the most basic entity for internal usage. Strategies should use Layer1ExternalAction instead to register their actions.
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    onShortcutChanged(String actionId, Set<String> shortcuts)
    Will be triggered when a user changes shortcuts (on add, edit or remove) in the Keyboard Shortcuts window.
    boolean
    Will be triggered when a user presses shortcut associated with this action.
  • Method Details

    • performAction

      boolean performAction(String actionId, KeyEvent e)
      Will be triggered when a user presses shortcut associated with this action. If Layer1ExternalAction instance throws an exception when it's called, strategy will be unloaded.
      Parameters:
      actionId - associated with the shortcut
      e - is standard awt key event.
      Returns:
      true means that action is processing this event and no further event transmission is required (to the next listener in the queue) because the event is handled by this action; false if the action will not handle the event (e.g. due to the fact that the focus is not on the target window, etc.), in this case the event will be passed to the next listener in the queue
    • onShortcutChanged

      default void onShortcutChanged(String actionId, Set<String> shortcuts)
      Will be triggered when a user changes shortcuts (on add, edit or remove) in the Keyboard Shortcuts window. Also, known shortcuts related to this action will be sent to this method after the action is registered. The shortcut format is a string representation obtained from the KeyStroke, using KeyStroke.getKeyStrokeForEvent(java.awt.event.KeyEvent) method. If Layer1ExternalAction instance throws an exception when it's called, strategy will be unloaded.
      Parameters:
      actionId - for which shortcut is changed
      shortcuts - set of shortcuts is bound to this action