new ChangeModel()
This model can keep an object in memory and emit messages if this object is changing.
- Implements:
Example
var beforeChanged = function( value , model ) { trace( "before:" + value + " current:" + model.current ) ; } var changed = function( value , model ) { trace( "change:" + value + " current:" + model.current ) ; } var cleared = function( model ) { trace( "clear current:" + model.current ) ; } var model = new ChangeModel() ; model.beforeChanged.connect( beforeChanged ) ; model.changed.connect( changed ) ; model.cleared.connect( cleared ) ; model.current = "hello" ; model.current = "world" ; model.current = null ;
Members
-
<constant> beforeChanged :system.signals.Signal
-
Emits a message before the current object in the model is changed.
Type:
-
<constant> changed :system.signals.Signal
-
Emits a message when the current object in the model is changed.
Type:
-
<constant> cleared :system.signals.Signal
-
Emits a message when the current object in the model is cleared.
Type:
-
current
-
Determinates the current selected value in this model.
-
security :boolean
-
This property defined if the current property can accept the same object in argument as the current one.
Type:
- boolean
- Default Value:
-
- true
Methods
-
clear()
-
Clear the model.
-
notifyBeforeChange()
-
Notify a signal before the specified value is changed.
-
notifyChange()
-
Notify a signal when the model is changed.
-
notifyClear()
-
Notify a signal when the model is cleared.