Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "E4/Contexts/Lookup"

< E4‎ | Contexts
(New page: == 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_i...)
 
(Lookup Usecases)
Line 1: Line 1:
== 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.
 
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.
Line 7: Line 7:
 
But that translates into a number of different usecases:
 
But that translates into a number of different usecases:
  
#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.
+
#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.
#some information is bounded by a container.  Parts that track the activePart mean the activePart for the window that contains them.
+
#Some information is bounded by a container.   
 +
##Parts that track the activePart mean the activePart for the window that contains them.
 +
##Same with current selection. 
 +
##A handler in a workbench window want's the part service to search for and show parts within that workbench window
 +
#Sometimes lookups expect to get a local value
 +
##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.
 +
##Something like the properties view isn't interested in itself, only other parts (although it listens for the active part and simply ignores itself

Revision as of 09:45, 29 April 2010

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