/** * Restore localWorkingSetManager and active working sets * @param memento * @return whether the restore was successful */ private boolean restoreState(IMemento memento) { String configured= memento.getString(TAG_CONFIGURED); if (configured == null) return false; fConfigured= Boolean.valueOf(configured).booleanValue(); fLocalWorkingSetManager.restoreState(memento.getChild(TAG_LOCAL_WORKING_SET_MANAGER)); IMemento[] actives= memento.getChildren(TAG_ACTIVE_WORKING_SET); for (int i= 0; i < actives.length; i++) { String name= actives[i].getString(TAG_WORKING_SET_NAME); if (name != null) { IWorkingSet ws= fLocalWorkingSetManager.getWorkingSet(name); if (ws == null) { ws= PlatformUI.getWorkbench().getWorkingSetManager().getWorkingSet(name); } if (ws != null) { fActiveWorkingSets.add(ws); } } } return true; } private void workingSetManagerChanged(PropertyChangeEvent event) {
fLocalWorkingSetManager.restoreState(memento.getChild(TAG_LOCAL_WORKING_SET_MANAGER)); IWorkingSet[] allLocalWorkingSets= fLocalWorkingSetManager.getAllWorkingSets(); for (int i= 0; i < allLocalWorkingSets.length; i++) {
fLocalWorkingSetManager.restoreState(memento.getChild(TAG_LOCAL_WORKING_SET_MANAGER)); IWorkingSet[] allLocalWorkingSets= fLocalWorkingSetManager.getAllWorkingSets(); for (int i= 0; i < allLocalWorkingSets.length; i++) {