The toolBar
element allows to specify a tool bar which is specific to a given document type.
Excerpts from rng_section_config/common.incl
(same file for all variants):
<toolBar> <button toolTip="Toggle bold" icon="xxe-config:common/icons/bold.png"> <class>com.xmlmind.xmleditapp.desktop.toolbar.TextStyleToggle</class> <command name="pass" parameter="{http://www.xmlmind.com/ns/sect}bold" /> </button> ... <separator /> ... <button toolTip="Add table" icon="xxe-config:common/icons/table_menu.png"> <menu> <item label="table" command="add" parameter="after[implicitElement] {http://www.xmlmind.com/ns/sect}table" /> <item label="table(header)" command="add" parameter="after[implicitElement] #template({http://www.xmlmind.com/ns/sect}table,header)" /> </menu> </button> ... </toolBar>
A toolBar
element has button
and separator
child elements. A button
can contain a command
or a menu
of item
s, each menu item
itself invoking a command.
A
|
So the question is now: what is a command? A command in XMLmind XML Editor - Commands is an action triggered by a user input (mouse, keyboard, drag, drop, etc) which has an effect on the active view of the document being edited. The behavior of a command is influenced by its string parameter, the current text or node selection and the schema to which the document being edited is conforming.
The parameter of a command is a plain string, having vastly different meanings depending on the command. That's why, unless documented otherwise for a given command, namespace prefixes are not supported in a command parameter. For example, in the above <command name="add"
parameter="after[implicitElement] {http://www.xmlmind.com/ns/sect}table" /> and not: <command name="add"
parameter="after[implicitElement] s:table" /> |
We'll see in this tutorial that there are 3 kinds of commands: native commands (written in the Java™ programming language), macro-commands and process commands (both specified in XML in the configuration file).
XXE has dozens of native commands in XMLmind XML Editor - Commands. The tool bar which is specific to the "Simple Section" document type just uses one of them: add
in XMLmind XML Editor - Commands.