 class KDTabPaneView extends KDView
+
   constructor:(options = {},data)->
 
     options.hiddenHandle ?= no      # a Boolean

    @on "KDTabPaneActive",        @bound "setMainView"
    @on "KDTabPaneLazyViewAdded", @bound "fireLazyCallback"

  show:->
    @unsetClass "kdhiddentab"
    @setClass "active"
    @active = yes
    @emit "KDTabPaneActive"

  hide:->
    @unsetClass "active"
    @setClass "kdhiddentab"
    @active = no
    @emit "KDTabPaneInactive"

  setTitle:(title)->
    @getDelegate().setPaneTitle @,title
    # @setOption "name", name
    @name = title

  getHandle: ->
    @getDelegate().getHandleByPane @

  hideTabCloseIcon:->
    @getDelegate().hideCloseIcon @

  setMainView:(view)->


    @emit "KDTabPaneLazyViewAdded", this, @mainView
    return @mainView


  getMainView:-> @mainView


  destroyMainView:->

    @mainView.destroy()
    delete @mainView


  fireLazyCallback:(pane, view)->

    {viewOptions} = @getOptions()
    return  unless viewOptions
    {callback} = viewOptions
