   itemAtIndex: (index) ->
     @items[index]
 
-  # Public: Switches to the next contained item.
+  # Public: Makes the next item active.
   showNextItem: ->
     index = @getActiveItemIndex()
     if index < @items.length - 1


    @activate() if params?.active

  serializeParams: ->
    items: compact(@items.map((item) -> item.serialize?()))
    activeItemUri: @activeItem?.getUri?()
    focused: @focused
    active: @active

  deserializeParams: (params) ->
    {items, activeItemUri} = params
    params.items = items.map (itemState) -> atom.deserializers.deserialize(itemState)
    params.activeItem = find params.items, (item) -> item.getUri?() is activeItemUri
    params

  getViewClass: -> Pane ?= require './pane'

  isActive: -> @active

  focus: ->
    @focused = true
    @activate() unless @isActive()

  blur: ->
    @focused = false
    true # if this is called from an event handler, don't cancel it

  activate: ->
    @container?.activePane = this
    @emit 'activated'

  getPanes: -> [this]

  # Public: Returns all contained views.
  getItems: ->
    @items.slice()


      when 1 then false
      when 2 then true

  # Public: Saves the active item.
  saveActiveItem: ->
    @saveItem(@activeItem)

  # Public: Saves the active item at a prompted-for location.
  saveActiveItemAs: ->
    @saveItemAs(@activeItem)

  # Public: Saves the specified item.
  #
  # * item: The item to save.
  # * nextAction: An optional function which will be called after the item is saved.
  saveItem: (item, nextAction) ->
    if item.getUri?()
      item.save?()
