Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » Trouble with visible when
Trouble with visible when [message #655938] Wed, 23 February 2011 11:53 Go to next message
Thomas Kratz is currently offline Thomas KratzFriend
Messages: 163
Registered: July 2009
Senior Member
I have the following menu (trying to run on e4M5)
<extension
      point="org.eclipse.ui.menus">
   <menuContribution
         allPopups="true"
         locationURI="menu:org.eclipse.ui.main.menu?after=additions">
      <menu
            id="de.eiswind.mango.client.menu.admin"
            label="%administration"
            tooltip="%administration">
         <separator
               name="additions"
               visible="false">
         </separator>
         <visibleWhen>
               	 <with
                     variable="de.eiswind.mango.client.core.user.isadmin">
                    <equals  value="enabled">
                    </equals>
                  
               </with>
           	 </visibleWhen>
   </menu>
   </menuContribution>
   <menuContribution
         allPopups="false"
         locationURI="menu:de.eiswind.mango.client.menu.admin">
      <command
            commandId="de.eiswind.mango.command.openvaluelist"
            id="de.eiswind.mango.menu.openvaluelistview"
            label="%valueLists"
            style="push"
            tooltip="%valueLists">
             <visibleWhen>
               	 <with
                     variable="de.eiswind.mango.client.core.user.isadmin">
                    <equals  value="enabled">
                    </equals>
                  
               </with>
        </visibleWhen>
            
      </command>
     
   </menuContribution>


However no matter if the variable is enabled or not the menu is always shown and the command is never visible. I had sourceProviders to disable the menus based on user rights, but i cannot get it to work on e4. Any hints on this ?

Regards Thomas
Re: Trouble with visible when [message #655945 is a reply to message #655938] Wed, 23 February 2011 13:22 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

It doesn't look like the source providers are hooked up yet:
org.eclipse.ui.internal.services.EvaluationService.addSource Provider(ISourceProvider)

PW

--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Platform_Expression_Framework
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse .platform.doc.isv/guide/workbench.htm


Re: Trouble with visible when [message #656094 is a reply to message #655945] Thu, 24 February 2011 08:08 Go to previous messageGo to next message
Thomas Kratz is currently offline Thomas KratzFriend
Messages: 163
Registered: July 2009
Senior Member
Hi, I used to do this through plugin.xml like
<extension
         point="org.eclipse.ui.services">
      <sourceProvider
            provider="de.eiswind.mango.client.onix.ftp.FTPSourceProvider">
         <variable
               name="de.eiswind.mango.client.onix.ftp.cansee"
               priorityLevel="workbench">
         </variable>
      </sourceProvider>
   </extension>


(this is a different example) this works on 3.6 but seems to fail on e4. Is this a bug ?
Re: Trouble with visible when [message #656181 is a reply to message #656094] Thu, 24 February 2011 12:59 Go to previous message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

On 02/24/2011 03:08 AM, Thomas Kratz wrote:
>
> (this is a different example) this works on 3.6 but seems to fail on e4.
> Is this a bug ?

Yes https://bugs.eclipse.org/bugs/show_bug.cgi?id=338056

PW

--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Platform_Expression_Framework
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse .platform.doc.isv/guide/workbench.htm


Previous Topic: Pespective entry in Application.e4xmi
Next Topic:How to place a legacy view in the editor area
Goto Forum:
  


Current Time: Sun Nov 23 08:43:29 GMT 2014

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

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