Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Contribution to Eclipse toolbar is not hidden on switching the perspective
Contribution to Eclipse toolbar is not hidden on switching the perspective [message #329843] Tue, 08 July 2008 10:24 Go to next message
Uwe Stieber is currently offline Uwe StieberFriend
Messages: 19
Registered: July 2009
Junior Member
Hi,
we've an issue with contributing a toolbar to the Eclipse main toolbar. We
do want to have the additional toolbar visible only within our own
perspectives, but not in the standard perspectives. However, the toolbar,
once contributed, is staying visible in all perspectives.

<menuContribution
locationURI="toolbar:org.eclipse.ui.main.toolbar?after=additions ">
<toolbar id="myToolbarId">
<command>
...
</command>
<visibleWhen>
... see below ...
</visibleWhen>
</toolbar>
</menuContribution>

We've played with two variants of the <visibleWhen> expression:

a) Testing for the active perspective id...

<visibleWhen>
<with variable="activeWorkbenchWindow.activePerspective">
<or>
<equals value="myPerspective1"/>
<equals value="myPerspective2"/>
<equals value="myPerspecitve3"/>
</or>
</with>
</visibleWhen>

b) Testing for an actionSet within the active contexts which is bound via
perspectiveExtentsions to the desired perspectives...

<visibleWhen>
<with variable="activeContexts">
<iterate operator="or">
<equals value="myActionSetId"/>
</iterate>
</with>
</visibleWhen>

None of those approaches are working. The toolbar is visible in all
perspectives. Any ideas or suggestions on how to solve this issue? We are
using the final Eclipse 3.4 build.

Thanks, Regards,
--
Uwe Stieber
Re: Contribution to Eclipse toolbar is not hidden on switching the perspective [message #329852 is a reply to message #329843] Tue, 08 July 2008 15:23 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

The visibleWhen will not work against the toolbar:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=201589

Will it work for you if applied to the command?

PW

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


Re: Contribution to Eclipse toolbar is not hidden on switching the perspective [message #329856 is a reply to message #329852] Tue, 08 July 2008 16:00 Go to previous message
Uwe Stieber is currently offline Uwe StieberFriend
Messages: 19
Registered: July 2009
Junior Member
Hi Paul,

> The visibleWhen will not work against the toolbar:
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=201589
>
> Will it work for you if applied to the command?

Yes, it works if applying the visibleWhen expression to the command itself.
Thanks for the hint.

Regards,
Uwe Stieber


> PW
>
> --
> Paul Webster
> http://wiki.eclipse.org/Platform_Command_Framework
> http://wiki.eclipse.org/Command_Core_Expressions
> http://wiki.eclipse.org/Menu_Contributions
> http://wiki.eclipse.org/Menus_Extension_Mapping
> http://help.eclipse.org/help33/index.jsp?topic=/org.eclipse. platform.doc.isv/guide/workbench.htm
Previous Topic:Source -> Format menu
Next Topic:No more handles [gtk_init_check() failed]
Goto Forum:
  


Current Time: Sun Jun 30 00:09:41 GMT 2024

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

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

Back to the top