Apache Flex (FlexJS) 0.7.0 API Reference | All Packages | All Classes | Index | Frames No Frames |
WatcherBase

Package | org.apache.flex.binding
Class | public class WatcherBase
Inheritance | WatcherBase Object
Subclasses | PropertyWatcher

Language Version : | ActionScript 3.0

Product Version : | FlexJS 0.0

Runtime Versions : | Flash Player 10.2, AIR 2.6

The WatcherBase class is the base class for data-binding classes that watch various properties and styles for changes.

Public Properties

| Property | Defined By
--- | --- | ---
|  | allowedErrors : Array [static] Certain errors are normal when executing an update, so we swallow them. | WatcherBase
|  | allowedErrorTypes : Array [static] Certain errors classes are normal when executing an update, so we swallow all errors they represent. | WatcherBase
|  | value : Object The value of whatever it is we are watching. | WatcherBase

Protected Properties

| Property | Defined By
--- | --- | ---
|  | children : Array Children of this watcher are watching sub values. | WatcherBase
|  | listeners : Array The binding objects that are listening to this Watcher. | WatcherBase

Public Methods

| Method | Defined By
--- | --- | ---
|  | WatcherBase() Constructor. | WatcherBase
|  | addBinding(binding:GenericBinding):void Add a binding to this watcher, meaning that the binding is notified when our value changes. | WatcherBase
|  | addChild(child:WatcherBase):void Add a child to this watcher, meaning that the child is watching a sub value of ours. | WatcherBase
|  | notifyListeners():void Notify the various bindings that the value has changed so they can update their data binding expressions. | WatcherBase
|  | parentChanged(parent:Object):void This is an abstract method that subclasses implement. | WatcherBase
|  | updateChildren():void This method is called when the value might have changed and goes through and makes sure the children are updated. | WatcherBase

Protected Methods

| Method | Defined By
--- | --- | ---
|  | wrapUpdate(wrappedFunction:Function):void Calls a function inside a try catch block to try to update the value. | WatcherBase

Property Detail

allowedErrors | property

`public static var allowedErrors:Array`

Language Version : | ActionScript 3.0

Product Version : | FlexJS 0.0

Runtime Versions : | Flash Player 10.2, AIR 2.6

Certain errors are normal when executing an update, so we swallow them. Feel free to add more errors if needed.

allowedErrorTypes | property |

`public static var allowedErrorTypes:Array`

Language Version : | ActionScript 3.0

Product Version : | FlexJS 0.0

Runtime Versions : | Flash Player 10.2, AIR 2.6

Certain errors classes are normal when executing an update, so we swallow all errors they represent. Feel free to add more errors if needed.

children | property |

`protected var children:Array`

Language Version : | ActionScript 3.0

Product Version : | FlexJS 0.0

Runtime Versions : | Flash Player 10.2, AIR 2.6

Children of this watcher are watching sub values. For example, if watching {a.b.c} and this watcher is watching "b", then it is the watchers watching "c" and "d" if there is an {a.b.d} being watched.

listeners | property |

`protected var listeners:Array`

Language Version : | ActionScript 3.0

Product Version : | FlexJS 0.0

Runtime Versions : | Flash Player 10.2, AIR 2.6

The binding objects that are listening to this Watcher. The standard event mechanism isn't used because it's too heavyweight.

value | property |

`public var value:Object`

Language Version : | ActionScript 3.0

Product Version : | FlexJS 0.0

Runtime Versions : | Flash Player 10.2, AIR 2.6

The value of whatever it is we are watching. For example, if watching {a.b.c} and this watcher is watching "b", then it is the value of "a.b".

Constructor Detail

WatcherBase | () | Constructor

`public function WatcherBase()`

Language Version : | ActionScript 3.0

Product Version : | Flex 3

Runtime Versions : | Flash Player 9, AIR 1.1

Constructor.

Method Detail

addBinding | () | method

`public function addBinding(binding:GenericBinding):void`

Language Version : | ActionScript 3.0

Product Version : | FlexJS 0.0

Runtime Versions : | Flash Player 10.2, AIR 2.6

Add a binding to this watcher, meaning that the binding is notified when our value changes. Bindings are classes that actually perform the change based on changes detected to this portion of the chain.

Parameters

| `binding:GenericBinding` — The new binding.

addChild | () | method |

`public function addChild(child:WatcherBase):void`

Language Version : | ActionScript 3.0

Product Version : | FlexJS 0.0

Runtime Versions : | Flash Player 10.2, AIR 2.6

Add a child to this watcher, meaning that the child is watching a sub value of ours. For example, if watching {a.b.c} and this watcher is watching "b", then this method is called to add the watcher watching "c".

Parameters

| `child:WatcherBase` — The new child

notifyListeners | () | method |

`public function notifyListeners():void`

Language Version : | ActionScript 3.0

Product Version : | FlexJS 0.0

Runtime Versions : | Flash Player 10.2, AIR 2.6

Notify the various bindings that the value has changed so they can update their data binding expressions.

parentChanged | () | method |

`public function parentChanged(parent:Object):void`

Language Version : | ActionScript 3.0

Product Version : | FlexJS 0.0

Runtime Versions : | Flash Player 10.2, AIR 2.6

This is an abstract method that subclasses implement. Implementations handle changes in the parent chain. For example, if watching {a.b.c} and this watcher is watching "b", then handle "a" changing.

Parameters

| `parent:Object` — The new parent.

updateChildren | () | method |

`public function updateChildren():void`

Language Version : | ActionScript 3.0

Product Version : | FlexJS 0.0

Runtime Versions : | Flash Player 10.2, AIR 2.6

This method is called when the value might have changed and goes through and makes sure the children are updated.

wrapUpdate | () | method |

`protected function wrapUpdate(wrappedFunction:Function):void`

Language Version : | ActionScript 3.0

Product Version : | FlexJS 0.0

Runtime Versions : | Flash Player 10.2, AIR 2.6

Calls a function inside a try catch block to try to update the value.

Parameters

| `wrappedFunction:Function` — The function to call.

Mon Sep 5 2016, 07:19 AM -07:00