Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 248733 - Expression is not evaluated at startup
Summary: Expression is not evaluated at startup
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.4   Edit
Hardware: PC Windows XP
: P3 normal with 1 vote (vote)
Target Milestone: 3.5 M4   Edit
Assignee: Prakash Rangaraj CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 274285 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-09-26 11:20 EDT by Adam Wehner CLA
Modified: 2009-06-03 13:41 EDT (History)
3 users (show)

See Also:


Attachments
Workspace with example rcp (22.62 KB, application/zip)
2008-09-26 11:25 EDT, Adam Wehner CLA
no flags Details
Patch v01 (742 bytes, patch)
2008-12-02 04:47 EST, Prakash Rangaraj CLA
pwebster: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Adam Wehner CLA 2008-09-26 11:20:47 EDT
I bind an expression-based activity to a command and try to make it visible and unvisible at runtime with the help of a custom ISourceProvider. It works in principle fine, but the expression is not evaluated at startup. The wanted behavior appears first after the first ISourceProvider.fireSourceChanged().
Another way to get it work was to use IEvaluationService in order to force an evaluation.

I have packaged an example workspace with a rcp application which shows this behavior. The IncrementCommand is contributed to a menu and a view toolbar and is binded to an activity. The ChangeRightCommand iterate between a valid expression value and an unvalid value for the mentioned activity.
Comment 1 Adam Wehner CLA 2008-09-26 11:25:42 EDT
Created attachment 113602 [details]
Workspace with example rcp
Comment 2 Paul Webster CLA 2008-11-24 14:08:04 EST
Prakash, please investigate the example.  Things you are looking for are 1) what happens to source providers when they are added?  Do we fire the source change when we instantiate a new source provider? 2) do we create activities after the source provider is created and not evaluate them (this is less likely, as the act of adding an expression to the IEvaluationService should fire the property change event at least once).

PW
Comment 3 Prakash Rangaraj CLA 2008-12-02 04:47:22 EST
Created attachment 119243 [details]
Patch v01

Paul,
    You are right. When the source provider is added, the variables are updated, but the source changed is not fired in the ExpressionAutority. If we fire the change, then it works fine. 

    Patch attached.
Comment 4 Paul Webster CLA 2008-12-04 09:51:50 EST
(In reply to comment #3)
> Created an attachment (id=119243) [details]
> Patch v01

Released to HEAD >20081204
PW
Comment 5 Prakash Rangaraj CLA 2008-12-11 08:26:40 EST
Verified in I20081208-1800
Comment 6 Stefan Stern CLA 2009-04-29 10:35:42 EDT
*** Bug 274285 has been marked as a duplicate of this bug. ***