Updating UI contributions on Handler switch in e4 application model
Asked Answered
G

1

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.

Goer answered 6/7, 2014 at 20:7 Comment(3)
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).Dives
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.Goer
See my answer to https://mcmap.net/q/1918171/-eclipse-luna-handlers-39-canexecute-methods-not-called/2670892 for how to get toolbar @CanExecute runDives
P
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);
Pitt answered 7/2, 2018 at 7:5 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.