开发者

Why are my Eclipse RCP mainMenu commands not clickable on mac?

开发者 https://www.devze.com 2023-03-07 13:39 出处:网络
In our Eclipse RCP project, we want to use commands in the top level of our main menu. So the OverviewCommand handler should be called, if you click on \"Übersicht\" like in the screen: http://i.stac

In our Eclipse RCP project, we want to use commands in the top level of our main menu. So the OverviewCommand handler should be called, if you click on "Übersicht" like in the screen: http://i.stack.imgur.com/jrtlq.png

That's our plugin.xml:

<extension point="org.eclipse.ui.menus">
  <menuContribution
        locationURI="menu:org.eclipse.ui.main.menu"&开发者_开发知识库gt;

     <command
           commandId="at.ticketline.command.OverviewCommand"
           label="Übersicht"
           style="push">
     </command>

     <command
              commandId="at.ticketline.command.TicketCommand"
              label="Ticket">
     </command>
     <command
              commandId="at.ticketline.command.KundeCommand"
              label="Kunde">
     </command>
     <command
              commandId="at.ticketline.command.SucheCommand"
              label="Suche">
     </command>

     <command
              commandId="at.ticketline.command.ArtikelCommand"
              label="Artikel">
     </command>
  </menuContribution>
</extension>

On Windows it works, but not on mac. Could you imagine why? It also works when I put the commands into a "menu" tag, but then they would not be on the first level, and that's not what we want.

Thank you for every hint!


You cannot put SWT MenuItems reliably in the main menu bar, which is what you are trying to do with that menuContribution. Windows supports it. Apparently Mac doesn't. Eclipse and its user guidelines definitely don't recommend it.

The behaviour your want is more appropriate for the main toolbar. Use toolbar:org.eclipse.ui.main.toolbar, create a toolbar, and then place your commands inside. If you don't have icons, you should get text.


Does it work when you put the commands inside a menu?

0

精彩评论

暂无评论...
验证码 换一张
取 消