JIDE 3.5.15

com.jidesoft.shortcut
Class ShortcutSchema

java.lang.Object
  extended by com.jidesoft.shortcut.ShortcutSchema
Direct Known Subclasses:
EditorShortcutSchema, MacOSXEditorShortcutSchema

public class ShortcutSchema
extends Object

A data structure for ShortcutSchema.


Field Summary
protected  EventListenerList _listenerList
          List of listeners
 
Constructor Summary
ShortcutSchema()
          Creates a ShortcutSchema without name.
ShortcutSchema(ShortcutSchema shortcutSchema)
          Copy constructor for ShortcutSchema.
ShortcutSchema(String name)
          Creates a ShortcutSchema with a specified name.
 
Method Summary
 void addShortcut(String command, Shortcut shortcut)
          Adds a new shortcut for a command.
 void addShortcut(String command, Shortcut shortcut, boolean replace)
          Adds a new shortcut for a command.
 void addShortcutListener(ShortcutListener l)
          Adds a listener to the list that's notified each time a change to the data model occurs.
 void clearAllCommandDescriptions()
          Clears all command descriptions.
 void clearAllCommandIcons()
          Clears all command icons.
 void clearAllShortcuts()
          Clears all shortcuts for all commands from this ShortcutSchema.
 void clearCommandDescription(String command)
          Clears the description for a command.
 void clearCommandIcon(String command)
          Clears the icon for a command.
 void clearShortcuts(String command)
          Clears all shortcuts for a command.
 boolean equals(Object o)
           
 List<String> findConflicts(String command, Shortcut shortcut)
           
 List<String> findUsages(Shortcut shortcut)
           
 void fireShortcutAdded(String command, Shortcut shortcut)
           
 void fireShortcutChanged(ShortcutEvent e)
          Forwards the given notification event to all SchemaListeners that registered themselves as listeners for this table model.
 void fireShortcutRemoved(String command, Shortcut shortcut)
           
 String getCommandDescription(String command)
          Gets the description for a command.
 Icon getCommandIcon(String command)
          Gets the icon for a command.
 Iterator<String> getCommands()
          Gets an iterator of all commands.
 List<String> getLocalShortcutKeys()
           
 Shortcut[] getLocalShortcuts(String command)
          Gets the shortcuts for a particular command that are defined in this ShortcutSchema only.
 String getName()
          Gets the name of the ShortcutSchema.
 ShortcutSchema getParent()
          Gets the parent ShortcutSchema.
 List<String> getShortcutKeys()
           
 ShortcutListener[] getShortcutListeners()
          Returns an array of all the table model listeners registered on this model.
 Shortcut[] getShortcuts(String command)
          Gets the shortcuts for a particular command.
 int hashCode()
           
 boolean isActive()
          Checks if this ShortcutSchema is active.
 boolean isEditable()
          Checks if the ShortcutSchema is editable.
 boolean isOverridden(String command)
          Checks if a command is overridden.
 void removeConflicts(String command, Shortcut shortcut)
           
 void removeShortcut(String command, Shortcut shortcut)
          Removes a shortcut from a command.
 void removeShortcutListener(ShortcutListener l)
          Removes a listener from the list that's notified each time a change to the data model occurs.
 void setCommandDescription(String command, String description)
          Assigned an description for a command.
 void setCommandIcon(String command, Icon icon)
          Assigned an icon for a command.
 void setEditable(boolean editable)
          Made ShortcutSchema editable or not editable.
 void setName(String name)
          Sets the name of the ShortcutSchema.
 void setParent(ShortcutSchema parent)
          Sets the parent ShortcutSchema.
 void setShortcuts(String command, List<Shortcut> shortcuts)
          Sets shortcuts for a command.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

_listenerList

protected EventListenerList _listenerList
List of listeners

Constructor Detail

ShortcutSchema

public ShortcutSchema()
Creates a ShortcutSchema without name.


ShortcutSchema

public ShortcutSchema(String name)
Creates a ShortcutSchema with a specified name.

Parameters:
name - the schema name

ShortcutSchema

public ShortcutSchema(ShortcutSchema shortcutSchema)
Copy constructor for ShortcutSchema.

Parameters:
shortcutSchema - the source schema
Method Detail

getName

public String getName()
Gets the name of the ShortcutSchema.

Returns:
the name of the ShortcutSchema.

setName

public void setName(String name)
Sets the name of the ShortcutSchema.

Parameters:
name - the new name of the ShortcutSchema.

isEditable

public boolean isEditable()
Checks if the ShortcutSchema is editable.

Returns:
true or false.

setEditable

public void setEditable(boolean editable)
Made ShortcutSchema editable or not editable.

Parameters:
editable - the flag

getShortcuts

public Shortcut[] getShortcuts(String command)
Gets the shortcuts for a particular command.

Parameters:
command - the action command
Returns:
an array of shortcut for the command.

getLocalShortcuts

public Shortcut[] getLocalShortcuts(String command)
Gets the shortcuts for a particular command that are defined in this ShortcutSchema only. getShortcuts(String) will return a combined list of shortcuts defined in this ShortcutSchema as well as parent ShortcutSchema if any.

Parameters:
command - the action command
Returns:
an array of shortcut for the command.
See Also:
getShortcuts(String)

setShortcuts

public void setShortcuts(String command,
                         List<Shortcut> shortcuts)
Sets shortcuts for a command.

Parameters:
command - the action command
shortcuts - the shortcut list

clearAllShortcuts

public void clearAllShortcuts()
Clears all shortcuts for all commands from this ShortcutSchema.


clearShortcuts

public void clearShortcuts(String command)
Clears all shortcuts for a command.

Parameters:
command - the action command

addShortcut

public void addShortcut(String command,
                        Shortcut shortcut)
Adds a new shortcut for a command.

Parameters:
command - the action command
shortcut - the shortcut

addShortcut

public void addShortcut(String command,
                        Shortcut shortcut,
                        boolean replace)
Adds a new shortcut for a command.

Parameters:
command - the action command
shortcut - the shortcut
replace - true to replace all previous defined shortcuts.

removeShortcut

public void removeShortcut(String command,
                           Shortcut shortcut)
Removes a shortcut from a command.

Parameters:
command - the action command
shortcut - the shortcut

getParent

public ShortcutSchema getParent()
Gets the parent ShortcutSchema.

Returns:
the parent ShortcutSchema.

setParent

public void setParent(ShortcutSchema parent)
Sets the parent ShortcutSchema.

Parameters:
parent - the parent ShortcutSchema.

isActive

public boolean isActive()
Checks if this ShortcutSchema is active. This is a read-only property. To make a ShortcutSchema active, you should use ShortcutSchemaManager.setActiveShortcutSchemaName(String) to guarantee only one ShortcutSchema is active at one time.

Returns:
true if the ShortcutSchema is active.

getShortcutKeys

public List<String> getShortcutKeys()

getLocalShortcutKeys

public List<String> getLocalShortcutKeys()

toString

public String toString()
Overrides:
toString in class Object

findUsages

public List<String> findUsages(Shortcut shortcut)

findConflicts

public List<String> findConflicts(String command,
                                  Shortcut shortcut)

removeConflicts

public void removeConflicts(String command,
                            Shortcut shortcut)

equals

public boolean equals(Object o)
Overrides:
equals in class Object

isOverridden

public boolean isOverridden(String command)
Checks if a command is overridden.

Parameters:
command - the action command
Returns:
true if command is overridden in this ShortcutSchema.

getCommandIcon

public Icon getCommandIcon(String command)
Gets the icon for a command.

Parameters:
command - the action command
Returns:
the icon for a command.

setCommandIcon

public void setCommandIcon(String command,
                           Icon icon)
Assigned an icon for a command. The icon will appear on the command in the command list.

Parameters:
command - the action command
icon - the icon

clearCommandIcon

public void clearCommandIcon(String command)
Clears the icon for a command.

Parameters:
command - the action command

clearAllCommandIcons

public void clearAllCommandIcons()
Clears all command icons.


getCommandDescription

public String getCommandDescription(String command)
Gets the description for a command.

Parameters:
command - the action command
Returns:
the description for a command.

setCommandDescription

public void setCommandDescription(String command,
                                  String description)
Assigned an description for a command. The description will appear on the command in the command list.

Parameters:
command - the action command
description - the command description

clearCommandDescription

public void clearCommandDescription(String command)
Clears the description for a command.

Parameters:
command - the action command

clearAllCommandDescriptions

public void clearAllCommandDescriptions()
Clears all command descriptions.


addShortcutListener

public void addShortcutListener(ShortcutListener l)
Adds a listener to the list that's notified each time a change to the data model occurs.

Parameters:
l - the ShortcutListener

removeShortcutListener

public void removeShortcutListener(ShortcutListener l)
Removes a listener from the list that's notified each time a change to the data model occurs.

Parameters:
l - the ShortcutListener

getShortcutListeners

public ShortcutListener[] getShortcutListeners()
Returns an array of all the table model listeners registered on this model.

Returns:
all of this model's SchemaListeners or an empty array if no table model listeners are currently registered
Since:
1.4
See Also:
addShortcutListener(ShortcutListener), removeShortcutListener(ShortcutListener)

fireShortcutAdded

public void fireShortcutAdded(String command,
                              Shortcut shortcut)

fireShortcutRemoved

public void fireShortcutRemoved(String command,
                                Shortcut shortcut)

fireShortcutChanged

public void fireShortcutChanged(ShortcutEvent e)
Forwards the given notification event to all SchemaListeners that registered themselves as listeners for this table model.

Parameters:
e - the event to be forwarded
See Also:
addShortcutListener(ShortcutListener), ShortcutEvent, EventListenerList

getCommands

public Iterator<String> getCommands()
Gets an iterator of all commands.

Returns:
an iterator of all commands.

hashCode

public int hashCode()
Overrides:
hashCode in class Object

JIDE 3.5.15