Showing menu contributions depending on active perspective
Using the variable activeWorkbenchWindow.activePerspective in org.eclipse.ui.menus you can contribute commands to the menu- or toolbar depending on the active perspective. Unfortunately, this works only for single commands and not for a complete menu or toolbar element. For example:
<extension point="org.eclipse.ui.menus">
<menuContribution locationURI="toolbar:org.eclipse.ui.main.toolbar">
<toolbar id="de.rcpbuch.addressbook.filetoolbar">
<command commandId="de.rcpbuch.addressbook.somecommandid" style="push">
<visibleWhen checkEnabled="false">
<with variable="activeWorkbenchWindow.activePerspective">
<equals value="de.rcpbuch.addressbook.someperspectiveid"/>
</with>
</visibleWhen>
</command>
</toolbar>
</menuContribution>
</extension>


Thanks, just what I've been searching for. :) Now if I only could figure out why this ain't working on a per-toolbar rather than on a per-command level...