Skip to main content

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.

Jump to: navigation, search

E4/EAS/Adapting Objects

< E4‎ | EAS
Revision as of 21:56, 23 October 2009 by Unnamed Poltroon (Talk) (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...)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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());
}

Back to the top