A MenuSelectionManager owns the selection in menu hierarchy.
protected var lastTriggerRef:WeakReference
protected var selection:Vector
public function MenuSelectionManager()
protected function __onMSMKeyDown(e:KeyboardEvent):voidParameters
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
protected function besideSubElement(parent:MenuElement, sub:MenuElement, dir:Number):MenuElementParameters
Returns
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.
|
public static function defaultManager():MenuSelectionManager
Returns
protected function fireSelectionChanged(programmatic:Boolean):voidParameters
public function getSelectedPath():Array
Returns the path to the currently selected menu item
Returns
| Array — an array of MenuElement objects representing the selected path
|
public function isComponentPartOfCurrentMenu(c:Component):Boolean
Return true if c is part of the currently used menu
Parameters
Returns
protected function isComponentPartOfMenu(root:MenuElement, c:Component):BooleanParameters
Returns
public function isEnterKey(code:uint):BooleanParameters
Returns
public function isEscKey(code:uint):BooleanParameters
Returns
public function isItemNavKey(code:uint):BooleanParameters
Returns
public function isNavigatingKey(code:uint):BooleanParameters
Returns
public function isNextItemKey(code:uint):BooleanParameters
Returns
public function isNextPageKey(code:uint):BooleanParameters
Returns
public function isPageNavKey(code:uint):BooleanParameters
Returns
public function isPrevItemKey(code:uint):BooleanParameters
Returns
public function isPrevPageKey(code:uint):BooleanParameters
Returns
public function nextSubElement(parent:MenuElement, sub:MenuElement):MenuElementParameters
Returns
public function prevSubElement(parent:MenuElement, sub:MenuElement):MenuElementParameters
Returns
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
public static function setDefaultManager(m:MenuSelectionManager):void
Replaces the default manager by yours.
Parameters
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 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:
| Property | Value |
bubbles | false |
cancelable | false |
isProgrammatic() | True means this event is fired by
the programmatic reason, false means user mouse/keyboard interaction reason. |
currentTarget | The 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. |
target | The 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. |