Ulrich_Laegeler at arburg.com wrote:
> under what circumstances are toolbars update?
> 
> I ask because i have a toolbar with buttons that executes commands.
> If the command cannot be executed the button is greyed. That's perfect.
> But how can i force the toolbar to check the commands again?
> 

--> It's done automatically.

* About the generic toolbar (File|Open, File|Save, etc):

This toolbar contains XXE *parts*. A part may be *editing-context*
*sensitive* or not.

A part which is *not* editing-context sensitive updates its state when
you switch from one document view to another (e.g. from foo.xml to
bar.xml or from the styled view to the tree view).

A part which is editing-context sensitive updates its state when you
change the implicit or explicit selection or when the caret moves from
one node to another.

More info about parts in:
XMLmind XML Editor - Customizing the User Interface,
http://www.xmlmind.com/xmleditor/_distrib/doc/configure/index.html

and in:
XMLmind XML Editor - Developer's Guide, Extending the GUI of XMLmind XML
Editor, http://www.xmlmind.com/xmleditor/_distrib/doc/dev/gui.html



* About the toolbar which is specific to a document type (DocBook,
XHTML, etc):

The buttons contained in this toolbar update their states when the
editing context changes.




--> You can simulate an editing context change in Java by using:
DocumentView.notifyContextChangeListeners() --
http://www.xmlmind.com/xmleditor/_distrib/doc/api/com/xmlmind/xmledit/view/DocumentView.html#notifyContextChangeListeners()

This method is typically used when a command written in Java replaces
the contents of the clipboard.



Reply via email to