Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » visibleWhen and core expressions
visibleWhen and core expressions [message #1409997] Tue, 19 August 2014 14:20 Go to next message
Martin  odloucký is currently offline Martin odlouckýFriend
Messages: 49
Registered: July 2010
Member
Hi, I have a problem making a command visible only when certain part is active. I have taken this approach

http://www.eclipse.org/forums/index.php/t/452233/

however, it seems that the core expression only gets evaluated at startup. When I change the context variable by calling context.set or even context.modify, the state of the command does not get updated. The almighty Lars Vogel, taking the same approach in his tutorial

http://www.vogella.com/tutorials/EclipseRCP/article.html#commandsmore_coreexpressionsown,

does not seem to face such an issue. How come?

Are core expressions supposed to get re-evaluted when the DI context changes? If not, how can I force re-evaluation? I know there is a method IEvaluationService.requestEvaluation but I couldn't obtain instance of the IEvaluationService through dependency injection. Should I obtain it by some 3.x way? Does not the e4 have some new and more fancy ways of handling the evaluation of core expressions?

Thanks.

[Updated on: Tue, 19 August 2014 14:22]

Report message to a moderator

Re: visibleWhen and core expressions [message #1411039 is a reply to message #1409997] Fri, 22 August 2014 08:35 Go to previous messageGo to next message
Martin  odloucký is currently offline Martin odlouckýFriend
Messages: 49
Registered: July 2010
Member
Hi guyes, I am getting a little bit frustrated about this issue. I like the new Eclipse 4 concept, but after 4 releases it still seems rather immature. Or its just my feeling caused by lack of any useful documentation.

Is there more appropriate place to ask such a question where the actual developers of the e4 might answer it? Problems with e4 are slowly piling up and I feel like returning to good old 3.x to save me some hair on my head.

[Updated on: Fri, 22 August 2014 08:36]

Report message to a moderator

Re: visibleWhen and core expressions [message #1412093 is a reply to message #1411039] Mon, 25 August 2014 09:21 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2902
Registered: July 2012
Senior Member
Sounds like you ran into the following issue

https://bugs.eclipse.org/bugs/show_bug.cgi?id=400217
Re: visibleWhen and core expressions [message #1413718 is a reply to message #1412093] Fri, 29 August 2014 09:02 Go to previous message
Martin  odloucký is currently offline Martin odlouckýFriend
Messages: 49
Registered: July 2010
Member
Hi Dirk,

thank you for your answer. I was aware of this bug but did not read it cerafully enough. Well, I have found that core-expressions are just not getting updated when you change a variable in IEclipseContext. I have found how to force the re-evaluation of expressions using the ExpressionsContext. However, even if the visibility is set, the MenuItems do not react on it. I have to manually dig in the SWT MenuRenderer and refresh it myself. I have written my own addon which does that. However, things got even more complicated after that and after whole day of investigenting this issue I decided to give up. I am returning to 3.x.
Previous Topic:[SOLVED] RCP: Part stack is removed when last part was closed
Next Topic:Referencing shared elements in different fragments
Goto Forum:
  


Current Time: Fri Mar 29 13:47:31 GMT 2024

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

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

Back to the top