Closed Bug 157098 Opened 22 years ago Closed 22 years ago

embedding: commands need to trigger update of UI after execution

Categories

(Core :: DOM: Editor, defect)

defect
Not set
normal

Tracking

()

VERIFIED FIXED

People

(Reporter: Brade, Assigned: mjudge)

References

Details

(Keywords: topembed+)

In order for editor embedding to be complete, we need to complete this task:
 * After command execution the UI state may need to update (I believe Simon has
some documentation on mozilla.org/editor/ about this but I don't have the url handy)

This should help break the Composer DLL's knowledge of XUL command nodes.
Blocks: edembed
ok this kinda works in a hacky way. right now you can get ahold of the command 
manager and add an nsIObserver to it. You can observe any command that may need 
to be updated (this list of updatable commands will need to be documented). 
Right now only cmd_bold, cmd_italic and cmd_underline work.  This is because 
any modification notification we get just updates cmd_bold, italic and 
underline no matter what. 

To get this to work properly. we need to make groups of commands i.e. select, 
save, undo and have commands that would be updated for each command under them. 
i.e. select->cmd_bold select->cmd_italics select->cmd_underline.  we should do 
this with a service at the time of nsEditorControllers and 
nsComposerController's creation.  They each call GetService and ask for the 
nsICommandGroupManager then add what commands they care about to the group(s) 
they think it belongs to.  Then when the command updater gets fired it looks up 
to find the iterator for the group that is being updated.  when it gets a 
selection update it asks for nsICommandManager->GetIterator("select") for 
example.  it then starts making calls to the observers for "cmd_bold", italics 
ect.

at that point this bug is then "fixed" in my opinion.  more optimizations can 
be done later to make a hierarchy of groups ect. but thats another bug.
Status: NEW → ASSIGNED
Keywords: topembed+
fixed by checkin for bug 174439.
Status: ASSIGNED → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
rs vrfy (code).
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.