Broadcaster
A broadcaster is used whn you want multiple elements to share one or more attribute values, or when you want elements to respond to a state change. Any elements that are observing the broadcaster will share the attributes placed on the broadcaster. For instance, if the broadcaster has a label attribute, the observes will use that label. If the label changes, the labels of the observers will update automatically. An onbroadcast event will be sent to the observers when a change is made.
For menuitems or buttons that just want to have their disabled status set when the feature should be disabled, you should use a command element instead.
broadcaster 要素は複数の要素間で一つ以上の属性値を共有させたり、要素を状態の変化に呼応させたいときに利用される。 broadcaster 要素を監視している任意の要素は broadcaster 要素の属性を共有することになる。例えば、broadcaster 要素が label 属性を持てば、監視している要素たちはその label 属性を利用することになる。 label 属性が変更されれば、それらの要素の label 属性も自動的に更新される。変化が生じた時点で onbroadcast イベントがそれらの要素へ配信される。
無効の状態を設定したくなる場合があるメニューアイテムやボタンに対し、その機能を無効化する必要があるときには、これの代わりに command 要素を用いる必要がある。
属性:
XUL Element から継承:
プロパティとメソッド:
XUL Element から継承:
Element から継承: