[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.platform.rcp] Re: How to set services into handler

Well ...

Currently when the handler executes, it gets the ExecutionEvent and from that can get the application context.  That's an IEvaluationContext.  From there you have access to any variables coming from a source provider (like the ones listed in org.eclipse.ui.ISources).

As for services, there are 2 kinds.

1) OSGi services.  They can be requested from your BundleContext/ServiceTracker, usually be interacting with your Activator.

2) eclipse framework services.  They're contributed through the org.eclipse.ui.services EP and retrieved through an IServiceLocator.  Current IServiceLocators are any editor or view site, the workbench windows, and the workbench (PlatformUI.getWorkbench()) itself.

currently, you can reach out to a workbench/part/window or use OSGi services and your activator.  We hope to add a way to get an IServiceLocator from your ExecutionEvent or application context.

PW

--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions