com.atlassian.jira.plugin.keyboardshortcut
Class KeyboardShortcut

java.lang.Object
  extended by com.atlassian.jira.plugin.keyboardshortcut.KeyboardShortcut
All Implemented Interfaces:
Comparable<KeyboardShortcut>

@PublicSpi
public final class KeyboardShortcut
extends Object
implements Comparable<KeyboardShortcut>

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.).

Since:
v4.1

Constructor Summary
KeyboardShortcut(KeyboardShortcutManager.Context context, KeyboardShortcutManager.Operation operation, String parameter, int order, Set<List<String>> shortcuts, String descriptionI18nKey, boolean hidden)
           
 
Method Summary
 int compareTo(KeyboardShortcut shortcut)
           
 KeyboardShortcutManager.Context getContext()
           
 String getDescriptionI18nKey()
           
 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
 Set<List<String>> getShortcuts()
           
 boolean isHidden()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

KeyboardShortcut

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

getContext

public KeyboardShortcutManager.Context getContext()

getShortcuts

public Set<List<String>> getShortcuts()

getOrder

public int getOrder()

getOperation

public KeyboardShortcutManager.Operation getOperation()

getParameter

public String getParameter()

getDescriptionI18nKey

public String getDescriptionI18nKey()

isHidden

public boolean isHidden()

getPrettyShortcut

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.

compareTo

public int compareTo(KeyboardShortcut shortcut)
Specified by:
compareTo in interface Comparable<KeyboardShortcut>

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2002-2012 Atlassian. All Rights Reserved.