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 05:18 Go to next message
Rob is currently offline Rob
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 13:41 Go to previous message
Paul Webster is currently offline Paul Webster
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: Tue Sep 02 07:49:18 EDT 2014

Powered by FUDForum. Page generated in 0.01694 seconds