Skip to main content



      Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Get corresponding view in AbstractHandler.execute()
Get corresponding view in AbstractHandler.execute() [message #552438] Thu, 12 August 2010 05:15 Go to next message
Eclipse UserFriend
Hi,

I defined a class derived from AbstractHandler. This handler is added in a views toolbar. If I activate the toolbar entry, the execute method of the handler is invoked.
How do I get the view instance or id for which the handler is invoked? There can be multiple views in which the handler can be executed. I tried the HandlerUtil.getActivePart(), but the problem here is, that the view is getting active after handlers execute method is invoked. So if e. g. an editor has the focus and the user clicks directly the toolbar icon, the active part is not the view in which the handler icon was clicked, but the editor.
Has someone an idea?

Regards,
Oliver
Re: Get corresponding view in AbstractHandler.execute() [message #553168 is a reply to message #552438] Mon, 16 August 2010 11:18 Go to previous messageGo to next message
Eclipse UserFriend
Your first instinct is correct. Clicking on the command in the view
toolbar and then HandlerUtil.getActivePart(*) should be that
corresponding view. The view activates before the handler#execute(*) is
called.

This is not in a detached window, is it? In any case, if it is not
working that way it is a bug. Please open a bug at
https://bugs.eclipse.org/bugs/enter_bug.cgi?product=Platform &component=UI

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
Re: Get corresponding view in AbstractHandler.execute() [message #553312 is a reply to message #553168] Tue, 17 August 2010 03:02 Go to previous messageGo to next message
Eclipse UserFriend
No it was no detached view.
I have opened a bug report.

Thanks.

Regards,
Oliver
Re: Get corresponding view in AbstractHandler.execute() [message #553431 is a reply to message #553312] Tue, 17 August 2010 09:30 Go to previous message
Eclipse UserFriend
Oliver Pfau wrote:
> No it was no detached view.
> I have opened a bug report.

https://bugs.eclipse.org/bugs/show_bug.cgi?id=322872

--
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:Product Export
Next Topic:Extension Point refuses to connect
Goto Forum:
  


Current Time: Wed Jul 23 09:59:44 EDT 2025

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

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

Back to the top