启动应用程序时如何使HandledMenuItem未选中 [英] How to make HandledMenuItem unselected when the application is started

查看:85
本文介绍了启动应用程序时如何使HandledMenuItem未选中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的Application.e4xmi中有HandledMenuItem。但是,如果我选中此项目,请关闭我的应用程序并再次启动它,则该项目保持选中状态。我可以怀疑该项目应该被标记或类似的东西,但是我找不到有关MenuItems标记的任何信息。

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.

在此先感谢。

推荐答案

在应用程序终止时,e4 RCP通常会保持应用程序模型的状态。

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

如果您不想恢复应用程序的持久状态,请使用 -clearPersistedState 标志。您还可以指定 -persistState false 来阻止应用程序在关机期间持久保存状态。

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.

如果您要要保留应用程序状态并只需清除此菜单项,就必须使用模型服务找到 MMenuItem 项,并调用 setSelected(false)方法来清除复选标记。

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.

这篇关于启动应用程序时如何使HandledMenuItem未选中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆