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/Notifications

< E4‎ | EAS

Information notification can be tied to the progress service and status reporting as they are both related to trying to tell the user that something is happening or has happened.

Eclipse 3.x API

In Eclipse 3.x, workbench parts can notify the user about changes in the part by using the its IWorkbenchSiteProgressService service.

Scheduling notification

A client can schedule jobs to be performed through the progress service. The default implementation of the service turns the part's title bold.

private void schedule(Job job) {
  // retrieve the service
  IWorkbenchSiteProgressService service = (IWorkbenchSiteProgressService) getSite().getService(IWorkbenchSiteProgressService.class);
  // notify the user that the part has changed its content
  service.schedule(job);
}

By default, while jobs are being scheduled through the service, the part's title becomes italicized. Clients however can extend this in their WorkbenchPart subclass.

public void showBusy(boolean busy) {
  super.showBusy(busy);
  if (busy) {
    setPartName("Processing...");
  } else {
    setPartName(fPartName);
  }
}

Completion notification

The default implementation of the service turns the part's title bold.

private void notifyUser() {
  // retrieve the service
  IWorkbenchSiteProgressService service = (IWorkbenchSiteProgressService) getSite().getService(IWorkbenchSiteProgressService.class);
  // notify the user that the part has changed its content
  service.warnOfContentChange();
}

Content from Mik Kersten

The content below was initially contributed by Mik Kersten, for questions use: bug 233142

Problem

Some applications need to inform the user of events in the workbench that may require attention, whether or not the workbench is visible. An increasingly standard way of doing this is to use a desktop notification popup, often appearing for a fixed amount of time in the bottom-right hand of the window. As an example, Mylyn has a custom notification mechanism to inform the user when a Bugzilla report has a new comment. The popup shell is now part of the reusable org.eclipse.mylyn.commons.ui plug-in, and could be moved into Platform (see bug 177974).

In Eclipse UI land, the need for a notification mechanism boils down to some view part IWorkbenchPart requesting attention from the user. UI Experience on Mylyn indicates that it is better to have interactivity come from the pat itself, rather than making the user interact with the tiny and transient popup. In other words, the popup becomes an overview link to one or more notification items whose details are present in the part. The part can be a view, as is the case with Mylyn's Task List, or with a view that shows an event log and desires to inform the user of new events, or with a view that wants to inform the user of progress completion as could the Synchronize view. Or it could be an editor, as is the case with Mylyn's task editor which can show incoming notifications.

Proposal

We already have examples of progress support for views such as Synchronize, whose title will go italics for the duration of a synch. We also have some support for this in editors with form's busy spinners and Mylyn's busy spinners in the editor tab (see bug 175592). The proposed Notification Service would build on this idea to make it possible for a view to queue and display notifications on progress and incoming events.

Back to the top