       else optionSet.lastActiveIndex = index
 
 
-
-
-
   # setGroup:-> console.log 'setGroup', arguments
 
   # openFileWithApplication:(file, appPath)->


    @appControllers = {}
    @frontApp       = null
    @defaultApps    =
      text  : "Ace"
      video : "Viewer"
      image : "Viewer"
      sound : "Viewer"
    @on 'AppManagerWantsToShowAnApp', @bound "setFrontApp"

    # temp fix, until router logic is complete
    @on 'AppManagerWantsToShowAnApp', @bound "setMissingRoute"

  # temp fix, until router logic is complete
  setMissingRoute:(appController, appView, appOptions)->

      callback?()


  openFile: (file, app) ->

    type = FSItem.getFileType file.getExtension()

    switch type
      when 'code','text','unknown'
        log "open with a text editor"
        @open app or @defaultApps.text,  (appController = @getFrontApp()) =>
          appController.openFile file
      when 'image'
        @open app or @defaultApps.image, (appController = @getFrontApp()) =>
          appController.openFile file
      when 'video'
        log "open with a video app"
      when 'sound'
