Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 10:05 Go to next message
Neha is currently offline NehaFriend
Messages: 52
Registered: July 2009
Member
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 10:41 Go to previous messageGo to next message
Prakash G.R. is currently offline Prakash G.R.Friend
Messages: 621
Registered: July 2009
Senior Member
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 10:49 Go to previous message
Daniel Krügler is currently offline Daniel KrüglerFriend
Messages: 853
Registered: July 2009
Senior Member
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: Mon Jan 20 10:35:38 GMT 2025

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

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

Back to the top