The IDE plug-in allows you to change the user interface (UI) of XMLSpy. This is done by describing each separate modification using an XML data stream. The XML configuration is passed to XMLSpy using the GetUIModifications method of the IXMLSpyPlugIn interface.
The XML file containing the UI modifications for the IDE PlugIn, must have the following structure:
<ImageFile>path To image file</ImageFile>
You can define icons or toolbar buttons for the new menu items which are added to the UI of XMLSpy by the plug-in. The path to the file containing the images is set using the ImageFile element. Each image must be 16 x 16 pixels using max. 256 colors. The image references must be arranged from left to right in a single (<ImageFile>...) line. The rightmost image index value is zero.
The Modifications element can have any number of Modification child elements. Each Modification element defines a specific change to the standard UI of XMLSpy. Starting with version 4.3, it is also possible to remove UI elements from XMLSpy.
Structure of Modification elements
All Modification elements consist of the following two child elements:
<Action>Type of action</Action>
<UIElement Type="type of UI element">
Valid values for the Action element are:
Add - to add the following UI element to XMLSpy
Hide - to hide the following UI element in XMLSpy
Remove - to remove the UI element from the "Commands" list box, in the customize dialog
You can combine values of the Action element e.g. "Hide Remove"
The UIElement element describes any new or existing UI element for XMLSpy. Possible elements are currently: new toolbars, buttons, menus or menu items. The type attribute defines which UI element is described by the XML element.
Common UIElement children
The ID and Name elements are valid for all different types of XML UIElement fragments. It is, however, possible to ignore one of the values for a specific type of UIElement. For example, Name is ignored for a separator.
If UIElement describes an existing element of the UI. The value of the ID element is predefined by XMLSpy. Normally these ID values are not known to the public. If the XML fragment describes a new part of the UI, then the ID is arbitrary and the value should be less than 1000. The Name element sets the textual value. Existing UI elements can be identified just by name, for example, menus and menu items with associated sub menus. For new UI elements, the Name element sets the caption (for example, the title of a toolbar) or text for a menu item.
Toolbars and Menus
To define a toolbar it is necessary to specify the ID and/or the name of the toolbar. An existing toolbar can be specified using only the name or ID (if the latter is known). To create a new toolbar both values must be set. The type attribute must be equal to "ToolBar".
To specify an XMLSpy menu you need two parameters:
•The ID of the menu bar which contains the menu. If no XML documents are open in the main window, the menu bar ID is 128. If one or more XML documents are open, the menu bar ID is 129.
•The menu name. Menus do not have an associated ID value. The following example defines the "Edit" menu of the menu bar which is active, when at least one XML document is open:
An additional element is used if you want to create a new menu. The Place element defines the position of the new menu in the menu bar:
A value of -1 for the Place element sets the new button or menu item at the end of the menu or toolbar.
If you add a new command (through a toolbar button or a menu item), the UIElement fragment can contain any of these sub elements:
If MacroName is specified, XMLSpy searches for a macro with the same name in the scripting environment and executes it each time this command is processed. The Info element contains a short description string which is displayed in the status bar when the mouse pointer is over the associated command (button or menu item). ImageID defines the index of the icon in the image file. Please note that all icons are stored in one image file.
To define a toolbar button create an UIElement with this structure:
<!--don't reuse local IDs even the commands do the same-->
<Name>Open file from repository...</Name>
<!--Set Place To -1 If this is the first button To be inserted-->
<!--instead of the toolbar ID the toolbar name could be used-->
Additional elements to declare a toolbar button are Place, ToolBarID and ToolBarName. ToolBarID and ToolBarName are used to identify the toolbar which contains the new or existing button. The textual value of ToolBarName is case-sensitive. The (UIElement) type attribute must be "ToolBarItem".
To define a menu item, the elements MenuID, Place and Parent are available in addition to the standard elements used to declare a command. MenuID can be either 128 or 129. Please see "Toolbars and Menus" for more information on these values.
The Parent element is used to identify the menu where the new menu entry should be inserted. As sub menu items have no unique Windows ID, we need some other way to identify the parent of the menu item.
The value of the Parent element is a path to the menu item. The text value of the Parent element, must equal the parent menu name of the submenu, where the submenu name is separated by a colon. If the menu has no parent, because it is not a submenu, add a colon to the beginning of the name. The type attribute must be set to "MenuItem". Example for an UIElement defining a menu item:
<!--the following element is a Local command ID-->
<Name>Open file from repository...</Name>
XMLSpy makes it possible to add toolbar separators and menus if the value of the ID element is set to 0.