     @setAttribute("tabindex", -1)
 
   initialize: (@pane) ->
+    @tabs = []
     @subscriptions = new CompositeDisposable
 
     @subscriptions.add atom.commands.add atom.views.getView(@pane),

      @pane.moveItem(item, @pane.getItems().length - 1) unless @isItemMovingBetweenPanes

  moveItemTabToIndex: (item, index) ->
    if tab = @tabForItem(item)
      tab.remove()
      @insertTabAtIndex(tab, index)

  insertTabAtIndex: (tab, index) ->
    followingTab = @tabAtIndex(index) if index?
    if followingTab
      @insertBefore(tab, followingTab)
    else
      @appendChild(tab)

    tab.updateTitle()
    @updateTabBarVisibility()

  removeTabForItem: (item) ->
    @tabForItem(item)?.destroy()
    tab.updateTitle() for tab in @getTabs()
    @updateTabBarVisibility()


      @classList.remove('hidden')

  getTabs: ->
    @tabs.slice()

  tabAtIndex: (index) ->
    @tabs[index]

  tabForItem: (item) ->
    @tabs.find((t) -> t.item is item)

  setActiveTab: (tabView) ->
    if tabView? and not tabView.classList.contains('active')
