     @restoreFocus() if filterEditorViewFocused
     @cancelling = false
     clearTimeout(@scheduleTimeout)
+
+  # Public: Store the currently focused element. This element will be given
+  # back focus when {::cancel} is called.
+  storeFocusedElement: ->
+    @previouslyFocusedElement = $(':focus')
+
+  ###
+  Section: Private
+  ###
+
+  selectPreviousItemView: ->
+    view = @getSelectedItemView().prev()
+    view = @list.find('li:last') unless view.length
+    @selectItemView(view)
+
+  selectNextItemView: ->
+    view = @getSelectedItemView().next()
+    view = @list.find('li:first') unless view.length
+    @selectItemView(view)
+
+  selectItemView: (view) ->
+    return unless view.length
+    @list.find('.selected').removeClass('selected')
+    view.addClass('selected')
+    @scrollToItemView(view)
+
+  scrollToItemView: (view) ->
+    scrollTop = @list.scrollTop()
+    desiredTop = view.position().top + scrollTop
+    desiredBottom = desiredTop + view.outerHeight()
+
+    if desiredTop < scrollTop
+      @list.scrollTop(desiredTop)
+    else if desiredBottom > @list.scrollBottom()
+      @list.scrollBottom(desiredBottom)
+
+  restoreFocus: ->
+    if @previouslyFocusedElement?.isOnDom()
+      @previouslyFocusedElement.focus()
+    else
+      atom.workspaceView.focus()
+
+  cancelled: ->
+    @filterEditorView.getEditor().setText('')
+
+  getSelectedItemView: ->
+    @list.find('li.selected')
+
+  confirmSelection: ->
+    item = @getSelectedItem()
+    if item?
+      @confirmed(item)
+    else
+      @cancel()
+
+  schedulePopulateList: ->
+    clearTimeout(@scheduleTimeout)
+    populateCallback = =>
+      @populateList() if @isOnDom()
+    @scheduleTimeout = setTimeout(populateCallback,  @inputThrottle)

      @confirmSelection() if $(e.target).closest('li').hasClass('selected')
      e.preventDefault()

  schedulePopulateList: ->
    clearTimeout(@scheduleTimeout)
    populateCallback = =>
      @populateList() if @isOnDom()
    @scheduleTimeout = setTimeout(populateCallback,  @inputThrottle)

  # Public: Set the array of items to display in the list.
  #

  # Returns a {String} message (default: 'No matches found').
  getEmptyMessage: (itemCount, filteredItemCount) -> 'No matches found'

  ###
  Section: View Actions
  ###

  # Public: Focus the fuzzy filter editor view.
  focusFilterEditor: ->
    @filterEditorView.focus()

  # Public: Cancel and close this select list view.
  #
