|
Cytoscape 2.7.0 (c) 2006,2007 ISB, MSKCC, UCSD | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcytoscape.command.CyCommandManager
public class CyCommandManager
CyCommandManager is a singleton Cytoscape class that provides a global registry
of CyCommand
s and CyCommandNamespace
s. Each CyCommand is added to the registry through the register
method. Commands may be accessed with a combination of command name and namespace.
Constructor Summary | |
---|---|
CyCommandManager()
|
Method Summary | |
---|---|
static CyCommandResult |
execute(String namespace,
String command,
List<Tunable> arguments)
Execute a command |
static CyCommandResult |
execute(String namespace,
String command,
Map<String,Object> arguments)
Execute a command. |
static CyCommandHandler |
getCommand(String namespace,
String name)
return a CyCommandHandler by either name or class name. |
static List<String> |
getCommandList(String namespace)
Get the list of all commands that are currently registered for the specified namespace. |
static Map<String,List<CyCommandHandler>> |
getCommandMap()
Get the list of all commands that are currently registered, organized by namespaces |
static List<String> |
getNamespaceList()
Get the list of all of the currently registered namespaces. |
static void |
register(CyCommandNamespace ns,
String command,
CyCommandHandler com)
register a new CyCommandHandler. |
static CyCommandNamespace |
reserveNamespace(String namespace)
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CyCommandManager()
Method Detail |
---|
public static CyCommandNamespace reserveNamespace(String namespace) throws RuntimeException
RuntimeException
public static void register(CyCommandNamespace ns, String command, CyCommandHandler com) throws RuntimeException
ns
- the namespace for this commandcommand
- the command string that identified this commandcom
- the command handler for the command we want to register
RuntimeException
- if the command is already registeredpublic static CyCommandHandler getCommand(String namespace, String name)
name
- either the name of the class or command
public static List<String> getNamespaceList()
public static Map<String,List<CyCommandHandler>> getCommandMap()
public static List<String> getCommandList(String namespace)
namespace
- the namespace of the commands to retrieve.
public static CyCommandResult execute(String namespace, String command, Map<String,Object> arguments) throws CyCommandException, RuntimeException
namespace
- the namespace for this commandcommand
- the commandarguments
- the argument list to pass to the command
RuntimeException
- is the namespace or command is not yet registered
CyCommandException
- if there is an error with the executionpublic static CyCommandResult execute(String namespace, String command, List<Tunable> arguments) throws CyCommandException, RuntimeException
namespace
- the namespace for this commandcommand
- the commandarguments
- the argument list to pass to the command
RuntimeException
- is the namespace or command is not yet registered
CyCommandException
- if there is an error with the execution
|
www.cytoscape.org | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |