com.jidesoft.shortcut
Class Shortcut
java.lang.Object
com.jidesoft.shortcut.Shortcut
- All Implemented Interfaces:
- Serializable, Cloneable
- Direct Known Subclasses:
- KeyboardShortcut, MouseShortcut
public abstract class Shortcut
- extends Object
- implements Cloneable, Serializable
Abstract class for Shortcut. It is the base class for two concrete Shortcuts - KeyboardShortcut
and MouseShortcut
.
A Shortcut has three attributes - name, icon and context. All three are optional.
The name is not used by ShortcutEditor right now.
The icon is displayed in ShortcutEditor before shortcut content in the Shortcut ComboBox (if multiple
shortcuts are allowed) or Shortcut Label (if only single shortcut is allowed). If the icon is null, default icon will
be used. It could be either a keyboard image for keyboard shortcut or a mouse image for mouse shortcut.
The context is used to define the context for this shortcut. There are cases the same shortcut is used in two
or more places. For example, the same keystroke can be defined in text editor area and graph editor area but for
different purpose. That's what the context is for.
There is only one abstract method in this class - isEmpty()
. Subclass needs to implement this method to
determine if the shortcut is empty. If the shortcut is empty, ShortcutEditor will remove it from the schema.
- See Also:
- Serialized Form
Shortcut
public Shortcut()
getName
public String getName()
setName
public void setName(String name)
getIcon
public Icon getIcon()
setIcon
public void setIcon(Icon icon)
getContext
public String getContext()
setContext
public void setContext(String context)
clone
public Object clone()
throws CloneNotSupportedException
- Overrides:
clone
in class Object
- Throws:
CloneNotSupportedException
equals
public boolean equals(Object o)
- Overrides:
equals
in class Object
hashCode
public int hashCode()
- Overrides:
hashCode
in class Object