문제

I have a menu and toolbar that are defined in plugin.xml and a class that implements a source provider by extending AbstractSourceProvider. The menu is properly hidden but the toolbar with exactly the same visibleWhen is still visible. Since the menu is properly hidden, I'm fairly confident that the source provider is working correctly.

Anyone see why this declaration is not hiding the whole toolbar?

      <menuContribution
        allPopups="false"
        locationURI="menu:org.eclipse.ui.main.menu?before=Window">
     <menu
           label="Data Manager"
           mnemonic="D">
        <command
    command1
        </command>
        <command
    command2
        </command>
        <visibleWhen
              checkEnabled="false">
           <with
                 variable="datamanager.handlers.ShowActions">
              <equals
                    value="showActions">
              </equals>
           </with>
        </visibleWhen>
     </menu>
  </menuContribution>

  <menuContribution
        allPopups="false"
        locationURI="toolbar:org.eclipse.ui.main.toolbar">
     <toolbar
           id="datamanager.toolbar1">
        <command
              command3
        </command>
        <command
              command 4
        </command>
        <visibleWhen
              checkEnabled="false">
           <with
                 variable="datamanager.handlers.ShowActions">
              <equals
                    value="showActions">
              </equals>
           </with>
        </visibleWhen>
     </toolbar>
  </menuContribution>
도움이 되었습니까?

해결책

This looks like the problem described in Eclipse bug 201589 which has been open for rather a long time.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top