问题
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