|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
@PublicApi public interface KeyboardShortcutManager
Provides a registry of keyboard shortcuts currently available in JIRA. Keyboard shortcuts can be provided via the
KeyboardShortcut
plugin point.
Nested Class Summary | |
---|---|
static class |
KeyboardShortcutManager.Context
Defines the context under which a keyboard shortcut is valid. |
static class |
KeyboardShortcutManager.Operation
Defines the different operations that can be taken using a KeyboardShortcut . |
Method Summary | |
---|---|
List<KeyboardShortcut> |
getActiveShortcuts()
Returns an ordered list of active KeyboardShortcut s, sorted using the plugin descriptor's
order attribute. |
List<KeyboardShortcut> |
getAllShortcuts()
Returns an ordered list of all KeyboardShortcut s available
using the plugin descriptor's 'order' attribute for sorting. |
String |
includeShortcuts()
Returns a URL to be used to include the currently registered keyboard shortcuts in a page. |
boolean |
isKeyboardShortcutsEnabled()
Returns if the user has keyboard shortcuts enabled. |
void |
registerShortcut(String pluginModuleKey,
KeyboardShortcut shortcut)
Given a complete plugin module key, this method registers a keyboard shortcut with the manager, which will make it available in the UI to end-users. |
void |
requireShortcutsForContext(KeyboardShortcutManager.Context context)
Register that the keyboard shortcuts for the context should be included by includeShortcuts() (in
addition to the global shortcuts, which are always included). |
void |
unregisterShortcut(String pluginModuleKey)
Removes a keyboard shortcut by its complete plugin module key. |
Method Detail |
---|
void registerShortcut(String pluginModuleKey, KeyboardShortcut shortcut)
pluginModuleKey
- the complete plugin module key for this keyboard shortcutshortcut
- the shortcut to registervoid unregisterShortcut(String pluginModuleKey)
pluginModuleKey
- the key to removeList<KeyboardShortcut> getActiveShortcuts()
KeyboardShortcut
s, sorted using the plugin descriptor's
order
attribute.
A shortcut is active if it has not been overriden by another shortcut that uses the same key combination and has
a greater value in its order
attribute (see the keyboard shortcut plugin module documentation).
List<KeyboardShortcut> getAllShortcuts()
KeyboardShortcut
s available
using the plugin descriptor's 'order' attribute for sorting. Implementations should take care to implement this
method as quickly as possible since it will be called very often.
Note this method returns all registered shortcuts, even if they are not in effect (e.g. they have been
overridden). This means that this method may return duplicate shortcuts.
getActiveShortcuts()
void requireShortcutsForContext(KeyboardShortcutManager.Context context)
includeShortcuts()
(in
addition to the global
shortcuts, which are always included).
context
- the context whose keyboard shorcuts should be included (in addition to global
).String includeShortcuts()
/rest/api/1.0/shortcuts/500/f1e3b05a6e6db41e5b77fb8afd7ddde9/shortcuts.js
It has been suggested that webresources (with say the systemcounter) would be a good fit for this, however the
problem is that the systemcounter would have to be updated everytime a plugin is enabled/disabled (so everytime
JIRA is started up), which would have some adverse side effects:
requireShortcutsForContext(com.atlassian.jira.plugin.keyboardshortcut.KeyboardShortcutManager.Context)
boolean isKeyboardShortcutsEnabled()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |