Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Access handler reference
Access handler reference [message #336063] Mon, 18 May 2009 09:18 Go to next message
Rob is currently offline RobFriend
Messages: 27
Registered: July 2009
Junior Member
Hi,
Would anyone know how to access the instance of a handler, given the
command ID? I know the handler is instantiated by the workbench, and I
need call a method on it - i'd rather not instantiate it again.

Cheers!
Re: Access handler reference [message #336086 is a reply to message #336063] Wed, 20 May 2009 17:41 Go to previous message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

You can't get to a handler, at least not from the framework.

You could have your handler post itself to your plugin Activator, so you
can retrieve it from there once it is created.

ex: class MyHandler {....
public MyHandler() {
Activator.getDefault().setHandler(this);
}....}

Then you can use it Activator.getDefault().getHandler()!=null etc


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/ganymede/index.jsp?topic=/org.eclips e.platform.doc.isv/guide/workbench.htm


Previous Topic:Auto close of editor area when last editor closed
Next Topic:Menu bar not checking handler enablement
Goto Forum:
  


Current Time: Fri Apr 26 04:45:30 GMT 2024

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

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

Back to the top