How to make HandledMenuItem unselected when the application is started

℡╲_俬逩灬. 提交于 2019-12-13 05:37:32

问题


I have HandledMenuItem in my Application.e4xmi. But if I check this item, close my application and start it again, this item stay selected. I can suspect that this item should be tagged or something like this, but I can't find any information about tags for MenuItems.

Thanks in advance.


回答1:


The e4 RCP normally persists the state of the application model when the app terminates.

If you don't want to restore the persisted state of the application use the -clearPersistedState flag. You can also specify -persistState false to stop the app from persisting the state during shutdown.

If you do want to persist the application state and just clear this menu item you will have to find the MMenuItem item using the model service and call the setSelected(false) method to clear the check mark.



来源:https://stackoverflow.com/questions/37388020/how-to-make-handledmenuitem-unselected-when-the-application-is-started

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