Packageorg.aswing
Interfacepublic interface SingleSelectionModel
ImplementorsDefaultSingleSelectionModel

A model that supports at most one indexed selection.



Public Methods
 MethodDefined by
  
addStateListener(listener:Function, priority:int = 0, useWeakReference:Boolean = false):void
Adds a listener to listen the Model's state change event.
SingleSelectionModel
  
clearSelection(programmatic:Boolean = true):void
Clears the selection (to -1).
SingleSelectionModel
  
Returns the model's selection.
SingleSelectionModel
  
isSelected():Boolean
Returns true if the selection model currently has a selected value.
SingleSelectionModel
  
removeStateListener(listener:Function):void
Removes a state listener.
SingleSelectionModel
  
setSelectedIndex(index:int, programmatic:Boolean = true):void
Sets the model's selected index to index.
SingleSelectionModel
Method detail
addStateListener()method
public function addStateListener(listener:Function, priority:int = 0, useWeakReference:Boolean = false):void

Adds a listener to listen the Model's state 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
clearSelection()method 
public function clearSelection(programmatic:Boolean = true):void

Clears the selection (to -1).

Parameters
programmatic:Boolean (default = true) — indicate if this is a programmatic change.
getSelectedIndex()method 
public function getSelectedIndex():int

Returns the model's selection.

Returns
int — the model's selection, or -1 if there is no selection

See also

isSelected()method 
public function isSelected():Boolean

Returns true if the selection model currently has a selected value.

Returns
Boolean — true if a value is currently selected
removeStateListener()method 
public function removeStateListener(listener:Function):void

Removes a state listener.

Parameters
listener:Function — the listener to be removed.

See also

org.aswing.event.InteractiveEvent.STATE_CHANGED
setSelectedIndex()method 
public function setSelectedIndex(index:int, programmatic:Boolean = true):void

Sets the model's selected index to index. Notifies any listeners if the model changes.

Parameters
index:int — an int specifying the model selection.
 
programmatic:Boolean (default = true) — indicate if this is a programmatic change.

See also