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/Contexts/Lookup

< E4‎ | Contexts
Revision as of 09:45, 29 April 2010 by Pwebster.ca.ibm.com (Talk | contribs) (Lookup Usecases)

Lookup Usecases

We have the IEclipseContext hierarchy and we provide our framework data and framework services by a pattern of lookup strategies. E4/Contexts#Available_Services_in_Eclipse_e4 contains some examples that we look up.

The lookups are done for explicit requests and for DI. Our general guiding principle is "When you ask your context a question, you should get back the appropriate answer."

But that translates into a number of different usecases:

  1. The application context expects to provide the application view of the state. i.e. you should be able to ask the application what the active window is, the current selection for the application, etc.
  2. Some information is bounded by a container.
    1. Parts that track the activePart mean the activePart for the window that contains them.
    2. Same with current selection.
    3. A handler in a workbench window want's the part service to search for and show parts within that workbench window
  3. Sometimes lookups expect to get a local value
    1. In certain cases, especially for editors, they expect the activeEditor to be themselves. More specifically, they expect to execute in a context where the part is themselves.
    2. Something like the properties view isn't interested in itself, only other parts (although it listens for the active part and simply ignores itself

Back to the top