Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » toolbar contribution via IMenuService with custom source provider and expression
toolbar contribution via IMenuService with custom source provider and expression [message #329810] Sun, 06 July 2008 13:13 Go to next message
Kai Schlamp is currently offline Kai SchlampFriend
Messages: 344
Registered: July 2009
Senior Member
Hello!

I have a custom source provider for the variable activePerspectiveId, that
stores the id of the current active perspective (I use the one from
http://dev.eclipse.org/newslists/news.eclipse.platform/msg66 913.html).
Now I want to contribute an action to the main toolbar via the
IMenuService. This action should only be visible when one specific
perspective is active.
Here my snippet: http://pastey.net/90738

The problem is that when I switch the perspective, the action still is
visible in the toolbar. The expression doesn't seem to be correctly
evaluated again.
Am I missing something?

Best regards,
Kai
Re: toolbar contribution via IMenuService with custom source provider and expression [message #329849 is a reply to message #329810] Tue, 08 July 2008 15:13 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

You need to override
org.eclipse.core.expressions.Expression.collectExpressionInf o(ExpressionInfo)

Mark the variables that you use (that's how things like the
IEvaluationService know to re-evaluate variables). Check out other
subclasses of Expression.

Also note, in 3.4 there is a variable provided for activePerspectiveId
(although with a longer name :-)

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: toolbar contribution via IMenuService with custom source provider and expres [message #329868 is a reply to message #329849] Tue, 08 July 2008 19:37 Go to previous messageGo to next message
Kai Schlamp is currently offline Kai SchlampFriend
Messages: 344
Registered: July 2009
Senior Member
Paul Webster wrote:

> You need to override
> org.eclipse.core.expressions.Expression.collectExpressionInf o(ExpressionInfo)

> Mark the variables that you use (that's how things like the
> IEvaluationService know to re-evaluate variables). Check out other
> subclasses of Expression.

Thanks for the help ... I'll try it.

> Also note, in 3.4 there is a variable provided for activePerspectiveId
> (although with a longer name :-)

Really, is there? And what is the name of it? It's not mentioned at
http://wiki.eclipse.org/Command_Core_Expressions (or is it?!).

> PW
Re: toolbar contribution via IMenuService with custom source provider and expres [message #329924 is a reply to message #329868] Thu, 10 July 2008 16:40 Go to previous message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

Kai Schlamp wrote:
> Really, is there? And what is the name of it? It's not mentioned at
> http://wiki.eclipse.org/Command_Core_Expressions (or is it?!).

That's a helper page ... org.eclipse.ui.ISources is the publishing API.

--
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:locations to download previous Eclipse SDK (3.2, 3.3,...)
Next Topic:Contributing Actions to an action set
Goto Forum:
  


Current Time: Fri Dec 27 03:33:41 GMT 2024

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

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

Back to the top