Notifications are part of the Mylyn commons .
To integrate them, add the Mylyn Commons Notifications feature from http://download.eclipse.org/mylyn/releases/latest to the target platform definition. Matching packages -
org.eclipse.mylyn.commons.notifications.uiorg.eclipse.mylyn.commons.notifications.core .
You can add category and event to the notification extension point as follows:
</extension> <extension point="org.eclipse.mylyn.commons.notifications.ui.notifications"> <category icon="icons/obj16/repository.gif" id="myNotificationCategory" label="My Category"> </category> <event categoryId="myNotificationCategory" icon="icons/obj16/some-image.gif" id="myEvent" label="Hellow World"> <defaultHandler sinkId="org.eclipse.mylyn.commons.notifications.sink.Popup"> </defaultHandler> <description> This is the description of the event. </description> </event> </extension>
To trigger a notification, use the NotificationService as follows:
AbstractUiNotification notification = ... NotificationsUi.getService().notify( asList( notification ) );
notification must be a subclass of AbstractUiNotification , where eventId passed to the constructor must match the name from the extension.
The notification module also adds a preference page in the General> Notifications section, which allows the user to choose which notifications should be shown.
source share