Lines 1252-1258
Link Here
|
1252 |
} |
1252 |
} |
1253 |
|
1253 |
|
1254 |
// Restore the saved state |
1254 |
// Restore the saved state |
1255 |
IStatus restoreResult = restoreState(memento); |
1255 |
IStatus restoreResult = getAdvisor().restoreState(memento); |
1256 |
reader.close(); |
1256 |
reader.close(); |
1257 |
if (restoreResult.getSeverity() == IStatus.ERROR) { |
1257 |
if (restoreResult.getSeverity() == IStatus.ERROR) { |
1258 |
ErrorDialog.openError(null, |
1258 |
ErrorDialog.openError(null, |
Lines 1322-1328
Link Here
|
1322 |
private XMLMemento recordWorkbenchState() { |
1322 |
private XMLMemento recordWorkbenchState() { |
1323 |
XMLMemento memento = XMLMemento |
1323 |
XMLMemento memento = XMLMemento |
1324 |
.createWriteRoot(IWorkbenchConstants.TAG_WORKBENCH); |
1324 |
.createWriteRoot(IWorkbenchConstants.TAG_WORKBENCH); |
1325 |
IStatus status = saveState(memento); |
1325 |
IStatus status = getAdvisor().saveState(memento); |
1326 |
if (status.getSeverity() != IStatus.OK) { |
1326 |
if (status.getSeverity() != IStatus.OK) { |
1327 |
// don't use newWindow as parent because it has not yet been opened |
1327 |
// don't use newWindow as parent because it has not yet been opened |
1328 |
// (bug 76724) |
1328 |
// (bug 76724) |
Lines 1344-1350
Link Here
|
1344 |
/* |
1344 |
/* |
1345 |
* Restores the state of the previously saved workbench |
1345 |
* Restores the state of the previously saved workbench |
1346 |
*/ |
1346 |
*/ |
1347 |
private IStatus restoreState(IMemento memento) { |
1347 |
IStatus restoreState(IMemento memento) { |
1348 |
|
1348 |
|
1349 |
MultiStatus result = new MultiStatus(PlatformUI.PLUGIN_ID, IStatus.OK, |
1349 |
MultiStatus result = new MultiStatus(PlatformUI.PLUGIN_ID, IStatus.OK, |
1350 |
WorkbenchMessages.Workbench_problemsRestoring, null); |
1350 |
WorkbenchMessages.Workbench_problemsRestoring, null); |
Lines 1387-1393
Link Here
|
1387 |
// for any exception that might hose us before we get a chance to |
1387 |
// for any exception that might hose us before we get a chance to |
1388 |
// open it. If one occurs, remove the new window from the manager. |
1388 |
// open it. If one occurs, remove the new window from the manager. |
1389 |
try { |
1389 |
try { |
1390 |
result.merge(newWindow.restoreState(childMem, null)); |
1390 |
result.merge(newWindow.restoreState(childMem)); |
1391 |
try { |
1391 |
try { |
1392 |
newWindow.fireWindowRestored(); |
1392 |
newWindow.fireWindowRestored(); |
1393 |
} catch (WorkbenchException e) { |
1393 |
} catch (WorkbenchException e) { |
Lines 1561-1567
Link Here
|
1561 |
/* |
1561 |
/* |
1562 |
* Saves the current state of the workbench so it can be restored later on |
1562 |
* Saves the current state of the workbench so it can be restored later on |
1563 |
*/ |
1563 |
*/ |
1564 |
private IStatus saveState(IMemento memento) { |
1564 |
IStatus saveState(IMemento memento) { |
1565 |
MultiStatus result = new MultiStatus(PlatformUI.PLUGIN_ID, IStatus.OK, |
1565 |
MultiStatus result = new MultiStatus(PlatformUI.PLUGIN_ID, IStatus.OK, |
1566 |
WorkbenchMessages.Workbench_problemsSaving, null); |
1566 |
WorkbenchMessages.Workbench_problemsSaving, null); |
1567 |
|
1567 |
|
Lines 1574-1580
Link Here
|
1574 |
WorkbenchWindow window = (WorkbenchWindow) windows[nX]; |
1574 |
WorkbenchWindow window = (WorkbenchWindow) windows[nX]; |
1575 |
IMemento childMem = memento |
1575 |
IMemento childMem = memento |
1576 |
.createChild(IWorkbenchConstants.TAG_WINDOW); |
1576 |
.createChild(IWorkbenchConstants.TAG_WINDOW); |
1577 |
result.merge(window.saveState(childMem)); |
1577 |
result.merge(window.recordState(childMem)); |
1578 |
} |
1578 |
} |
1579 |
result.add(getEditorHistory().saveState( |
1579 |
result.add(getEditorHistory().saveState( |
1580 |
memento.createChild(IWorkbenchConstants.TAG_MRU_LIST))); //$NON-NLS-1$ |
1580 |
memento.createChild(IWorkbenchConstants.TAG_MRU_LIST))); //$NON-NLS-1$ |