|Re: E4 Command Parameter Object Type [message #1065148 is a reply to message #1064971]
||Mon, 24 June 2013 13:54
| Paul Webster
Registered: July 2009
On 06/22/2013 04:57 AM, Markuz Surfing wrote:|
> Is the argument of a command only support String? I have found some post
> on making commands with parameters but all of them are only using String
> as parameter. Is it possible to have an argument of any object type? If
> yes, how?
If you provide a converter, they you can have ParameterizedCommands that
have parameters of different types. The underlying restriction is the
parameters must be able to be converted from Object -> String -> Object.
The types are defined in the org.eclipse.ui.commands extension point,
and although they can be specified in Eclipse4 RCP apps, they can't be
defined yet from the model. See
int, CommandManager) for an example of where they're defined while
running the 4.x Workbench. For how they're currently defined, see
org.eclipse.ui.commands . It should be possible to define your own
commandParameterType programmatically once the CommandManager is available.
Powered by FUDForum
. Page generated in 0.03190 seconds