Community
Participate
Working Groups
Question was originally posed in Community Forums: http://www.eclipse.org/forums/index.php/t/412663/ We are trying to move an RCP Application from 3.7 to 4, primarily relying upon the compatibility layer, and then re-writing as we can. We have a View that uses working sets. The items are not IResource based (they represent remote compute clusters), but they have a factory, etc. All of the information is properly recorded in the workingsets.xml file as one manipulates the working sets: adding objects, adding a named working set, etc., and the filtering based upon the working set works as expected. However, upon shutting down and restarting, the working set is not available via the getSite().getPage().getAggregateWorkingSet() call in Eclipse 4 the way it was in Eclipse 3.7. In Eclipse 3.7, the AggregateWorkingSet for a view was restored through the WorkbenchPage.restoreState(). In Eclipse 4.2.1, this method was removed (as well as the WorkbenchWindow.restoreState()), and along with it the non-trivial amount of code that linked back up the entries from the workingsets.xml file. Two outcomes are noticed by the lack of the restoring of the AggregateWorkingSet. 1)despite the use of the standard IWorkingsetManager which nicely stores the changes to the workingset.xml file, there is no restoration of the working sets to the view. 2)Lacking a restoration of the working sets, a new entry in the workingsets.xml file is added on every shutdown of the application, since the window id has a timestamp appended to it. If one doesn't re-select a working set, then an empty entry is created. If one does re-select a working set, a new entry is made with the selected working set (though, as noted it is not restored). I have verified that the WorkingSetManager.restoreState() is executed, and all of the entries in the workingsets.xml are loaded. It just appears there is no linking of the loaded working set to the view. If there is an alternative approach in Eclipse 4, please let me know. However, with every other aspect of the IWorkingsetManager code working as expected through the compatibility layer, it seems like this functionality may be missing. An example workingsets.xml file after a few starts/stops. It is possible to see the accumulation of empty aggregate working sets at the bottom, which are created merely by starting and stop the application. <?xml version="1.0" encoding="UTF-8"?> <workingSetManager> <workingSet editPageId="com.example.FileManager.ui.workingsets.MachineViewWorkingSet" factoryID="org.eclipse.ui.internal.WorkingSetFactory" id="1350942568119_1" label="NoCompany" name="NoCompany"> <item factoryID="com.example.machines.machineFactory" machine.name="local"/> <item factoryID="com.example.machines.machineFactory" machine.name="juno"/> <item factoryID="com.example.machines.machineFactory" machine.name="vmdart2"/> </workingSet> <workingSet editPageId="com.example.FileManager.ui.workingsets.MachineViewWorkingSet" factoryID="org.eclipse.ui.internal.WorkingSetFactory" id="1350942584725_2" label="Company-NoTunnison" name="Company-NoTunnison"> <item factoryID="com.example.machines.machineFactory" machine.name="local"/> <item factoryID="com.example.machines.machineFactory" machine.name="glory"/> <item factoryID="com.example.machines.machineFactory" machine.name="redsky"/> <item factoryID="com.example.machines.machineFactory" machine.name="chama"/> </workingSet> <workingSet editPageId="com.example.FileManager.ui.workingsets.MachineViewWorkingSet" factoryID="org.eclipse.ui.internal.WorkingSetFactory" id="1350942591456_3" label="Company" name="Company"> <item factoryID="com.example.machines.machineFactory" machine.name="local"/> <item factoryID="com.example.machines.machineFactory" machine.name="glory"/> <item factoryID="com.example.machines.machineFactory" machine.name="redsky"/> <item factoryID="com.example.machines.machineFactory" machine.name="chama"/> <item factoryID="com.example.machines.machineFactory" machine.name="tunnison"/> </workingSet> <workingSet editPageId="org.eclipse.ui.resourceWorkingSetPage" factoryID="org.eclipse.ui.internal.WorkingSetFactory" id="1351190300681_20" label="hannibal-dev" name="hannibal-dev"> <item factoryID="org.eclipse.ui.internal.model.ResourceFactory" path="/CommitTestProject" type="4"/> <item factoryID="org.eclipse.ui.internal.model.ResourceFactory" path="/DemoProject" type="4"/> <item factoryID="org.eclipse.ui.internal.model.ResourceFactory" path="/ATP_Qual" type="4"/> </workingSet> <workingSet aggregate="true" factoryID="org.eclipse.ui.internal.WorkingSetFactory" id="1350942552032_0" label="Window Working Set" name="Aggregate for window 1350942552032"> <workingSet IMemento.internal.id="NoCompany"/> </workingSet> <workingSet aggregate="true" factoryID="org.eclipse.ui.internal.WorkingSetFactory" id="1350942808074_4" label="Window Working Set" name="Aggregate for window 1350942808074"> <workingSet IMemento.internal.id="NoCompany"/> </workingSet> <workingSet aggregate="true" factoryID="org.eclipse.ui.internal.WorkingSetFactory" id="1350943988163_5" label="Window Working Set" name="Aggregate for window 1350943988163"/> <workingSet aggregate="true" factoryID="org.eclipse.ui.internal.WorkingSetFactory" id="1350944019094_6" label="Window Working Set" name="Aggregate for window 1350944019094"/> <workingSet aggregate="true" factoryID="org.eclipse.ui.internal.WorkingSetFactory" id="1350945593624_7" label="Window Working Set" name="Aggregate for window 1350945593624"> <workingSet IMemento.internal.id="Company-NoTunnison"/> </workingSet> <workingSet aggregate="true" factoryID="org.eclipse.ui.internal.WorkingSetFactory" id="1350947325635_8" label="Window Working Set" name="Aggregate for window 1350947325635"/> <workingSet aggregate="true" factoryID="org.eclipse.ui.internal.WorkingSetFactory" id="1350950764131_9" label="Window Working Set" name="Aggregate for window 1350950764131"> <workingSet IMemento.internal.id="Company"/> </workingSet> <workingSet aggregate="true" factoryID="org.eclipse.ui.internal.WorkingSetFactory" id="1350950792555_10" label="Window Working Set" name="Aggregate for window 1350950792555"/> <workingSet aggregate="true" factoryID="org.eclipse.ui.internal.WorkingSetFactory" id="1350950834338_11" label="Window Working Set" name="Aggregate for window 1350950834338"> <workingSet IMemento.internal.id="Company"/> </workingSet> <workingSet aggregate="true" factoryID="org.eclipse.ui.internal.WorkingSetFactory" id="1350950857655_12" label="Window Working Set" name="Aggregate for window 1350950857655"/> <workingSet aggregate="true" factoryID="org.eclipse.ui.internal.WorkingSetFactory" id="1350951095718_13" label="Window Working Set" name="Aggregate for window 1350951095718"/> <workingSet aggregate="true" factoryID="org.eclipse.ui.internal.WorkingSetFactory" id="1350951158924_14" label="Window Working Set" name="Aggregate for window 1350951158924"> <workingSet IMemento.internal.id="Company"/> </workingSet> <workingSet aggregate="true" factoryID="org.eclipse.ui.internal.WorkingSetFactory" id="1350951245617_15" label="Window Working Set" name="Aggregate for window 1350951245617"/> <workingSet aggregate="true" factoryID="org.eclipse.ui.internal.WorkingSetFactory" id="1351007490526_16" label="Window Working Set" name="Aggregate for window 1351007490526"/> <workingSet aggregate="true" factoryID="org.eclipse.ui.internal.WorkingSetFactory" id="1351007565959_17" label="Window Working Set" name="Aggregate for window 1351007565959"/> <workingSet aggregate="true" factoryID="org.eclipse.ui.internal.WorkingSetFactory" id="1351183421864_18" label="Window Working Set" name="Aggregate for window 1351183421864"/> <workingSet aggregate="true" factoryID="org.eclipse.ui.internal.WorkingSetFactory" id="1351183695632_19" label="Window Working Set" name="Aggregate for window 1351183695632"/> <workingSet aggregate="true" factoryID="org.eclipse.ui.internal.WorkingSetFactory" id="1351190358208_21" label="Window Working Set" name="Aggregate for window 1351190358208"/> <workingSet aggregate="true" factoryID="org.eclipse.ui.internal.WorkingSetFactory" id="1351228415984_22" label="Window Working Set" name="Aggregate for window 1351228415984"/> <mruList name="hannibal-dev"/> </workingSetManager>
*** This bug has been marked as a duplicate of bug 385592 ***
(In reply to comment #1) > > *** This bug has been marked as a duplicate of bug 385592 *** I will trust your judgement that this issue is the same as the 385592. However, please note the differences: * For me, in 4.2.1 in the IDE, in the Package Explorer, the use of a "Selected Working Set" *does* persist across sessions. This logic is the same as what our view does for the working set selection, but of course it does not persist. That is, the issue here is a selected, named working set is not restored. * This report is about a View in an RCP app, not the IDE.