 		super()
 		@__body?.destroy()
 
-	__initKeydownListener: ->
+	__initListeners: ->
 		@__keyboardKeys = []
 		preSelectByKeyword = =>
 			@__preSelectByKeyword(@__keyboardKeys.join(""))

		@append(@__body, "center")

		if @_keyboardControl
			@__initKeydownListener()

	initOpts: ->
		super()

							CUI.scheduleCallback(ms: 200, call: preSelectByKeyword)
				return

		CUI.Events.listen
			type: "mouseover"
			node: @DOM
			call: (ev) =>
				item = CUI.dom.parents(ev.getTarget(), ".cui-button")[0]
				if CUI.dom.hasClass(item, CUI.defaults.class.Button.defaults.active_css_class)
					return

				index = @__getButtonIndex(item)
				if not CUI.util.isNull(index)
					@__preActivateButtonByIndex(index)
				return

		return

	__preSelectByKeyword: (keyword) ->
		elementMatches = (element) =>
			(element instanceof CUI.Button or element instanceof CUI.Label) and element.getText()?.startsWithIgnoreCase(keyword)

		nextIndex = @__preActiveIndex + 1
		nextElement = @__getButtonByIndex(nextIndex)
		if elementMatches(nextElement)
			@__preActivateButtonByIndex(nextIndex)
			return

		for item, index in @__body?.DOM.children
			element = CUI.dom.data(item, "element")
			if elementMatches(element)
				@__preActivateButtonByIndex(index)
				break
		return

	__activatePreSelected: (event) ->
		itemToActivate = @__getButtonByIndex(@__preActiveIndex)
		if itemToActivate instanceof CUI.Button
			itemToActivate.onClickAction(event)
			CUI.dom.removeClass(itemToActivate, CUI.defaults.class.Button.defaults.active_css_class)

	__preActivateNextButton: ->
		if CUI.util.isNull(@__preActiveIndex)
			index = 0
		else
			index = @__preActiveIndex + 1
		@__preActivateButtonByIndex(index)

	__preActivatePreviousButton: ->
		if CUI.util.isNull(@__preActiveIndex)
			items = @__getButtonItems()
			index = items.length - 1
		else
			index = @__preActiveIndex - 1
		@__preActivateButtonByIndex(index)

	__preActivateButtonByIndex: (newPreActiveIndex) ->
		buttonToPreActivate = @__getButtonByIndex(newPreActiveIndex)
		if buttonToPreActivate instanceof CUI.Button
			@__deselectPreActivated()
			@__preActiveIndex = newPreActiveIndex
			CUI.dom.addClass(buttonToPreActivate, CUI.defaults.class.Button.defaults.active_css_class)
			CUI.dom.scrollIntoView(buttonToPreActivate)

	__deselectPreActivated: ->
		previousItemSelected = @__getButtonByIndex(@__preActiveIndex)
		if previousItemSelected instanceof CUI.Button
			CUI.dom.removeClass(previousItemSelected, CUI.defaults.class.Button.defaults.active_css_class)

	__getButtonByIndex: (index) ->
		if not @__body or CUI.util.isNull(index) or index < 0
			return

		item = @__getButtonItems()[index]
		return CUI.dom.data(item, "element")

	__getButtonIndex: (item) ->
		for itemButton, index in @__getButtonItems()
			if item == itemButton
				return index
		return

	__getButtonItems: ->
		return Array::filter.call(@__body.DOM.children, (item) =>
			element = CUI.dom.data(item, "element")
			return element instanceof CUI.Button
		)

	__initPreActiveIndex: ->
		if @__active_idx
