Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » visibleWhen on toolbar
visibleWhen on toolbar [message #760224] Thu, 01 December 2011 16:07 Go to next message
code404 is currently offline code404
Messages: 6
Registered: October 2010
Junior Member
Hy,

I want to show a toolbar only if a special editor is opened.
I tryed this in my plugin.xml
 <extension
         point="org.eclipse.ui.menus">
      <menuContribution
            allPopups="false"
            locationURI="toolbar:org.eclipse.ui.main.toolbar?after=additions">
         <toolbar
               id="toolbar.id"
               label="Label">
            <command
                  commandId="command1.id"
                  icon="icons/refit.gif"
                  label="Refit"
                  style="push">
            </command>
           <visibleWhen
                  checkEnabled="false">
               <with
                     variable="activeEditorId">
                  <equals
                       value="Editor1.id">
                  </equals>
               </with>
            </visibleWhen>
         </toolbar>

But this doesn't work.
If I add the visbleWhen tag to the command it works perfectly.
But for witch reason is it allowed to add the visbleWhen tag to a toolbar?
(I'm too lazy to add visbleWhen tag to all commands in this toolbar)

Thanks
code
Re: visibleWhen on toolbar [message #760447 is a reply to message #760224] Fri, 02 December 2011 12:23 Go to previous messageGo to next message
code404 is currently offline code404
Messages: 6
Registered: October 2010
Junior Member
OK found it at eclipse bugs id=201589
Re: visibleWhen on toolbar [message #760448 is a reply to message #760447] Fri, 02 December 2011 12:23 Go to previous messageGo to next message
code404 is currently offline code404
Messages: 6
Registered: October 2010
Junior Member
https://bugs.eclipse.org/bugs/show_bug.cgi?id=201589
Re: visibleWhen on toolbar [message #1425413 is a reply to message #760448] Wed, 17 September 2014 09:16 Go to previous message
Kondal Kolipaka is currently offline Kondal Kolipaka
Messages: 7
Registered: November 2010
Junior Member
By adding visibleWhen on each command, toolbar is automatically getting disappeared if there are no visible elements.
Previous Topic:Default value for radio button
Next Topic:Using ProjectExplorer in an e4 RCP app
Goto Forum:
  


Current Time: Mon Sep 22 00:11:15 GMT 2014

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

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