How to make HandledMenuItem unselected when the ap

2019-09-16 07:06发布

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条回答
姐就是有狂的资本
2楼-- · 2019-09-16 07:30

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.

查看更多
登录 后发表回答