Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Coolbar using Handler/Commands
Coolbar using Handler/Commands [message #1221987] Thu, 19 December 2013 08:39 Go to next message
Jack Kilian is currently offline Jack KilianFriend
Messages: 40
Registered: March 2012
Member
Hi folk,

I impl. Actions and use them in an ActionBarAdvisor.

How can I use in a RCP or RAP Coolbar Handler/Commands instead Actions?
Doing it with e.g. menu items is easy but I found nothing for the Coolbar.

thx jk
Re: Coolbar using Handler/Commands [message #1222071 is a reply to message #1221987] Thu, 19 December 2013 15:46 Go to previous message
Simon Scholz is currently offline Simon ScholzFriend
Messages: 73
Registered: April 2012
Location: Germany
Member
Hi Jack,

which kind of coolbar do you mean?
The "Main"-Coolbar of the Eclipse RCP Application or a Coolbar, which you have created yourself?

Main Toolbar can be accessed like that:


In this example I add a toolbar to the main coolbar and then add a certain command to it.

   <extension
         point="org.eclipse.ui.menus">
      <menuContribution
            allPopups="false"
            locationURI="toolbar:org.eclipse.ui.main.toolbar">
         <toolbar
               id="toolbar"
               label="%toolbar">
            <command
                  commandId="your.command.id"
                  style="push"
                  tooltip="%your.command.tooltip">
            </command>
         </toolbar>
      </menuContribution>



For a "selfmade" Coolbar you should use the org.eclipse.ui.menus.IMenuService to fill the Coolbar with Commands:

IMenuService menuService = (IMenuService) PlatformUI.getWorkbench()
                    .getActiveWorkbenchWindow().getService(IMenuService.class);

CoolBarManager coolbarManager = new org.eclipse.jface.action.CoolBarManager();
coolbarManager.createControl(parent);
menuService.populateContributionManager(
                        coolbarManager,
                        "locationURI.of.your.menuContribution.which.contains.the.desired.command"); //$NON-NLS-1$


I hope this helps.
Otherwise do not hesitate to ask further questions Wink

Best regards,

Simon
Previous Topic:Eclipse Application performace issues Windows 8
Next Topic:SplashHandler progress monitor not showing or updating
Goto Forum:
  


Current Time: Tue Mar 19 06:04:26 GMT 2024

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

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

Back to the top