Packageorg.aswing
Interfacepublic interface MenuElement
ImplementorsJMenu, JMenuBar, JMenuItem, JPopupMenu

Any component that can be placed into a menu should implement this interface. This interface is used by MenuSelectionManager to handle selection and navigation in menu hierarchies.



Public Methods
 MethodDefined by
  
This method should return the Component used to paint the receiving element.
MenuElement
  
This method should return an array containing the sub-elements for the receiving menu element
MenuElement
  
isInUse():Boolean
Returns whether the menu element is in use or not.
MenuElement
  
menuSelectionChanged(isIncluded:Boolean):void
Call by the MenuSelectionManager when the MenuElement is added or remove from the menu selection.
MenuElement
  
processKeyEvent(code:uint):void
Precess the selection when key typed.
MenuElement
  
setInUse(b:Boolean):void
Sets whether the menu element is in use.
MenuElement
Method detail
getMenuComponent()method
public function getMenuComponent():Component

This method should return the Component used to paint the receiving element. The returned component will be used to convert events and detect if an event is inside a MenuElement's component.

Returns
Component — the Component value
getSubElements()method 
public function getSubElements():Array

This method should return an array containing the sub-elements for the receiving menu element

Returns
Array — an array of MenuElements
isInUse()method 
public function isInUse():Boolean

Returns whether the menu element is in use or not.

Returns
Boolean
menuSelectionChanged()method 
public function menuSelectionChanged(isIncluded:Boolean):void

Call by the MenuSelectionManager when the MenuElement is added or remove from the menu selection.

Parameters
isIncluded:Boolean
processKeyEvent()method 
public function processKeyEvent(code:uint):void

Precess the selection when key typed.

Parameters
code:uint
setInUse()method 
public function setInUse(b:Boolean):void

Sets whether the menu element is in use.

Parameters
b:Boolean