Bug 120523 [Commands] parameters: support serializing and deserializing of ParameterizedCommands
UA wants to be able to store a ParameterizedCommand as a String in documents like Help, Cheatsheets and Intro parts. The stored commands will be shown as links and when the user clicks the link we will deserialize from String back to ParameterizedCommand and execute it. The informational content of a ParameterizedCommand amounts to the command id and the ids and values of each of the parameters. We'd like to propose a standard serialization format and offer API for (de)serializing so that others can use it as well as us. The serialization format we have looks like this: commandId?param1Id=value1&param2Id=value2 Breaking it up, looks like this: commandId '?' param1Id '=' value1 '&' param2Id '=' value2 ... The commandId, paramIds and values are UTF-8 encoded to allow arbitrary characters to appear in them. I'm going to attach 2 patches for this. The first patch implements this functionality. It has changes to org.eclipse.core.commands and org.eclipse.ui.workbench The second patch is some JUnit tests to add to org.eclipse.ui.tests.
bundles/org.eclipse.core.commands/src/org/eclipse/core/commands/CommandManager.java
*/
public final class CommandManager extends HandleObjectManager implements
		ICategoryListener, ICommandListener {
	/**
	 * A listener that forwards incoming execution events to execution listeners
	 * on this manager. The execution events will come from any command on this
	 * manager.
	 * 
	 * @since 3.1
	 */
	private final class ExecutionListener implements
			IExecutionListenerWithChecks {
		public void notDefined(String commandId, NotDefinedException exception) {
			if (executionListeners != null) {
				final Object[] listeners = executionListeners.getListeners();
				for (int i = 0; i < listeners.length; i++) {
					final Object object = listeners[i];
					if (object instanceof IExecutionListenerWithChecks) {
						final IExecutionListenerWithChecks listener = (IExecutionListenerWithChecks) object;
						listener.notDefined(commandId, exception);
					}
				}
			}
		}
		public void notEnabled(String commandId, NotEnabledException exception) {
			if (executionListeners != null) {
				final Object[] listeners = executionListeners.getListeners();
				for (int i = 0; i < listeners.length; i++) {
					final Object object = listeners[i];
					if (object instanceof IExecutionListenerWithChecks) {