| Package | com.developmentarc.framework.controllers |
| Class | public class SelectionController |
Items can be selected outside of the SelectionController and the selection of other items will not be modified unless the selection action is made through the SelectionController. This allows developers to create multi-selectable groupings and only when the selection of a specific item, group deselection or group selection is required should the SelectionController be used.
| Method | Defined by | ||
|---|---|---|---|
|
addItem(item:ISelectable, groupId:int):void
[static]
Adds a Selectable item to a specificed group id.
| SelectionController | ||
|
clearAllGroups():void
[static]
This method removes all items and groups from the SelectionController.
| SelectionController | ||
|
deselectAll(group:int):void
[static]
Used to deselect all items in a selection group.
| SelectionController | ||
|
generateNewId():int
[static]
Used to generate a unique group id.
| SelectionController | ||
|
getAllItemsInGroup(group:int):Array
[static]
Returns a list of items that are members of the provided group.
| SelectionController | ||
|
getItemGroup(item:ISelectable):int
[static]
Returns the specified item's group id number.
| SelectionController | ||
|
getSelected(groupId:int):Array
[static]
Method returns an array of all currently selected items in the specified group.
| SelectionController | ||
|
removeAllItems(groupId:int):void
[static]
Removes all the items and the group id from the controller.
| SelectionController | ||
|
removeItem(item:ISelectable):void
[static]
Removes the item from the manager and the boung group.
| SelectionController | ||
|
selectAll(group:int):void
[static]
Used to select all the items within a selection group.
| SelectionController | ||
|
selectItem(item:ISelectable):void
[static]
Sets the selected property for the specified item and deselects any other items
within the same group as the specified item.
| SelectionController | ||
| addItem | () | method |
public static function addItem(item:ISelectable, groupId:int):voidAdds a Selectable item to a specificed group id. The group id should be a unique id that defines the group the item belongs to. Use the generateNewId() method on this class to generate a unique that the id which is not in use within the manager.
If an item is already assigne to a group id this method will remove the item from the previous group and re-assign the item to a new group. Items can only be assigned to one group id within the SelectionController.
Parametersitem:ISelectable — The item to add to the group.
|
|
groupId:int — The group id to add the item to.
|
| clearAllGroups | () | method |
public static function clearAllGroups():voidThis method removes all items and groups from the SelectionController. This method is considered a full reset and removes all references and group ids from the instance.
| deselectAll | () | method |
public static function deselectAll(group:int):voidUsed to deselect all items in a selection group. This method sets the selected value on all the group items to false.
Parametersgroup:int |
| generateNewId | () | method |
public static function generateNewId():intUsed to generate a unique group id. This should be called when creating a new g rouping to verify that the provided id is unique in the system.
Returnsint — A unique generated group id.
|
| getAllItemsInGroup | () | method |
public static function getAllItemsInGroup(group:int):ArrayReturns a list of items that are members of the provided group. This is a cloned array of the internal list and modifying the order or content of the Array will not affect group membership or order. If the provided group id is not used or found then an empty Array is returned.
Parametersgroup:int — The group id to lookup.
|
Array — The list of ISelectable items bound to the provided group.
|
| getItemGroup | () | method |
public static function getItemGroup(item:ISelectable):intReturns the specified item's group id number. This method looks up the item in the SelectionController and provides the group id that is currently assigned to an item. If the item is not being tracked / assigned to a group id then the value -1 is returned which represents no group id.
Parametersitem:ISelectable — Item to look group up on.
|
int — The group the item is a member of.
|
| getSelected | () | method |
public static function getSelected(groupId:int):ArrayMethod returns an array of all currently selected items in the specified group.
ParametersgroupId:int — group id.
|
Array — An Array containing all items currently selected.
|
| removeAllItems | () | method |
public static function removeAllItems(groupId:int):voidRemoves all the items and the group id from the controller.
ParametersgroupId:int — The group to remove the items from.
|
| removeItem | () | method |
public static function removeItem(item:ISelectable):voidRemoves the item from the manager and the boung group. If the item is the last of the group, the group is removed from the SelectionController and is no longer considered a valid group id. The group id can be re-used when calling addItem() but verify that the no other items are assigned to the group at the time of reuse.
Parametersitem:ISelectable — The item to remove from the group.
|
| selectAll | () | method |
public static function selectAll(group:int):voidUsed to select all the items within a selection group. This method sets the selected value on all the group items to true.
Parametersgroup:int — The selection group to select.
|
| selectItem | () | method |
public static function selectItem(item:ISelectable):voidSets the selected property for the specified item and deselects any other items within the same group as the specified item. This method is responsible for looking up the group id for the specified item. If the item is not within a defined group which is being tracked by the SelectionController then only the provided item will be selected and the any other items in the SelectionController will be unaffected.
Parametersitem:ISelectable — The item to select.
|