Closed Bug 13970 Opened 27 years ago Closed 27 years ago

[rfe] implement command "updater=" syntax, etc.

Categories

(Core :: XUL, enhancement, P3)

enhancement

Tracking

()

VERIFIED FIXED

People

(Reporter: waterson, Assigned: waterson)

Details

Tasks: 1. Make 'updater="true"' attribute on XUL items automagically register the element with the document's command updater. An element with an 'updater' attribute is called a "command updater node". Such a node will have an 'oncommandupdate' event handler which should be run each time a 'command event' is sent to the XUL document's command updater. 2. On an element that is a command updater node, obey the 'events=' attribute, a comma or whitespace separated list of events that restrict the scope of command update. If a command updater node has an 'events' attribute, then the 'oncommandupdate' handler should _only_ be called if the command event name appears in this set. If this attribute is not present, the 'oncommandupdate' should be run for _any_ event (modulo 'targets' restrictions, below). 3. On an element that is a command updater node, obey the 'targets=' attribute, a comma or whitespace separated list of element IDs to which the command applies. If a command updater node has a 'targets' attribute, then the 'oncommandupdate' handler should _only_ be called if the command event targets a node whose ID appears in the set. If this attribute is not present, the 'oncommandupdate' handler should be run for _any_ element (modulo 'events' restrictions, above). 4. Update the command updater API s.t. it takes a single 'command event name' parameter. Sound right?
Status: NEW → ASSIGNED
Target Milestone: M11
Yes, sounds right. I even like your attribute names better. :)
Any objection if I rename XULCommandDispatcher::[add|remove]Command to [add|remove]Updater? Alternatively, we could be verbose, and I could use [add|remove]CommandUpdater, and change the 'updater="true"' attribute to 'commandupdater="true"' Any preference? I kinda like the latter, but I can type fast :-)
I like the latter as well.
Okay, another thing. I think 'addCommandUpdater()' should have this signature: void addCommandUpdater(in Element updater, in DOMString events, in DOMString targets); That allows you to programatically add an updater with all the filtering attributes above -- plus it means I don't need to hack another API to do it ;-). I think I'll just say that in the JS API, you pass "*" to indicate "don't filter anything"; e.g., <command id="bar" updater="true" /> is the same as: document.commandDispatcher.addCommandUpdater( document.getElementById('bar'), "*", "*"); Mmmkay?
Definitely. THis is consistent with broadcaster/observer programmatic methods. And * is perfect. Rock on, brother waterson.
Status: ASSIGNED → RESOLVED
Closed: 27 years ago
Resolution: --- → FIXED
Okay, checked in.
QA Contact: ckritzer → waterson
Assigning to originator per new organizational structure.
Status: RESOLVED → VERIFIED
This syntax is definitely implemented. Since waterson wrote the bug and the code, I will mark as verified.
BULK MOVE: Changing component from XUL to XP Toolkit/Widgets: XUL. XUL component will be deleted.
Component: XUL → XP Toolkit/Widgets: XUL
[RFE] is deprecated in favor of severity: enhancement. They have the same meaning.
Severity: normal → enhancement
Component: XP Toolkit/Widgets: XUL → XUL
QA Contact: waterson → xptoolkit.widgets
You need to log in before you can comment on or make changes to this bug.