Browse Source

Implement activateMain() in app shell

Steven Silvester 8 years ago
parent
commit
1b2bf66ea8
1 changed files with 11 additions and 7 deletions
  1. 11 7
      src/application/shell.ts

+ 11 - 7
src/application/shell.ts

@@ -9,7 +9,7 @@ import {
 } from 'phosphor/lib/collections/vector';
 
 import {
-  BoxLayout, BoxPanel
+  BoxPanel
 } from 'phosphor/lib/ui/boxpanel';
 
 import {
@@ -173,35 +173,39 @@ class ApplicationShell extends Panel {
   }
 
   /**
-   *
+   * Activate a widget in the left area.
    */
   activateLeft(id: string): void {
     this._leftHandler.activate(id);
   }
 
   /**
-   *
+   * Activate a widget in the right area.
    */
   activateRight(id: string): void {
     this._rightHandler.activate(id);
   }
 
   /**
-   *
+   * Activate a widget in the main area.
    */
   activateMain(id: string): void {
-    // TODO
+    let dock = this._dockPanel;
+    let widget = find(dock.widgets, value => value.id === id);
+    if (widget) {
+      dock.activateWidget(widget);
+    }
   }
 
   /**
-   *
+   * Collapse the left area.
    */
   collapseLeft(): void {
     this._leftHandler.collapse();
   }
 
   /**
-   *
+   * Collapse the right area.
    */
   collapseRight(): void {
     this._rightHandler.collapse();