     @onItemAdded(item) for item in @items
     @viewsByItem = new WeakMap()
     @handleEvents()
+
+  hasFocus: ->
+    @is(':focus') or @is(':has(:focus)')
 
   handleEvents: ->
     @subscribe @model.$activeItem, 'value', @onActiveItemChanged

    @itemViews.children().not(view).hide()
    @itemViews.append(view) unless view.parent().is(@itemViews)
    view.show() if @attached
    view.focus() if isFocused
    @activeView = view
    @trigger 'pane:active-item-changed', [item]


    toProperty: 'model'

  previousActiveItem: null

  # Private:
  initialize: (args...) ->
    if args[0] instanceof PaneModel
      @model = args[0]
    else
      @model = new PaneModel(items: args)
      @model._view = this
