dsto.dfc.swt.commands
Class CommandRegistry

java.lang.Object
  extended by dsto.dfc.swt.commands.CommandRegistry

public final class CommandRegistry
extends Object

Registry of view to group mappings for commands.

Version:
$Revision$

Constructor Summary
CommandRegistry()
           
 
Method Summary
static String getDisplayName(Command command)
           
static String getDisplayName(Command command, boolean compact)
          Return the name that should be displayed for a command, taking into account whether the command is interactive.
static String getGroupInView(String view, Command command)
           
static char getMenuMnemonic(String menuName)
          Get the default mnemonic that should be used for menu titles.
static String getShortName(Command command)
          Get the short version of a command name eg 'file.Open' becomes 'Open'.
static String[] splitGroup(String group)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CommandRegistry

public CommandRegistry()
Method Detail

getGroupInView

public static String getGroupInView(String view,
                                    Command command)

splitGroup

public static String[] splitGroup(String group)

getDisplayName

public static String getDisplayName(Command command)

getDisplayName

public static String getDisplayName(Command command,
                                    boolean compact)
Return the name that should be displayed for a command, taking into account whether the command is interactive. If the command does not specify a display name, the last component of the command name is used. eg an interactive "file.New" command with no specified display name would be displayed as "New...".

Parameters:
command - The command.
compact - If true, the display name is made more compact by omitting the "..." for interactive commands.
Returns:
The display name for command.

getShortName

public static String getShortName(Command command)
Get the short version of a command name eg 'file.Open' becomes 'Open'.


getMenuMnemonic

public static char getMenuMnemonic(String menuName)
Get the default mnemonic that should be used for menu titles.



Copyright © 2008 Commonwealth of Australia