 
     return finalItems
 
+
   saveItemOrders:(items)->
 
     items or= @getItems()

class DockController extends KDViewController

  defaultItems = [
    { title : "Activity",  path : "/Activity", order : 10, type :"persistent" }
    { title : "Teamwork",  path : "/Teamwork", order : 20, type :"persistent" }
    { title : "Terminal",  path : "/Terminal", order : 30, type :"persistent" }
    { title : "Editor",    path : "/Ace",      order : 40, type :"persistent" }
    { title : "Apps",      path : "/Apps",     order : 50, type :"persistent" }
    { title : "DevTools",  path : "/DevTools", order : 60, type :"persistent" }
  ]

  constructor:(options = {}, data)->
    options.view or= new KDCustomHTMLView domId : 'dock'

    super options, data

    @storage = new AppStorage "Dock", "1.0.3"

    @navController = new MainNavController
      view         : new NavigationList
        domId      : 'main-nav'
        testPath   : 'navigation-list'
        type       : 'navigation'
        itemClass  : NavigationLink
        testPath   : 'navigation-list'
      wrapper      : no
      scrollView   : no
    ,
      id           : 'navigation'
      title        : 'navigation'
      items        : []

    mainController = KD.getSingleton 'mainController'

    mainController.ready @bound 'accountChanged'

    @trackStateTransitions()
    @bindKeyCombos()

      item = @itemStates[i]
      return item  if item is this or predicate item


  activatePreviousApp: (e) ->

    e.preventDefault()
    item = @getRelativeItem -1, isRunning
    @setActiveItem item.item


  activateNextApp: (e) ->

    e.preventDefault()
    item = @getRelativeItem 1, isRunning
    @setActiveItem item.item


  setActiveItem: (item) ->

    KD.singletons.router.handleRoute item.getData().path


  trackStateTransitions: ->

    @itemStates = []
    @activeIndex = null
    @on 'NavItemStateChanged', (info) ->
