Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsHow to restore WorkingSets in a View in Eclipse 4?
https://www.eclipse.org/forums/index.php/mv/msg/412663/955274/#msg_955274
One of our Views, which extends ViewPart, uses IWorkingSets via the standard IWorkingSetManager. The exact objects displayed are not IResource objects, so it has its own factory, etc. Everything as far as the ability to select the inclusions for a workingset, the filtering, and the saving of the selections and named working sets into the workingsets.xml file all works fine.
However, when the view is restored, the AggregateWorkingSet for the View is not restored from the workingsets.xml file. I have verified through debugging that the WorkingSetManager properly executes the restoreState() code which reads and creates the various working sets, but it does not appear that the part (well, actually the IWorkbenchPage that is accessible via the getSite().getPage() call in the View) ever receives the setting for the aggregate working set.
Worse, now if one starts and stops the application repeatedly, a new entry is created every time in the workingsets.xml due to the fact a new aggregate working set for the View is created with the timestamp.
I believe the reason for the functionality in 3.7 is that the WorkbenchPage class had a restoreState() method that was called by WorkbenchWindow.restoreState(). In the WorkbenchPage.restoreState() there is code which specifically handled restoring working sets. It would appear in the Eclipse 4 system, neither WorkbenchPage nor WorkbenchWindow has a restoreState() method.
With Eclipse 4, what is the proper way to have the AggregateWorkingSet restored for a View?