Interface ChangeObserver
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Called on the UI thread, synchronously, from inside the call that made the change and after
that widget's own state has settled — never from inside a paint. Any number of watchers may
watch one widget, with no coordination between them, no ability to disturb each other or the
application's handler, and no ability to be disturbed by them: each is invoked inside its own
try, and a throw is contained and reported.
The source is a Widget because a watcher-channel source is a node in a widget tree.
The five public types that are not widgets — ButtonGroup, Menu,
MenuItem, PopupMenu and Dialog — are in no tree, so they announce
nothing here and keep their handler slots; a radio group's change is fully recoverable from the
two radio buttons, which are widgets.
What this channel does not say, by design and as part of the 1.0 contract:
- A menu's highlighted item, a check item's state and whether a popup menu or dialog is open
reach no watcher. What does arrive is coarse: opening or closing a popup is a
CHILDRENchange on the overlay root of the scene that hosts it, and aMenuBarannounces its ownEXPANDED. The accessibility tree carries all of it, through synthetic children the owning widget declares. - A subtree's
setLocaleorsetInheritanceHostchanges every name, description and formatted value under it and announces onlyLAYOUT. A watcher that follows text re-reads it after either, and afterI18n.observeChangesfires for the process's language.
A watcher may read the widget, and may mutate anything: a nested change is announced synchronously, in full, before the outer dispatch continues. What it must not assume is a frame — a notification is delivered before any layout or paint the mutation asked for, so a watcher that reads geometry reads the geometry of the last pass.
- See Also:
-
Method Summary
-
Method Details
-
changed
Tells this watcher thatsourcechanged.- Parameters:
source- the widget that changedchange- what changed on it, and what moved it
-