|
Eclipse Platform Release 3.1 |
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||
java.lang.Objectorg.eclipse.core.commands.ParameterizedCommand
A command that has had one or more of its parameters specified. This class serves as a utility class for developers that need to manipulate commands with parameters. It handles the behaviour of generating a parameter map and a human-readable name.
| Field Summary | |
|---|---|
static int |
INDEX_PARAMETER_ID
The index of the parameter id in the parameter values. |
static int |
INDEX_PARAMETER_NAME
The index of the human-readable name of the parameter itself, in the parameter values. |
static int |
INDEX_PARAMETER_VALUE_NAME
The index of the human-readable name of the value of the parameter for this command. |
static int |
INDEX_PARAMETER_VALUE_VALUE
The index of the value of the parameter that the command can understand. |
| Constructor Summary | |
|---|---|
ParameterizedCommand(Command command,
Parameterization[] parameterizations)
Constructs a new instance of ParameterizedCommand with
specific values for zero or more of its parameters. |
|
| Method Summary | |
|---|---|
int |
compareTo(Object object)
|
boolean |
equals(Object object)
|
Object |
execute(Object trigger,
Object applicationContext)
Executes this command with its parameters. |
static Collection |
generateCombinations(Command command)
Generates all the possible combinations of command parameterizations for the given command. |
Command |
getCommand()
Returns the base command. |
String |
getId()
Returns the command's base identifier. |
String |
getName()
Returns a human-readable representation of this command with all of its parameterizations. |
Map |
getParameterMap()
Returns the parameter map, as can be used to construct an ExecutionEvent. |
int |
hashCode()
|
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final int INDEX_PARAMETER_ID
public static final int INDEX_PARAMETER_NAME
public static final int INDEX_PARAMETER_VALUE_NAME
public static final int INDEX_PARAMETER_VALUE_VALUE
| Constructor Detail |
public ParameterizedCommand(Command command,
Parameterization[] parameterizations)
ParameterizedCommand with
specific values for zero or more of its parameters.
command - The command that is parameterized; must not be
null.parameterizations - The parameterization of the command. This value may be
null. If it is not null then it
should be an array of quadruples (String[]).
These quadruples are indexed using the INDEX
constants defined in this class. This argument is not copied;
if you need to make changes to it after constructing this
parameterized command, then make a copy yourself.| Method Detail |
public static final Collection generateCombinations(Command command)
throws NotDefinedException
Generates all the possible combinations of command parameterizations for the given command. If the command has no parameters, then this is simply a parameterized version of that command. If a parameter is optional, both the included and not included cases are considered.
If one of the parameters cannot be loaded due to a
ParameterValuesException, then it is simply ignored.
command - The command for which the parameter combinations should be
generated; must not be null.
ParameterizedCommand instances
representing all of the possible combinations. This value is
never empty and it is never null.
NotDefinedException - If the command is not defined.public final int compareTo(Object object)
compareTo in interface Comparablepublic final boolean equals(Object object)
public final Command getCommand()
null, but may be undefined.public final String getId()
null.
public final String getName()
throws NotDefinedException
null.
NotDefinedException - If the underlying command is not defined.public final Map getParameterMap()
ExecutionEvent.
String) to parameter
values (String). This map is never
null, but may be empty.
public final Object execute(Object trigger,
Object applicationContext)
throws ExecutionException,
NotHandledException
trigger - The object that triggered the execution; may be
null.applicationContext - The state of the application at the time the execution was
triggered; may be null.
null.
ExecutionException - If the handler has problems executing this command.
NotHandledException - If there is no handler.public final int hashCode()
public final String toString()
|
Eclipse Platform Release 3.1 |
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||
Guidelines for using Eclipse APIs.
Copyright (c) IBM Corp. and others 2000, 2005. All rights reserved.