Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Any way to get a push button to show up in main menu bar?
Any way to get a push button to show up in main menu bar? [message #638879] Fri, 12 November 2010 21:09 Go to next message
Max Mising name is currently offline Max Mising nameFriend
Messages: 54
Registered: September 2010
Member
I'm on a program where part of the UI requires a button embedded in the main menu area with File,Edit,View,Help,etc. Does anyone know of anyway to do this? A bonus would be if you know how to do it and always embed it the farthest right of the window

Thanks

Max
Re: Any way to get a push button to show up in main menu bar? [message #638974 is a reply to message #638879] Sun, 14 November 2010 09:10 Go to previous messageGo to next message
Devi Vara Prasad Bandaru is currently offline Devi Vara Prasad BandaruFriend
Messages: 100
Registered: March 2010
Location: Hyderabad
Senior Member

Did you try using 'org.eclipse.ui.menus' .
http://www.vogella.de/articles/EclipseCommands/article.html


   <extension
         point="org.eclipse.ui.commands">
      <command
            id="org.eclipse.gef.examples.shapes.SampleCommand"
            name="Command">
      </command>
   </extension>
   <extension
         point="org.eclipse.ui.handlers">
      <handler
            class="org.eclipse.gef.examples.shapes.SampleCommandHandler"
            commandId="org.eclipse.gef.examples.shapes.SampleCommand">
      </handler>
   </extension>
   <extension
         point="org.eclipse.ui.menus">
      <menuContribution
            locationURI="menu:org.eclipse.ui.main.menu">
         <command
               commandId="org.eclipse.gef.examples.shapes.SampleCommand"
               icon="src/org/eclipse/gef/examples/shapes/icons/ellipse24.gif"
               label="Sample Action"
               style="push">
         </command>
      </menuContribution>
   </extension>



Re: Any way to get a push button to show up in main menu bar? [message #639206 is a reply to message #638974] Mon, 15 November 2010 15:49 Go to previous message
Max Mising name is currently offline Max Mising nameFriend
Messages: 54
Registered: September 2010
Member
I tried that and it does add the menu item with the label but still acts like a menu. When you click the button once, it highlights blue and nothing happens. If you move to other menus after this, they drop down. If you click it again, it launches my handler as expected. The problem is that it doesn't behave like a true button on toolbar. I'm pretty sure this is impossible to do but thought I'd ask. Thanks for the reply.

Max
Previous Topic:Dynamic wizard implementation
Next Topic:Open Editor from toolbar button ?
Goto Forum:
  


Current Time: Sat Apr 20 03:57:44 GMT 2024

Powered by FUDForum. Page generated in 0.03159 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top