         path       : file.path
         sessionKey : editor.sessionKey
 
+  recoverOldSessionTabs: ->
+    @workspaceRef.once "value", (snapshot) =>
+      {tabs} = snapshot.val()?
+      return unless tabs
+      for key, value of tabs
+        file = FSHelper.createFileFromPath value.path
+        @createEditorInstance file, null, value.sessionKey
+
   openFile: CollaborativeTabbedEditorPane::createEditorInstance
 
   pistachio: ->


    log "i am a CollaborativeTabbedEditorPane"

    @panel         = @getDelegate()
    @workspace     = @panel.getDelegate()
    @sessionKey    = @getOptions().sessionKey or @createSessionKey()
    @workspaceRef  = @workspace.firepadRef.child @sessionKey

    @createEditorTabs()
    @createEditorInstance()

  createEditorTabs: ->
    @tabHandleContainer = new ApplicationTabHandleHolder

      delegate           : @
      tabHandleContainer : @tabHandleContainer

  createEditorInstance: (file, content, sessionKey) ->
    pane   = new KDTabPaneView
      name : file?.name or "Untitled.txt"

    editor = new CollaborativeEditorPane {
      delegate : @getDelegate()
      sessionKey
      file
      content
    }
