Skip to main content
Jump to: navigation, search


Take a look at Eclipse4/RCP/Event Model for a description on the Eclipse UI Event model in general.

Rational for Change

Up until the end of M4 the topic strings used to subscribe to UI events where constructed at run time using the UIEvents.buildTopic() methods like this:

eventBroker.subscribe(UIEvents.buildTopic(UIEvents.UILabel.TOPIC, UIEvents.UILabel.LABEL), handler);

This has the following disadvantages:

  • Long complicated looking code to do simple subscribes
  • Prevents us from using the cleaner @UIEventTopic() dependency injection technique for subscribing to ui events
  • Creating more run time garbage through string concatenation
  • Possibly confusing clients by making them think our eventing model is more complicated than it actually is


New UI Event TOPIC_* constants with fully qualified values where created for making event subscriptions.

In essence the string returned by the old

UIEvents.buildTopic(UIEvents.UILabel.TOPIC, UIEvents.UILabel.LABEL)

is equal to


So a subscribe now looks like:


or you can now use dependency injection

@Inject @Optional private void closeHandler(@UIEventTopic(UIEvents.UILabel.TOPIC_LABEL) Event event) {}

Action Required

The three UIEvents.buildTopic() methods and all the UIEvents TOPIC constants have been deprecated in M4 and will be deleted before M5 ships. If you where using UIEvents.buildTopic(UIEvents.blah.TOPIC) please replace this with direct use of the constant UIEvents.blah.TOPIC_ALL

If you where using UIEvents.buildTopic(UIEvents.blah.TOPIC, UIEvents.blah.someAttribute) please repalce this with the direct use of the constant UIEvents.blah.TOPIC_someAttribute

Subscribing to a particular tag change of a particular attribute through the use of UIEvents.buildTopic(UIEvents.blah.TOPIC, UIEvents.blah.someAttribute, UIEvents.someTag) is no longer supported. In practice it turned out this pattern was never used. Typical event handlers are interested in all changes to a given attribute. Some particular change to some particular attribute was too fine grained a filtering for general use and the over all gains of the new strategy where deemed to outweigh the usefulness of this unused pattern.

methods have been deprecated

Copyright © Eclipse Foundation, Inc. All Rights Reserved.