Packageorg.aswing
Classpublic class MenuSelectionManager
InheritanceMenuSelectionManager Inheritance flash.events.EventDispatcher

A MenuSelectionManager owns the selection in menu hierarchy.



Protected Properties
 PropertyDefined by
  lastTriggerRef : WeakReference
MenuSelectionManager
  selection : Vector
MenuSelectionManager
Public Methods
 MethodDefined by
  
MenuSelectionManager
  
addSelectionListener(listener:Function, priority:int = 0, useWeakReference:Boolean = false):void
Adds a listener to listen the menu seletion change event.
MenuSelectionManager
  
clearSelectedPath(programmatic:Boolean):void
Tell the menu selection to close and unselect all the menu components.
MenuSelectionManager
  
[static]
MenuSelectionManager
  
Returns the path to the currently selected menu item
MenuSelectionManager
  
Return true if c is part of the currently used menu
MenuSelectionManager
  
isEnterKey(code:uint):Boolean
MenuSelectionManager
  
isEscKey(code:uint):Boolean
MenuSelectionManager
  
isItemNavKey(code:uint):Boolean
MenuSelectionManager
  
isNavigatingKey(code:uint):Boolean
MenuSelectionManager
  
isNextItemKey(code:uint):Boolean
MenuSelectionManager
  
isNextPageKey(code:uint):Boolean
MenuSelectionManager
  
isPageNavKey(code:uint):Boolean
MenuSelectionManager
  
isPrevItemKey(code:uint):Boolean
MenuSelectionManager
  
isPrevPageKey(code:uint):Boolean
MenuSelectionManager
  
MenuSelectionManager
  
MenuSelectionManager
  
removeSelectionListener(listener:Function):void
Removes a menu seletion change listener.
MenuSelectionManager
  
[static] Replaces the default manager by yours.
MenuSelectionManager
  
setSelectedPath(trigger:InteractiveObject, path:Array, programmatic:Boolean):void
Changes the selection in the menu hierarchy.
MenuSelectionManager
Protected Methods
 MethodDefined by
  
__onMSMKeyDown(e:KeyboardEvent):void
MenuSelectionManager
  
MenuSelectionManager
  
fireSelectionChanged(programmatic:Boolean):void
MenuSelectionManager
  
MenuSelectionManager
Events
 EventSummaryDefined by
   Dispatched when the menu selection changed.MenuSelectionManager
Property detail
lastTriggerRefproperty
protected var lastTriggerRef:WeakReference
selectionproperty 
protected var selection:Vector
Constructor detail
MenuSelectionManager()constructor
public function MenuSelectionManager()
Method detail
__onMSMKeyDown()method
protected function __onMSMKeyDown(e:KeyboardEvent):voidParameters
e:KeyboardEvent
addSelectionListener()method 
public function addSelectionListener(listener:Function, priority:int = 0, useWeakReference:Boolean = false):void

Adds a listener to listen the menu seletion change event.

Parameters
listener:Function — the listener
 
priority:int (default = 0) — the priority
 
useWeakReference:Boolean (default = false) — Determines whether the reference to the listener is strong or weak.

See also

org.aswing.event.InteractiveEvent.STATE_CHANGED
besideSubElement()method 
protected function besideSubElement(parent:MenuElement, sub:MenuElement, dir:Number):MenuElementParameters
parent:MenuElement
 
sub:MenuElement
 
dir:Number

Returns
MenuElement
clearSelectedPath()method 
public function clearSelectedPath(programmatic:Boolean):void

Tell the menu selection to close and unselect all the menu components. Call this method when a choice has been made.

Parameters
programmatic:Boolean — indicate if this is a programmatic change.
defaultManager()method 
public static function defaultManager():MenuSelectionManager

Returns
MenuSelectionManager
fireSelectionChanged()method 
protected function fireSelectionChanged(programmatic:Boolean):voidParameters
programmatic:Boolean
getSelectedPath()method 
public function getSelectedPath():Array

Returns the path to the currently selected menu item

Returns
Array — an array of MenuElement objects representing the selected path
isComponentPartOfCurrentMenu()method 
public function isComponentPartOfCurrentMenu(c:Component):Boolean

Return true if c is part of the currently used menu

Parameters
c:Component

Returns
Boolean
isComponentPartOfMenu()method 
protected function isComponentPartOfMenu(root:MenuElement, c:Component):BooleanParameters
root:MenuElement
 
c:Component

Returns
Boolean
isEnterKey()method 
public function isEnterKey(code:uint):BooleanParameters
code:uint

Returns
Boolean
isEscKey()method 
public function isEscKey(code:uint):BooleanParameters
code:uint

Returns
Boolean
isItemNavKey()method 
public function isItemNavKey(code:uint):BooleanParameters
code:uint

Returns
Boolean
isNavigatingKey()method 
public function isNavigatingKey(code:uint):BooleanParameters
code:uint

Returns
Boolean
isNextItemKey()method 
public function isNextItemKey(code:uint):BooleanParameters
code:uint

Returns
Boolean
isNextPageKey()method 
public function isNextPageKey(code:uint):BooleanParameters
code:uint

Returns
Boolean
isPageNavKey()method 
public function isPageNavKey(code:uint):BooleanParameters
code:uint

Returns
Boolean
isPrevItemKey()method 
public function isPrevItemKey(code:uint):BooleanParameters
code:uint

Returns
Boolean
isPrevPageKey()method 
public function isPrevPageKey(code:uint):BooleanParameters
code:uint

Returns
Boolean
nextSubElement()method 
public function nextSubElement(parent:MenuElement, sub:MenuElement):MenuElementParameters
parent:MenuElement
 
sub:MenuElement

Returns
MenuElement
prevSubElement()method 
public function prevSubElement(parent:MenuElement, sub:MenuElement):MenuElementParameters
parent:MenuElement
 
sub:MenuElement

Returns
MenuElement
removeSelectionListener()method 
public function removeSelectionListener(listener:Function):void

Removes a menu seletion change listener.

Parameters
listener:Function — the listener to be removed.

See also

org.aswing.event.InteractiveEvent.STATE_CHANGED
setDefaultManager()method 
public static function setDefaultManager(m:MenuSelectionManager):void

Replaces the default manager by yours.

Parameters
m:MenuSelectionManager
setSelectedPath()method 
public function setSelectedPath(trigger:InteractiveObject, path:Array, programmatic:Boolean):void

Changes the selection in the menu hierarchy. The elements in the array are sorted in order from the root menu element to the currently selected menu element.

Note that this method is public but is used by the look and feel engine and should not be called by client applications.

Parameters
trigger:InteractiveObject — an array of MenuElement objects specifying the selected path.
 
path:Array — indicate if this is a programmatic change.
 
programmatic:Boolean
Event detail
selectionChangedevent 
Event object type: org.aswing.event.InteractiveEvent
InteractiveEvent.type property = org.aswing.event.InteractiveEvent.SELECTION_CHANGED

Dispatched when the menu selection changed.

The InteractiveEvent.SELECTION_CHANGED constant defines the value of the type property of the event object for a selectionChanged event.

The properties of the event object have the following values:

PropertyValue
bubblesfalse
cancelablefalse
isProgrammatic()True means this event is fired by the programmatic reason, false means user mouse/keyboard interaction reason.
currentTargetThe Object that defines the event listener that handles the event. For example, if you use comp.addEventListener() to register an event listener, comp is the value of the currentTarget.
targetThe Object that dispatched the event; it is not always the Object listening for the event. Use the currentTarget property to always access the Object listening for the event.