Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » One Handler, multiple WorkbenchWindows
One Handler, multiple WorkbenchWindows [message #540309] Tue, 15 June 2010 11:14 Go to next message
Andreas Nusser is currently offline Andreas Nusser
Messages: 7
Registered: October 2009
Junior Member
Hi,

I have the following problem. Within my eclipse plug-in I've defined a command and a handler for it. The handler checks programmatically if it is enabled or not. This setup worked fine until I discovered the "New Window" menu. As it happens to be, in my setup only one handler is instanced, and if I toggle the enabled state, the command is disabled/enabled in all windows. This isn't how I want it to be. The state of the command should only change per workbench window and not globally.

I've searched the web for a solution to the problem but found only this discussion: http://dev.eclipse.org/newslists/news.eclipse.platform.rcp/m sg26823.html (The best explanation of the problem is this entry: http://dev.eclipse.org/newslists/news.eclipse.platform.rcp/m sg31922.html)

Can anyone tell me how to do this or point me to a tutorial explaining it?

Thanks for your help,
Andreas
Re: One Handler, multiple WorkbenchWindows [message #540339 is a reply to message #540309] Tue, 15 June 2010 13:37 Go to previous message
Paul Webster is currently offline Paul Webster
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

In 3.6 you are stuck with that behaviour. i.e. enabled is global state
on the Command. If it's enabled/disabled, that's for the entire workbench.

We hope to avoid that in e4/4.0 by making enabled a question that the
handler must answer in a context, so that the toolitem in view one
doesn't have to have the same enabled state as a toolitem in view two.

PW

--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse .platform.doc.isv/guide/workbench.htm


Previous Topic:How to trim down application size?
Next Topic:How to install a plug-in?
Goto Forum:
  


Current Time: Sat Aug 23 07:35:25 EDT 2014

Powered by FUDForum. Page generated in 0.02266 seconds