         @div class: 'vertical', outlet: 'vertical', =>
           @div class: 'panes', outlet: 'panes'
 
-  initialize: (@model) ->
-    @model = atom.workspace ? new Workspace unless @model?
+  initialize: (model) ->
+    @model = model ? atom.workspace ? new Workspace unless @model?
+    @element.getModel = -> model
 
     panes = new PaneContainerView(@model.paneContainer)
     @panes.replaceWith(panes)

PaneContainerView = require './pane-container-view'
Editor = require './editor'

# Essential: The top-level view for the entire window. An instance of this class is
# available via the `atom.workspaceView` global.
#

    @command 'window:install-shell-commands', => @installShellCommands()

    @command 'window:run-package-specs', -> ipc.send('run-package-specs', path.join(atom.project.getPath(), 'spec'))

    @command 'window:focus-next-pane', => @focusNextPaneView()
    @command 'window:focus-previous-pane', => @focusPreviousPaneView()
