|
|
|
|
Re: E4 Commands and Handlers [message #787748 is a reply to message #787716] |
Tue, 31 January 2012 23:40 |
|
The following works for me:
Command command = commandService.getCommand("testing.throwingerror.aboutCommand");
// Returns true
System.out.println(command.isDefined());
// Activate Handler
handerService.activateHandler("testing.throwingerror.aboutCommand",new AboutHandler());
ParameterizedCommand cmd = commandService.createCommand("testing.throwingerror.aboutCommand", null);
command = commandService.getCommand("testing.throwingerror.aboutCommand");
// Return null and false, not sure why
System.out.println(command.getHandler());
System.out.println(command.isEnabled());
// Execution works file
System.out.println(handerService.canExecute(cmd));
handerService.executeHandler(cmd);
The only think I don't know is why isEnabled() and getHandler() return false and null.
Maybe Paul can clarify.
|
|
|
Re: E4 Commands and Handlers [message #788242 is a reply to message #787748] |
Wed, 01 February 2012 14:50 |
|
I just asked Paul in IRC.
command.getHandler() and command.isEnabled() are for Eclipse 3.x based API and are not used in Eclipse 4. Hence they will always return null / false in Eclipse 4 applications.
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04897 seconds