Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » dynamic contribution and declarative commands in toolbar
dynamic contribution and declarative commands in toolbar [message #645798] Mon, 20 December 2010 16:08
Luca Ferrari is currently offline Luca FerrariFriend
Messages: 159
Registered: November 2009
Senior Member
Hi all,
I'm switching a toolbar made by declarative commands (i.e., commands declared in the plugin.xml) to a dynamic contribution that places buttons and other controls on the toolbar depending on some run-time information. The fact is that I'd like to keep as much as possible some declarative behaviour of the toolbar, so I'd like to have the fixed commands still declarative, and the dynamic ones generated at run-time.
I've therefore tried doing like the following:

<menuContribution
            locationURI="toolbar:org.eclipse.ui.main.toolbar">
         <toolbar
               id="hrpm.rcp.toolbar.main">
            <separator
                  name="hrpm.rcp.toolbar.separator0"
                  visible="true">
            </separator>
            <command
                  commandId="org.eclipse.ui.perspectives.showPerspective"
                  icon="img/permission.png"
                  id="hrpm.rcp.menu.perspectives.userPerspective"
                  style="push"
              >
               <parameter
                     name="org.eclipse.ui.perspectives.showPerspective.perspectiveId"
                     value="hrpm.rcp.gui.perspective.UserPerspective">
               </parameter>
            </command>
            <separator
                  name="hrpm.rcp.toolbar.separator1"
                  visible="true">
            </separator>
            <command
                  commandId="hrpm.rcp.commands.exit"
                  icon="img/exit.png"
                  id="hrpm.rcp.menu.file.exit"
              
                  style="push"
              >
            </command>
            <dynamic
                  class="hrpm.rcp.gui.PerspectiveSwitcher"
                  id="hrpm.rcp.gui.perspectiveSwitcherDyanmic">
            </dynamic>
         </toolbar>
      </menuContribution>


where PerspectiveSwitcher is my contribution. The problem doing so is that my contributions override the declarative ones, so for instance I've got overlapped buttons. Is there a way to place dynamic contributions on the same toolbar without interfering and without using another toolbar?

Thanks.
Previous Topic:Can I show a Hyperlink in a tooltip?
Next Topic:Packaging a directory in a RCP app
Goto Forum:
  


Current Time: Sat Sep 21 01:17:13 GMT 2024

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

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

Back to the top