Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.plugin.keybindingchooser.globalchooser
Class GlobalShortcutEntry

java.lang.Object
  extended by net.java.sip.communicator.plugin.keybindingchooser.globalchooser.GlobalShortcutEntry

public class GlobalShortcutEntry
extends Object

Entry for a global shortcut.

Author:
Sebastien Vincent

Constructor Summary
GlobalShortcutEntry(String action, List<AWTKeyStroke> shortcuts)
          Constructor.
 
Method Summary
 boolean equals(Object obj)
          Checks if argument is an instance of this class with the same shortcut and associated action.
 String getAction()
          Returns action string.
 boolean getEditShortcut1()
          Get editable for primary shortcut.
 boolean getEditShortcut2()
          Get editable for secondary shortcut.
 AWTKeyStroke getShortcut()
          Returns primary shortcut if it exists.
 AWTKeyStroke getShortcut2()
          Returns second shortcut if it exists.
static String getShortcutText(AWTKeyStroke shortcut)
          Set the shortcut keystroke and field.
 int hashCode()
          Returns hashcode for this instance.
 boolean isDisabled()
          If this global keybindings is disabled.
 void setAction(String action)
          Set action string
 void setEditShortcut1(boolean value)
          Set editable for primary shortcut.
 void setEditShortcut2(boolean value)
          Set editable for secondary shortcut.
 void setShortcuts(List<AWTKeyStroke> shortcuts)
          Set the shortcuts for this action.
 String toString()
          Provides the string representation of this mapping.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GlobalShortcutEntry

public GlobalShortcutEntry(String action,
                           List<AWTKeyStroke> shortcuts)
Constructor.

Parameters:
action - action
shortcuts - list of shortcut for this action
Method Detail

getShortcut

public AWTKeyStroke getShortcut()
Returns primary shortcut if it exists.

Returns:
primary shortcut if it exists.

getShortcut2

public AWTKeyStroke getShortcut2()
Returns second shortcut if it exists.

Returns:
second shortcut if it exists.

getShortcutText

public static String getShortcutText(AWTKeyStroke shortcut)
Set the shortcut keystroke and field.

Parameters:
shortcut - AWTKeyStroke
Returns:
string representation of the keystroke

setShortcuts

public void setShortcuts(List<AWTKeyStroke> shortcuts)
Set the shortcuts for this action.

Parameters:
shortcuts - list of shortcuts

getAction

public String getAction()
Returns action string.

Returns:
action

setAction

public void setAction(String action)
Set action string

Parameters:
action - action

isDisabled

public boolean isDisabled()
If this global keybindings is disabled.

Returns:
true if this global keybinding is disabled

toString

public String toString()
Provides the string representation of this mapping. The exact details of the representation are unspecified and subject to change but the following format can be considered to be typical:
"BindingEntry (" + Shortcut + " → " + Action + ")"

Overrides:
toString in class Object
Returns:
string representation of entry

equals

public boolean equals(Object obj)
Checks if argument is an instance of this class with the same shortcut and associated action. It does not compare aspects of the display elements.

Overrides:
equals in class Object
Parameters:
obj - element with which to be compared
Returns:
true if argument is an instance of this class with matching shortcut and action, false otherwise

setEditShortcut1

public void setEditShortcut1(boolean value)
Set editable for primary shortcut.

Parameters:
value - value to set

setEditShortcut2

public void setEditShortcut2(boolean value)
Set editable for secondary shortcut.

Parameters:
value - value to set

getEditShortcut1

public boolean getEditShortcut1()
Get editable for primary shortcut.

Returns:
value value to set

getEditShortcut2

public boolean getEditShortcut2()
Get editable for secondary shortcut.

Returns:
value

hashCode

public int hashCode()
Returns hashcode for this instance.

Overrides:
hashCode in class Object
Returns:
hashcode for this instance

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under LGPL license.