|
Cytoscape 2.8.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object cytoscape.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)
Reserve a namespace. |
static CyCommandNamespace |
reserveNamespace(String namespace,
double minVersion,
double maxVersion)
Reserve a namespace. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CyCommandManager()
Method Detail |
---|
public static CyCommandNamespace reserveNamespace(String namespace, double minVersion, double maxVersion) throws RuntimeException
namespace
- the name of the namespaceminVersion
- the minimum version this set of commands supportsmaxVersion
- the maximum version this set of commands supports
RuntimeException
- if a namespace by the requested name already existspublic static CyCommandNamespace reserveNamespace(String namespace) throws RuntimeException
namespace
- the name of the namespace
RuntimeException
- if a namespace by the requested name already existspublic 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
|
Cytoscape 2.8.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |