Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » visibleWhen Expression not evaluated at startup
visibleWhen Expression not evaluated at startup [message #649699] Thu, 20 January 2011 11:14 Go to next message
Hauke Fuhrmann is currently offline Hauke Fuhrmann
Messages: 324
Registered: July 2009
Senior Member
Hi there,

I try to add contribution items via the org.eclipse.ui.menu extension
point with visibleWhen core expressions. In general this works fine.

However, it seems that toolbar buttons often do not appear immediately
after Eclipse startup, e.g. if a corresponding Editor is already open
for which an with-activeEditor-equals-myID expression was defined. Only
after some switching between different editors, the buttons will appear
correctly.

The reason seems to be that the contribution item isVisible() predicate
uses the "last expression evaluation result" which seems to be not
evaluated in the very beginning yet.

Is there a way to trigger the evaluation of these visibleWhen
expressions programmatically somehow, e.g. via the MenuService?

Cheers,
Hauke
Re: visibleWhen Expression not evaluated at startup [message #649723 is a reply to message #649699] Thu, 20 January 2011 12:50 Go to previous message
Paul Webster is currently offline Paul Webster
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

It might be one of any number of problems. But in theory you can
programmatically request a re-evaluation by using
org.eclipse.ui.services.IEvaluationService.requestEvaluation (String)

PW

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


Previous Topic:Tigris Subeclipse plugin fails (silently) on Eclipse
Next Topic:Installation failure for ECUT plugin
Goto Forum:
  


Current Time: Tue Oct 21 03:52:04 GMT 2014

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

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