SWT/JFace -自定义Menubar在OS X上-如何?

时间:2021-01-11 20:26:02

So there is that silly default top bar with JFace/SWT applications.
Dropdowns do nothing, it does nothing.

因此,有一个愚蠢的默认顶栏带有JFace/SWT应用程序。下拉菜单什么都不做,什么都不做。

I want to customize it as in actually give it some purpose.
Found this tutorial and it looked just great.

我想要自定义它,因为实际上给了它一些目的。找到了本教程,看起来很棒。

The problem is that I can't find that package.
It says:
...we copy the following files from org.eclipse.ui.cocoa into our project:

问题是我找不到那个包裹。它说:…我们从org.eclipse.ui复制以下文件。可可为我们的项目:

I looked on both Eclipse packages (Win/Mac) but there is nothing.
Tried to check the files too which it mentions later on, but no luck either.
Any ideas?

我查看了两个Eclipse包(Win/Mac),但什么都没有。也试着检查文件,它后来提到的,但也没有运气。什么好主意吗?

2 个解决方案

#1


0  

org.eclipse.ui.cocoa is not in the Eclipse 4 release as Mac support has been reworked. You can find it in Eclipse 3.8.2 available here: http://archive.eclipse.org/eclipse/downloads/

引用。由于Mac的支持被重新修改,所以cocoa不在Eclipse 4版本中。您可以在Eclipse 3.8.2中找到它:http://archive.eclipse.org/eclipse/downloads/

#2


0  

Workaround, not the answer:

解决方法,而不是答案:

The tutorial didn't work, nor the copy-in method.
But! You can use this: Display.setAppName("Foo Strikes Back 4");

这个教程没有起作用,也没有复制的方法。但是!您可以使用这个:Display。setAppName(" Foo反击战4 ");

And then the menu bar will have this name at top-left.
It's not that great, and you can't customize what Exit does and so on, so it's just more of a workaround.

然后菜单栏的左上角会有这个名字。它不是很好,而且你不能定制Exit做什么等等,所以它只是一个解决方案。

#1


0  

org.eclipse.ui.cocoa is not in the Eclipse 4 release as Mac support has been reworked. You can find it in Eclipse 3.8.2 available here: http://archive.eclipse.org/eclipse/downloads/

引用。由于Mac的支持被重新修改,所以cocoa不在Eclipse 4版本中。您可以在Eclipse 3.8.2中找到它:http://archive.eclipse.org/eclipse/downloads/

#2


0  

Workaround, not the answer:

解决方法,而不是答案:

The tutorial didn't work, nor the copy-in method.
But! You can use this: Display.setAppName("Foo Strikes Back 4");

这个教程没有起作用,也没有复制的方法。但是!您可以使用这个:Display。setAppName(" Foo反击战4 ");

And then the menu bar will have this name at top-left.
It's not that great, and you can't customize what Exit does and so on, so it's just more of a workaround.

然后菜单栏的左上角会有这个名字。它不是很好,而且你不能定制Exit做什么等等,所以它只是一个解决方案。