@PublicApi public final class

KeyboardShortcut

extends Object
implements Comparable<T>
java.lang.Object
   ↳ com.atlassian.jira.plugin.keyboardshortcut.KeyboardShortcut

@PublicApi

This class is designed for plugins to consume (call its methods).

Clients of @PublicApi can expect that programs compiled against a given version will remain binary compatible with later versions of the @PublicApi as per each product's API policy as long as the client does not implement/extend @PublicApi interfaces or classes (refer to each product's API policy for the exact guarantee---usually binary compatibility is guaranteed at least across minor versions).

Note: since @PublicApi interfaces and classes are not designed to be implemented or extended by clients, we may perform certain types of binary-incompatible changes to these classes and interfaces, but these will not affect well-behaved clients that do not extend/implement these types (in general, only classes and interfaces annotated with @PublicSpi are safe to extend/implement).

Class Overview

Defines a keyboard shortcut. A shortcut consists of the keys required for the shortcut (could be multiples for the same shortcut such as gh or gd), a context (some shortcuts only apply on the view issue page), the operation and a parameter for the operation (generally a jQuery selector, but can be anything really.).

Summary

Public Constructors
KeyboardShortcut(String moduleKey, KeyboardShortcutManager.Context context, KeyboardShortcutManager.Operation operation, String parameter, int order, Set<List<String>> shortcuts, String descriptionI18nKey, boolean hidden)
KeyboardShortcut(String moduleKey, KeyboardShortcutManager.Context context, KeyboardShortcutManager.Operation operation, String parameter, int order, Set<List<String>> shortcuts, String descriptionI18nKey, boolean hidden, Condition condition)
Public Methods
int compareTo(KeyboardShortcut shortcut)
Condition getCondition()
KeyboardShortcutManager.Context getContext()
String getDescriptionI18nKey()
String getModuleKey()
KeyboardShortcutManager.Operation getOperation()
int getOrder()
String getParameter()
String getPrettyShortcut(I18nHelper i18nHelper)
Given a set of shortcuts (such as ["gh", "gd"]), this method will produce a pretty internationalized HTML string such as

<kbd>g</kbd> then <kbd>h</kbd>

or

<kbd>g</kbd> then <kbd>d</kbd>

Set<List<String>> getShortcuts()
boolean isHidden()
boolean shouldDisplay(Map<StringObject> context)
Returns whether the user can use the keyboard shortcut.
String toString()
[Expand]
Inherited Methods
From class java.lang.Object
From interface java.lang.Comparable

Public Constructors

public KeyboardShortcut (String moduleKey, KeyboardShortcutManager.Context context, KeyboardShortcutManager.Operation operation, String parameter, int order, Set<List<String>> shortcuts, String descriptionI18nKey, boolean hidden)

public KeyboardShortcut (String moduleKey, KeyboardShortcutManager.Context context, KeyboardShortcutManager.Operation operation, String parameter, int order, Set<List<String>> shortcuts, String descriptionI18nKey, boolean hidden, Condition condition)

Public Methods

public int compareTo (KeyboardShortcut shortcut)

public Condition getCondition ()

public KeyboardShortcutManager.Context getContext ()

public String getDescriptionI18nKey ()

public String getModuleKey ()

public KeyboardShortcutManager.Operation getOperation ()

public int getOrder ()

public String getParameter ()

public String getPrettyShortcut (I18nHelper i18nHelper)

Given a set of shortcuts (such as ["gh", "gd"]), this method will produce a pretty internationalized HTML string such as

<kbd>g</kbd> then <kbd>h</kbd>

or

<kbd>g</kbd> then <kbd>d</kbd>

Parameters
i18nHelper the i18nHelper to user for translations.
Returns
  • pretty printed shortcut.

public Set<List<String>> getShortcuts ()

public boolean isHidden ()

public boolean shouldDisplay (Map<StringObject> context)

Returns whether the user can use the keyboard shortcut.

Parameters
context the context to be passed to the condition
Returns
  • whether the user can use the keyboard shortcut.

public String toString ()