The syntax of the returned {@link String} is as follows:
serialization = commandId [ '(' parameters ')' ]
parameters = parameter [ ',' parameters ]
parameter = parameterId [ '=' parameterValue ]
In the syntax above, sections inside square-brackets are optional. The characters in single quotes ((, ), , and =) indicate literal characters.
commandId represents the command id encoded with separator characters escaped. parameterId and parameterValue represent the parameter ids and values encoded with separator characters escaped. The separator characters (, ), , and = are escaped by prepending a %. This requires % to be escaped, which is also done by prepending a %.
The order of the parameters is not defined (and not important). A missing parameterValue indicates that the value of the parameter is null.
For example, the string shown below represents a serialized parameterized command that can be used to show the Resource perspective:
org.eclipse.ui.perspectives.showPerspective(org.eclipse.ui.perspectives.showPerspective.perspectiveId=org.eclipse.ui.resourcePerspective)
This example shows the more general form with multiple parameters, null value parameters, and escaped = in the third parameter value.
command.id(param1.id=value1,param2.id,param3.id=esc%=val3)
null.
@see CommandManager#deserialize(String)
@since 3.2
| |