6

I have defined a command global to my e4 application, namely the add command. So, as you can see in my sample application model the command is to used throughout the application (1) and to the repsective handler to be activated on context switch to the resp. parts in (2) and (3).

Now what I am missing, is the possibility to update all UI contributions like (4) allocated to command (1) with the information such as in (2) add contact, and when switching to (3) add account.

What is the general recommended way to update all UI contributions of a command considering the actual context of the command (which handler is active etc.). In Eclipse 3.x we had something like the IElementUpdater which was taking care of doing the respective update.

Thanks for your hints! - Parallely discussed in Eclipse Forum

I worked on finding a solution, and have outlined the current state in my blog.

col.panic
  • 2,944
  • 4
  • 25
  • 31
  • 1
    I'm not aware of an equivalent to IElementUpdater for e4. You could maybe do something in the Handler @CanExecute methods (be aware that Eclipse Luna changes how often these are called). – greg-449 Jul 06 '14 at 20:30
  • Thanks for the hint with @CanExecute not being called the same any more. I am currently investigating some solutions, please see the link to the Eclipse forum. – col.panic Jul 08 '14 at 20:46
  • See my answer to http://stackoverflow.com/q/24413817/2670892 for how to get toolbar @CanExecute run – greg-449 Jul 08 '14 at 20:52

1 Answers1

1

You can inject IEventBroker in your class and below statement, this statement will check for all UI enablement in application

    eventBroker.send(UIEvents.REQUEST_ENABLEMENT_UPDATE_TOPIC, UIEvents.ALL_ELEMENT_ID);
Shashwat
  • 2,342
  • 1
  • 17
  • 33