 
     _.nextTick => atom.setFullScreen(@state.get('fullScreen'))
 
+  # Private:
   serialize: ->
     state = @state.clone()
     state.set('panes', @panes.serialize())
     state.set('fullScreen', atom.isFullScreen())
     state
 
+  # Private:
   getState: -> @state
 
+  # Private:
   handleFocus: (e) ->
     if @getActivePane()
       @getActivePane().focus()

    activePane.focus() if changeFocus
    editSession

  # Updates the application's title, based on whichever file is open.
  updateTitle: ->
    if projectPath = project.getPath()
      if item = @getActivePaneItem()

        modifiedBuffers.push item.buffer if item.buffer.isModified()
    modifiedBuffers

  # Private: Retrieves all of the paths to open files.
  #
  # Returns an {Array} of {String}s.
  getOpenBufferPaths: ->
    _.uniq(_.flatten(@getEditors().map (editor) -> editor.getOpenBufferPaths()))

  # Public: Returns the currently focused {Pane}.
  getActivePane: ->
    @panes.getActivePane()

  # Public: Returns the currently focused {PaneItem}.
  getActivePaneItem: ->
    @panes.getActivePaneItem()

  # Public: Returns the currently focused {PaneItemView}.
  getActiveView: ->
    @panes.getActiveView()

  # Public: Focuses the previous pane by id.
  focusPreviousPane: -> @panes.focusPreviousPane()

  # Public: Focuses the next pane by id.
  focusNextPane: -> @panes.focusNextPane()

  # Public:
  #
  # FIXME: Difference between active and focused pane?
  getFocusedPane: -> @panes.getFocusedPane()

  # Public: Saves all of the open {PaneItem}s
  saveAll: ->
    @panes.saveAll()

  # Public: Fires a callback on each open {Pane}.
  eachPane: (callback) ->
    @panes.eachPane(callback)

  # Public: Returns an Array of all open {Pane}s.
  getPanes: ->
    @panes.getPanes()

  # Public: Return the id of the given a {Pane}
  indexOfPane: (pane) ->
    @panes.indexOfPane(pane)

  # Private: Fires a callback on each open {Editor}.
  eachEditor: (callback) ->
    callback(editor) for editor in @getEditors()
    attachedCallback = (e, editor) -> callback(editor)
    @on('editor:attached', attachedCallback)
    off: => @off('editor:attached', attachedCallback)

  # Public: Fires a callback on each open {EditSession}.
  eachEditSession: (callback) ->
    project.eachEditSession(callback)

  # Private: Fires a callback on each open {TextBuffer}.
  eachBuffer: (callback) ->
    project.eachBuffer(callback)

  # Private: Destroys everything.
  remove: ->
    editor.remove() for editor in @getEditors()
    project.destroy()
