5. Adding a document type specific tool bar


  <toolBar name="toolBar" replace="configSpecificToolBarItems" />1

  <toolBar name="configSpecificToolBar">2
    <toolBarItems name="configSpecificToolBarItems" />3

  <layout label="Document Editor" icon="docedit.png">
      <toolBar name="toolBar" />
      <toolBar name="configSpecificToolBar" />
      <group name="nodePathToolBar">
        <tool name="nodePathTool" stretch="1" />
        <toolBar name="selectToolBar" />

    <insert />5


This removes the configuration specific buttons (element toolBarItems called "configSpecificToolBarItems" found in DesktopApp.xxe_gui) from the standard tool bar (element toolBar called "toolBar" found in DesktopApp.xxe_gui).

Attribute replace in an empty element means replace by nothing, which itself means remove. It's also possible to remove or replace a range of items using attributes replace and replaceEnd. More information about attributes replace and replaceEnd in Customizing a composite part without redefining it from scratch.


Declare a new tool bar called "configSpecificToolBar" by using a toolBar element.


This new toolBar only contains the set of configuration specific buttons. This set is declared in DesktopApp.xxe_gui as the toolBarItems element called "configSpecificToolBarItems". Therefore, we just need to reference this stock part in our new tool bar.


Replace the stock topToolBars child in the layout element by a custom one. This child element can contain one or more horizontal toolBars.


Without the use of insert, the above layout would have been understood as a redefinition from scratch of the standard layout of the XML editor. Such XML editor would contain just a few tool bars.