|
|
Re: how to call another command in handlerclass of a command [message #486595 is a reply to message #486583] |
Fri, 18 September 2009 06:49  |
Eclipse User |
|
|
|
Neha wrote:
> Hi,
> I need to call another command in the handler class of a command. so that
> the handler of other command is executed within this handler. Is there a
> way to do so?
> please let me know
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
IWorkbenchWindow activeWorkbenchWindow = HandlerUtil
.getActiveWorkbenchWindow(event);
if (activeWorkbenchWindow != null) {
IHandlerService handlerService = (IHandlerService)
activeWorkbenchWindow.getService(
IHandlerService.class);
try {
handlerService.executeCommand(TheCommandId, null);
} catch (...) {
}
}
...
return null;
}
where TheCommandId is the commandId of the to be invoked command.
HTH & Greetings from Bremen,
Daniel Krügler
|
|
|
Powered by
FUDForum. Page generated in 0.04165 seconds