Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 315855

Summary: persistedState is not restored for contributions loaded from separate components.e4xmi files
Product: [Eclipse Project] e4 Reporter: Brian de Alwis <bsd>
Component: UIAssignee: Project Inbox <e4.ui-inbox>
Status: RESOLVED DUPLICATE QA Contact: Remy Suen <remy.suen>
Severity: normal    
Priority: P3 CC: ilaborie, ob1.eclipse, remy.suen, tom.schindl
Version: 1.0   
Target Milestone: ---   
Hardware: Macintosh   
OS: Mac OS X   
Whiteboard:
Attachments:
Description Flags
Sample e4 Application
none
With Fragment none

Description Brian de Alwis CLA 2010-06-04 19:01:31 EDT
BuildId: HEAD as of 2010-06-04 6:27pm

Contributions loaded from an components.e4xmi file don't have their persistedState properly loaded.
Comment 1 Brian de Alwis CLA 2010-06-04 19:04:29 EDT
Created attachment 171187 [details]
Sample e4 Application

I've attached a small sample application that demonstrates the problem.  This app provides a simple search field as an MToolControl.  The search field stores its contents in the MToolControl's persistedState.  The example creates a (blank) part a toolbar containing two instances of this search field MToolControl, one defined in the Application.e4xmi and the other from an associated components.e4xmi.  The MToolControl defined in the Application.e4xmi has its persistedState loaded with no issue.  The MToolControl defined in the components.e4xmi has an empty persistedState.  The saved values for both are persisted to the deltas.xml, however.
Comment 2 Remy Suen CLA 2010-06-05 06:43:21 EDT
This is probably because model extensions come from a "foreign" source and their UUID is not known in the component file is not known (to the main root application).
Comment 3 Remy Suen CLA 2010-06-18 17:42:18 EDT
Brian, is this still a problem? I made some changes recently in this area.
Comment 4 Brian de Alwis CLA 2010-06-21 07:24:49 EDT
Sorry, I've been away and porting from the component snippets to fragments took more time than I hoped, so I've only just had a chance to give this a whirl.  Unfortunately the problem is still occurring.
Comment 5 Igor Laborie CLA 2010-06-28 11:22:50 EDT
Also occurring on Linux 32.
Comment 6 Remy Suen CLA 2010-07-06 07:22:23 EDT
To be clear, is it only the 'persistedState' feature that's not being persisted or are the other features not being persisted also?
Comment 7 Brian de Alwis CLA 2010-07-06 07:23:42 EDT
The persistedState is being persisted to disk.  It's not being restored.
Comment 8 Remy Suen CLA 2010-07-06 07:24:55 EDT
(In reply to comment #7)
> The persistedState is being persisted to disk.  It's not being restored.

Of course, how stupid of me. That was stated in comment 1.
Comment 9 Thomas Schindl CLA 2010-07-19 15:54:55 EDT
the attached e4xmi for components is not valid! I've attached a patch for UUID copying from fragments in bug 320235
Comment 10 Thomas Schindl CLA 2010-07-19 16:00:17 EDT
Created attachment 174669 [details]
With Fragment

I've updated the example and can confirm that the patch from bug 320235 solves the problem of not restoring
Comment 11 Thomas Schindl CLA 2010-07-19 16:01:54 EDT
closing as dup

*** This bug has been marked as a duplicate of bug 320235 ***