Pakiet | mx.binding.utils |
Klasa | public class ChangeWatcher |
Dziedziczenie | ChangeWatcher Object |
Wersja języka: | ActionScript 3.0 |
Wersja produktu: | Flex 3 |
Wersje środowiska wykonawczego: | Flash Player 9, AIR 1.1 |
Właściwość | Zdefiniowane przez | ||
---|---|---|---|
constructor : Object
Odwołanie do obiektu klasy lub funkcji konstruktora, dotyczące danej instancji obiektu. | Object | ||
useWeakReference : Boolean
Determines whether the reference to handler
is strong or weak. | ChangeWatcher |
Metoda | Zdefiniowane przez | ||
---|---|---|---|
ChangeWatcher(access:Object, handler:Function, commitOnly:Boolean = false, next:ChangeWatcher = null)
Constructor. | ChangeWatcher | ||
[statyczny]
Lets you determine if the host exposes a data-binding event
on the property. | ChangeWatcher | ||
[statyczny]
Returns all binding events for a bindable property in the host object. | ChangeWatcher | ||
Retrieves the current value of the watched property or property chain,
or null if the host object is null. | ChangeWatcher | ||
Wskazuje, czy dla obiektu zdefiniowano określoną właściwość. | Object | ||
Wskazuje, czy instancja klasy Object należy do łańcucha prototypów obiektu określonego jako parametr. | Object | ||
Returns true if each watcher in the chain is attached
to at least one change event. | ChangeWatcher | ||
Wskazuje, czy określona właściwość istnieje i jest przeliczalna. | Object | ||
Resets this ChangeWatcher instance to use a new host object. | ChangeWatcher | ||
Sets the handler function. | ChangeWatcher | ||
Ustawia dostępność właściwości dynamicznej używanej w pętlach. | Object | ||
Zwraca ciąg reprezentujący obiekt — sformatowany zgodnie z konwencjami właściwymi dla ustawień regionalnych. | Object | ||
Zwraca ciąg reprezentujący określony obiekt. | Object | ||
Detaches this ChangeWatcher instance, and its handler function,
from the current host. | ChangeWatcher | ||
Zwraca pierwotną wartość dla określonego obiektu. | Object | ||
watch(host:Object, chain:Object, handler:Function, commitOnly:Boolean = false, useWeakReference:Boolean = false):ChangeWatcher [statyczny]
Creates and starts a ChangeWatcher instance. | ChangeWatcher |
useWeakReference | właściwość |
public var useWeakReference:Boolean
Wersja języka: | ActionScript 3.0 |
Wersja produktu: | Flex 3 |
Wersje środowiska wykonawczego: | Flash Player 9, AIR 1.1 |
Determines whether the reference to handler
is strong or weak.
A strong reference (the default) prevents
handler
from being garbage-collected.
A weak reference does not.
Wartością domyślną jest false.
ChangeWatcher | () | Konstruktor |
public function ChangeWatcher(access:Object, handler:Function, commitOnly:Boolean = false, next:ChangeWatcher = null)
Wersja języka: | ActionScript 3.0 |
Wersja produktu: | Flex 3 |
Wersje środowiska wykonawczego: | Flash Player 9, AIR 1.1 |
Constructor.
Not for public use. This method is called only from the watch()
method.
See the watch()
method for parameter usage.
access:Object | |
handler:Function | |
commitOnly:Boolean (default = false )
| |
next:ChangeWatcher (default = null )
|
canWatch | () | metoda |
public static function canWatch(host:Object, name:String, commitOnly:Boolean = false):Boolean
Wersja języka: | ActionScript 3.0 |
Wersja produktu: | Flex 3 |
Wersje środowiska wykonawczego: | Flash Player 9, AIR 1.1 |
Lets you determine if the host exposes a data-binding event on the property.
NOTE: Property chains are not supported by the canWatch()
method.
They are supported by the watch()
method.
Parametry
host:Object — The host of the property.
See the watch() method for more information.
| |
name:String — The name of the property.
See the watch() method for more information.
| |
commitOnly:Boolean (default = false ) — Set to true if the handler
should be called only on committing change events.
See the watch() method for more information.
|
Boolean — true if host exposes
any change events on name .
|
getEvents | () | metoda |
public static function getEvents(host:Object, name:String, commitOnly:Boolean = false):Object
Wersja języka: | ActionScript 3.0 |
Wersja produktu: | Flex 3 |
Wersje środowiska wykonawczego: | Flash Player 9, AIR 1.1 |
Returns all binding events for a bindable property in the host object.
Parametry
host:Object — The host of the property.
See the watch() method for more information.
| |
name:String — The name of the property, or property chain.
See the watch() method for more information.
| |
commitOnly:Boolean (default = false ) — Controls inclusion of non-committing
change events in the returned value.
|
Object — Object of the form { eventName: isCommitting, ... }
containing all change events for the property.
|
getValue | () | metoda |
public function getValue():Object
Wersja języka: | ActionScript 3.0 |
Wersja produktu: | Flex 3 |
Wersje środowiska wykonawczego: | Flash Player 9, AIR 1.1 |
Retrieves the current value of the watched property or property chain, or null if the host object is null. For example:
watch(obj, ["a","b","c"], ...).getValue() === obj.a.b.cZwraca
Object — The current value of the watched property or property chain.
|
isWatching | () | metoda |
public function isWatching():Boolean
Wersja języka: | ActionScript 3.0 |
Wersja produktu: | Flex 3 |
Wersje środowiska wykonawczego: | Flash Player 9, AIR 1.1 |
Returns true
if each watcher in the chain is attached
to at least one change event.
Note that the isWatching()
method
varies with host, since different hosts may expose different change
events for the watcher's chosen property.
Boolean — true if each watcher in the chain is attached
to at least one change event.
|
reset | () | metoda |
public function reset(newHost:Object):void
Wersja języka: | ActionScript 3.0 |
Wersja produktu: | Flex 3 |
Wersje środowiska wykonawczego: | Flash Player 9, AIR 1.1 |
Resets this ChangeWatcher instance to use a new host object. You can call this method to reuse a watcher instance on a different host.
Parametry
newHost:Object — The new host of the property.
See the watch() method for more information.
|
setHandler | () | metoda |
unwatch | () | metoda |
public function unwatch():void
Wersja języka: | ActionScript 3.0 |
Wersja produktu: | Flex 3 |
Wersje środowiska wykonawczego: | Flash Player 9, AIR 1.1 |
Detaches this ChangeWatcher instance, and its handler function,
from the current host.
You can use the reset()
method to reattach
the ChangeWatcher instance, or watch the same property
or chain on a different host object.
watch | () | metoda |
public static function watch(host:Object, chain:Object, handler:Function, commitOnly:Boolean = false, useWeakReference:Boolean = false):ChangeWatcher
Wersja języka: | ActionScript 3.0 |
Wersja produktu: | Flex 3 |
Wersje środowiska wykonawczego: | Flash Player 9, AIR 1.1 |
Creates and starts a ChangeWatcher instance.
A single ChangeWatcher instance can watch one property,
or a property chain.
A property chain is a sequence of properties accessible from
a host object.
For example, the expression
obj.a.b.c
contains the property chain (a, b, c).
Parametry
host:Object — The object that hosts the property or property chain
to be watched.
You can use the use the reset() method to change
the value of the host argument after creating
the ChangeWatcher instance.
The host maintains a list of handlers to invoke
when prop changes.
| |
chain:Object — A value specifying the property or chain to be watched.
Legal values are:
Note: The property or properties named in the | |
handler:Function — An event handler function called when the value of the
watched property (or any property in a watched chain) is modified.
The modification is signaled when any host object in the watcher
chain dispatches the event that has been specified in that host object's
[Bindable] metadata tag for the corresponding watched property.
The default event is named propertyChange .
The event object dispatched by the bindable property is passed
to this handler function without modification.
By default, Flex dispatches an event object of type PropertyChangeEvent.
However, you can define your own event type when you use the
| |
commitOnly:Boolean (default = false ) — Set to true if the handler should be
called only on committing change events;
set to false if the handler should be called on both
committing and non-committing change events.
Note: the presence of non-committing change events for a property is
indicated by the [NonCommittingChangeEvent(<event-name>)] metadata tag.
Typically these tags are used to indicate fine-grained value changes,
such as modifications in a text field prior to confirmation.
| |
useWeakReference:Boolean (default = false ) — (default = false) Determines whether
the reference to handler is strong or weak. A strong
reference (the default) prevents handler from being
garbage-collected. A weak reference does not.
|
ChangeWatcher — The ChangeWatcher instance, if at least one property name has
been specified to the chain argument; null otherwise.
Note that the returned watcher is not guaranteed to have successfully
discovered and attached itself to change events, since none may have
been exposed on the given property or chain by the host.
You can use the isWatching() method to determine the
watcher's state.
|
Powiązane elementy interfejsu API
Tue Jun 12 2018, 12:06 PM Z