Packagecom.developmentarc.framework.controllers
Classpublic class SelectionGroup

Class defines a group of seletable items allowing the items to work as one entity. Upon selection of one of the items, each otheritem in the group is deselected. The goal of SelectionGroup is to provide developers with an alternative to the low-level direct access to the SelectionController provides. One advantage to using SelectionGroup is the ability to define groups and items via MXML, which SelectionController can not do.
By default SelectionGroup will listent o MouseClick.CLICK events, but this an be overriden by defined a comma seperated list of event types. Because SelectionGroup requires listeners when items are added to the group, ISelectable items must extend an EventDispatcher class or implement the IEventDispatcher.



Public Properties
 PropertyDefined by
  events : String
Returns the comma seperated list of events used by this group.
SelectionGroup
  groupId : int
Unique id of the group
SelectionGroup
  items : Array
Variable holds all items currently in the group
SelectionGroup
Public Methods
 MethodDefined by
  
Constructor.
SelectionGroup
  
addItem(item:ISelectable):void
Method takes an ISelectable item and adds the item to the selection group.
SelectionGroup
  
Used to remove an item from the selection group.
SelectionGroup
Protected Methods
 MethodDefined by
  
handleSelection(event:Event):void
Handler method for each event the group is listening to to indicate selection.
SelectionGroup
Property detail
eventsproperty
events:String  [read-write]

Returns the comma seperated list of events used by this group.

Implementation
    public function get events():String
    public function set events(value:String):void
groupIdproperty 
groupId:int  [read-write]

Unique id of the group

Implementation
    public function get groupId():int
    public function set groupId(value:int):void
itemsproperty 
items:Array  [read-write]

Variable holds all items currently in the group

Implementation
    public function get items():Array
    public function set items(value:Array):void
Constructor detail
SelectionGroup()constructor
public function SelectionGroup()

Constructor. Automatically generates a unique id for the selection group.

Method detail
addItem()method
public function addItem(item:ISelectable):void

Method takes an ISelectable item and adds the item to the selection group.

Parameters
item:ISelectable — Item to be added to the selection group.
handleSelection()method 
protected function handleSelection(event:Event):void

Handler method for each event the group is listening to to indicate selection.

Parameters
event:Event — Event dispatched from ISelectableItem
removeItem()method 
public function removeItem(item:ISelectable):void

Used to remove an item from the selection group.

Parameters
item:ISelectable — The item to remove from the group.