|
@@ -1,6 +1,10 @@
|
|
|
// Copyright (c) Jupyter Development Team.
|
|
|
// Distributed under the terms of the Modified BSD License.
|
|
|
|
|
|
+import {
|
|
|
+ utils
|
|
|
+} from '@jupyterlab/services';
|
|
|
+
|
|
|
import {
|
|
|
each, toArray
|
|
|
} from 'phosphor/lib/algorithm/iteration';
|
|
@@ -53,6 +57,10 @@ import {
|
|
|
Widget
|
|
|
} from 'phosphor/lib/ui/widget';
|
|
|
|
|
|
+import {
|
|
|
+ IInstanceRestorer
|
|
|
+} from '../instancerestorer';
|
|
|
+
|
|
|
|
|
|
/**
|
|
|
* The class name added to AppShell instances.
|
|
@@ -162,6 +170,13 @@ class ApplicationShell extends Widget {
|
|
|
return this._dockPanel.currentWidget;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * A promise that resolves when the shell has restored state.
|
|
|
+ */
|
|
|
+ get restored(): Promise<void> {
|
|
|
+ return this._restored.promise;
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* True if main area is empty.
|
|
|
*/
|
|
@@ -295,11 +310,20 @@ class ApplicationShell extends Widget {
|
|
|
each(toArray(this._dockPanel.widgets()), widget => { widget.close(); });
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * Restore the layout of the application shell.
|
|
|
+ */
|
|
|
+ restore(restorer: IInstanceRestorer): void {
|
|
|
+ // TODO: implement restoration before resolving the promise.
|
|
|
+ this._restored.resolve(void 0);
|
|
|
+ }
|
|
|
+
|
|
|
private _topPanel: Panel;
|
|
|
private _hboxPanel: BoxPanel;
|
|
|
private _dockPanel: DockPanel;
|
|
|
private _hsplitPanel: SplitPanel;
|
|
|
private _leftHandler: Private.SideBarHandler;
|
|
|
+ private _restored = new utils.PromiseDelegate<void>();
|
|
|
private _rightHandler: Private.SideBarHandler;
|
|
|
}
|
|
|
|