Skip to main content



      Home
Home » Eclipse Projects » Rich Client Platform (RCP) » how to call another command in handlerclass of a command
how to call another command in handlerclass of a command [message #486583] Fri, 18 September 2009 06:05 Go to next message
Eclipse UserFriend
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

Thanks in advance!

Regards,
Neha
Re: how to call another command in handlerclass of a command [message #486587 is a reply to message #486583] Fri, 18 September 2009 06:41 Go to previous messageGo to next message
Eclipse UserFriend
Neha wrote:
> I need to call another command in the handler class of a command.

IHandlerService.executeCommand()

- Prakash

Platform UI Team, IBM
http://blog.eclipse-tips.com
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 Go to previous message
Eclipse UserFriend
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
Previous Topic:Subversive in RCP
Next Topic:How to make the workbench requery view sizes?
Goto Forum:
  


Current Time: Sun Aug 31 02:12:58 EDT 2025

Powered by FUDForum. Page generated in 0.03667 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top