[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Newsgroup Home]
|
[news.eclipse.platform.rcp] Re: how to call another command in handlerclass of a command
|
- From: Daniel Krügler <dsp@xxxxxxx>
- Date: Fri, 18 Sep 2009 12:49:17 +0200
- Newsgroups: eclipse.platform.rcp
- Organization: EclipseCorner
- User-agent: Thunderbird 2.0.0.23 (Windows/20090812)
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