Community
Participate
Working Groups
Created attachment 227506 [details] Simple patch for enbaling object parameters I've supplied a patch for calling the ParameterValueConverter's convertToObject method while getting the parameter values for execution. That enables the supplement of typed object values to EModelService.createCommand if MCommandParameters has type-id defined. See http://www.eclipse.org/forums/index.php/t/456258/.
I'm not sure that ParameterizedCommand is the appropriate place for this method. In the 3.x world, org.eclipse.core.commands.ExecutionEvent.getObjectParameterForExecution(String) provides this functionality since ExecutionEvent provides the parameters to the IHandler. In Eclipse4 we get parameters directly through the @Execute or @CanExecute method. Right now, we're passing those parameters through in methods like org.eclipse.e4.ui.workbench.renderers.swt.HandledContributionItem.executeItem(Event), org.eclipse.e4.core.commands.internal.HandlerServiceImpl.executeHandler(ParameterizedCommand, IEclipseContext) and org.eclipse.e4.core.commands.internal.HandlerServiceImpl.addParms(ParameterizedCommand, IEclipseContext) Maybe addParms(*) is a good method to convert the objects provided directly into the static context? PW
Created attachment 227544 [details] patch, placing it in addParms I'm not sure about cast to a String of the parameter value.
Created attachment 227641 [details] patch, placing it in addParms Fixed link in doc.
Release as http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=e14cff6969683cb974f000ce377610b8b3a577c6 Thankx Kirill. You can see this as @Execute void execute(@Named("parameter.id") Object obj), right? PW
Yes it is. It works so in my RCP app. I'm very glad.
In 4.3.0.I20130311-2000 PW