Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Difference between revisions of "E4/EAS/Adapting Objects"
(New page: The adapter pattern is widely used in the Eclipse platform as a way for different classes to retrieve information about a given object. This can usually be seen by how different views reac...) |
(No difference)
|
Revision as of 21:56, 23 October 2009
The adapter pattern is widely used in the Eclipse platform as a way for different classes to retrieve information about a given object. This can usually be seen by how different views react completely different to a given object. Consider how the 'Javadoc' view renders the javadoc specification of a given class but the 'Outline' view provides an overview of the entire class instead of just the item under the current text caret.
Eclipse 3.x API
The existing IAdapterManager can currently either be retrieved directly via a static method (Platform.getAdapterManger()) or queried through via OSGi as a service.
e4 (Java)
The adapter manager can be easily queried for by asking the Eclipse context.
private IAdapterManager getAdapterManager(IEclipseContext context) { return (IAdapterManager) context.get(IAdapterManager.class.getName()); }