-
-
Notifications
You must be signed in to change notification settings - Fork 33
Expand file tree
/
Copy pathDocumentManagerContainer.ts
More file actions
39 lines (32 loc) · 1.35 KB
/
DocumentManagerContainer.ts
File metadata and controls
39 lines (32 loc) · 1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import { FillDockContainer } from "./FillDockContainer.js";
import { TabHost } from "./TabHost.js";
import { DocumentTabPage } from "./DocumentTabPage.js";
import { DockManager } from "./DockManager.js";
import { TabHostDirection } from "./enums/TabHostDirection.js";
import { IState } from "./interfaces/IState.js";
import { IDockContainer } from "./interfaces/IDockContainer.js";
/**
* The document manager is then central area of the dock layout hierarchy.
* This is where more important panels are placed (e.g. the text editor in an IDE,
* 3D view in a modelling package etc
*/
export class DocumentManagerContainer extends FillDockContainer {
constructor(dockManager: DockManager) {
super(dockManager, TabHostDirection.TOP);
this.minimumAllowedChildNodes = 0;
this.element.classList.add('document-manager');
this.tabHost.createTabPage = this._createDocumentTabPage;
this.tabHost.displayCloseButton = true;
}
private _createDocumentTabPage(tabHost: TabHost, container: IDockContainer) {
return new DocumentTabPage(tabHost, container);
}
saveState(state: IState) {
super.saveState(state);
state.documentManager = true;
}
/** Returns the selected document tab */
selectedTab() {
return this.tabHost.activeTab;
}
}