Mac OS中的RCP应用程序菜单 [英] RCP application menus in Mac OS

查看:86
本文介绍了Mac OS中的RCP应用程序菜单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在努力弄清Mac OS上的RCP应用程序如何使用关于和首选项操作。我使用ActionFactory创建它们,并将它们放置在相关的文件菜单中。在任何地方都可以正常工作。但是,在Mac OS上,这些操作会通过更了解将其他人的良好操作放在何处的方式放置到应用程序菜单中。但是它们当然不起作用。.知道为什么吗?

I am struggling to figure out how RCP applications on Mac OS work with "About" and "Preferences" actions. I create them with ActionFactory and place them to relevant file menus. Works fine everywhere. However, on Mac OS those actions get placed into application menu by something which knows better where to put other peoples good actions. But of course they don't work.. Any idea why?

(蚀目标平台3.7,OSX-最新的El Capitan)

(eclipse target platform 3.7, OSX - the latest El Capitan)

推荐答案

对于3.x样式操作栏顾问,请在正常位置添加菜单项,但使用 ActionContributionItem ,然后在Mac上将菜单项设置为不可见:

For the 3.x style action bar advisor add the menu item in the normal place but use an ActionContributionItem and set the menu item in be invisible on the Mac:

因此,退出以下内容:

IWorkbenchAction quitAction = ActionFactory.QUIT.create(window);
register(quitAction);

ActionContributionItem quitItem = new ActionContributionItem(quitAction);
quitItem.setVisible(!Util.isMac());
menu.add(quitItem);

About和 Preferences也可以这样指定。

'About' and 'Preferences' can also be specified like this.

Util org.eclipse.jface.util.Util

Eclipse将找到这些项目并将其移至正确的位置。

Eclipse will find these items and move them to the correct place.

这篇关于Mac OS中的RCP应用程序菜单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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