Updating UI contributions on Handler switch in e4 application model

喜你入骨 提交于 2019-12-10 13:28:35

问题


I have defined a command global to my e4 application, namely the add command. So, as you can see in

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.


回答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);


来源:https://stackoverflow.com/questions/24599870/updating-ui-contributions-on-handler-switch-in-e4-application-model

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!