ToggleGroup

public class
feathers.core.ToggleGroup

Description

Controls the selection of two or more IToggle instances where only one may be selected at a time.

See also:
feathers.core.IToggle

API overview

Constructor

ToggleGroup ()
Constructor.

Attributes

Public attributes

isSelectionRequired: Boolean

Determines if the user can deselect the currently selected item or not

selectedIndex: Number

The index of the currently selected toggle

selectedItem: IToggle

The currently selected toggle

Functions

Public functions

addItem ( item: IToggle ): Void

Adds a toggle to the group

hasItem ( item: IToggle ): Boolean

Determines if the group includes the specified item

removeAllItems (): Void

Removes all toggles from the group

removeItem ( item: IToggle ): Void

Removes a toggle from the group

Constructor

ToggleGroup ()

Constructor.

Attributes

isSelectionRequired: Boolean

Determines if the user can deselect the currently selected item or not. The selection may always be cleared programmatically by setting the selected index to -1 or the selected item to null.

If isSelectionRequired is set to true and the toggle group has items that were added previously, and there is no currently selected item, the item at index 0 will be selected automatically.

selectedIndex: Number

The index of the currently selected toggle.

selectedItem: IToggle

The currently selected toggle.

Functions

addEventListener ( type: String , listener: Function ): Void
Inherited from EventDispatcher

Registers an event listener at a certain object.

Parameters

type: String
listener: Function


addItem ( item: IToggle ): Void

Adds a toggle to the group. If it is the first item added to the group, and isSelectionRequired is true, it will be selected automatically.

Parameters

item: IToggle


dispatchEvent ( event: Event ): Void
Inherited from EventDispatcher

Dispatches an event to all objects that have registered listeners for its type. If an event with enabled 'bubble' property is dispatched to a display object, it will travel up along the line of parents, until it either hits the root object or someone stops its propagation manually.

Parameters

event: Event


dispatchEventWith ( type: String , bubbles: Boolean = false , data: Object = null ): Void
Inherited from EventDispatcher

Dispatches an event with the given parameters to all objects that have registered listeners for the given type. The method uses an internal pool of event objects to avoid allocations.

Parameters

type: String
bubbles: Boolean = false
data: Object = null


getFullTypeName (): String
Inherited from Object

native

Gets the fully qualified type name of the Object. The fully qualified type name includes the package of the type.


Returns

String fully qualified type name of the Object.

getType (): Type
Inherited from Object

native

Gets the Type that describes the Object.


Returns

Type The Type that describes the object.

getTypeName (): String
Inherited from Object

native

Gets the type name of the Object.


Returns

String type name of the Object.

hasEventListener ( type: String ): Boolean
Inherited from EventDispatcher

Returns if there are listeners registered for a certain event type.

Parameters

type: String


hasItem ( item: IToggle ): Boolean

Determines if the group includes the specified item.

Parameters

item: IToggle


removeAllItems (): Void

Removes all toggles from the group. No item will be selected.



removeEventListener ( type: String , listener: Function ): Void
Inherited from EventDispatcher

Removes an event listener from the object.

Parameters

type: String
listener: Function


removeEventListeners ( type: String = null ): Void
Inherited from EventDispatcher

Removes all event listeners with a certain type, or all of them if type is null. Be careful when removing all event listeners: you never know who else was listening.

Parameters

type: String = null


removeItem ( item: IToggle ): Void

Removes a toggle from the group. If the item being removed is selected and isSelectionRequired is true, the final item will be selected. If isSelectionRequired is false instead, no item will be selected.

Parameters

item: IToggle


toString (): String
Inherited from Object

native

Returns a String that describes the Object. This can be overriden to provide extra details when printing objects using trace().


Returns

String String that described the Object.

: