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/Focus Service

< E4‎ | EAS

Initially contributed by Mik Kersten, for questions use: bug 233142

Problem

Mylyn provides a task-focused interface for Eclipse, which affects the way that view filtering, expansion and decoration work. This boils down to viewers and editors showing only the structural information relevant to a task (e.g. Bugzilla report) instead of all of the underlying information available in the corresponding content provider(s).

The following resources provide an overview of the facilities and their impact on viewers and a summary is provided below.

The following task-focused interface mechanisms affect views and viewers:

  • Filtering: uninteresting elements are filtered from the view by an InterestFilter which is applied when the view is focused. Applying the interest filter causes all other viewer filters to be removed, since the InterestFilter hides all elements by default. Filtering requires the view to be lazily refreshed based on task context model changes in addition to content changes.
  • Expansion and linking: focused viewers always have their nodes expanded by default and are always linked to the editor, since they are much less likely to show a scrollbar.
  • Decoration: all focused viewers use a lightweight platform decorator to indicate interest level (e.g. gray is uninteresting and bold font is a very interesting element).
  • Ranking: sort order can be changed to bring the most interesting elements to the top (e.g. in a table viewer or a content assist list)

The following task-focused mechanisms work on editors:

  • Folding: uninteresting elements are automatically folded away in textual editors.
  • Filtering: uninteresting elements are automatically filtered from graphical editors.

The following task-focused interface mechanisms affect the workbench:

  • View management: views are automatically focused (i.e. facilities listed above are applied) when a task is activated.
  • Editor management: open editors are automatically matched to the task context (e.g. all closed when a task is deactivated, all restored when reactivated, if an element decays in interest the editor auto closes).
  • Perspective management: perspectives are automatically associated with tasks and activated when tasks are switched.

Proposal

Currently Mylyn makes heavy use of Platform internals to support the task-focused interface. In places it leverages or overrides workbench behavior, as with it's management of mementos for restoring editors. In other places it needs to gain reflective access to hidden parts of the workbench, as with the need to add decorators and filters to the Markers views. The proposed Focus Service would remove the need for internals and make it possible to apply the focus mechanisms to a viewer or other workbench facility if that viewer met the service's simple contract (e.g. the view part contains one or more structured viewers), and provide the focus service access to the required UI mechanisms without overly exposing internals (e.g. injecting the task context model refresh policy into the viewer alongside its content model refresh policy).

Back to the top