Jump to: navigation, search

Difference between revisions of "Eclipse4/UI/Event/Migration"

(New page: Take a look at [[]] 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 co...)
 
m
Line 1: Line 1:
Take a look at [[]] for a description on the Eclipse UI Event model in general.
+
Take a look at [[Eclipse4/RCP/Event Model]] for a description on the Eclipse UI Event model in general.
  
 
== Rational for Change ==
 
== Rational for Change ==

Revision as of 15:37, 2 December 2011

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

Change

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

Now you can use a constant such as UIEvents.UILabel.TOPIC_LABEL to subscribe to events

eventBroker.subscribe(UIEvents.UILabel.TOPIC_LABEL)