Bug 395341 - toolbar visible when using variable activeWorkbenchWindow.activePerspective is not updated when all perspectives are closed.
Summary: toolbar visible when using variable activeWorkbenchWindow.activePerspective i...
Status: REOPENED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.2.1   Edit
Hardware: PC Windows 7
: P3 normal with 2 votes (vote)
Target Milestone: ---   Edit
Assignee: Platform UI Triaged CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-11-28 16:34 EST by Kevan Holdaway CLA
Modified: 2021-05-13 08:51 EDT (History)
6 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kevan Holdaway CLA 2012-11-28 16:34:29 EST
I have an extension like this:
   <extension
         point="org.eclipse.ui.menus">
      <menuContribution
            allPopups="false"
            locationURI="toolbar:org.eclipse.ui.main.toolbar">
         <toolbar
               id="com.ibm.etools.webtools.webperspective.project.wizard.toolbar"
               label="myLabel">
               <command
                     commandId="myCommandId"
                     id="id"
                     label="Label"
                     icon="icon"
                     style="push">
	             <visibleWhen>
			<with variable="activeWorkbenchWindow.activePerspective">
				         	<or>
				               <equals value="org.eclipse.wst.web.ui.webDevPerspective"/>
				               <equals value="org.eclipse.jst.j2ee.J2EEPerspective"/>
				         	</or>
				          </with>
	               </visibleWhen>               
	         </command>
         </toolbar>
      </menuContribution>
   </extension>

This works perfect until you close all perspectives.  The toolbar is never updated to remove them.  Since there is no active perspective, this toolbar command should not be showing.
Comment 1 Ilya Shinkarenko CLA 2014-09-19 10:59:23 EDT
This bug is also reproducible with 3.8.2
Comment 2 Daniela Kratzmann CLA 2016-12-01 07:11:04 EST
It's still reproducible with 4.6.1

As a workaround add the following:
<and>
    <with
	variable="activeWorkbenchWindow">
           <test 
               property="org.eclipse.ui.workbenchWindow.isPerspectiveOpen">
           </test>
    </with>
...
</and>
Comment 3 Eclipse Genie CLA 2021-04-12 15:38:41 EDT Comment hidden (obsolete)
Comment 4 Rolf Theunissen CLA 2021-05-13 08:48:10 EDT
Still present in 4.20, the variable is not updated on perspective close.
Comment 5 Eclipse Genie CLA 2021-05-13 08:51:06 EDT
New Gerrit change created: https://git.eclipse.org/r/c/platform/eclipse.platform.ui/+/180570