The toolbar manager uses the manager/provider (TODO: link) mechanism for adding buttons to the application toolbar. Buttons are organized into sections within tabs. And buttons may be optionally grouped, so only one shows at a time.
Buttons are registered by adding providers in a bundle’s bundle_info.xml file. The manager must be toolbar. The manager may be given in each Provider or once in the parent Providers. There can be multiple Providers with different managers. Buttons are invoked by calling the bundle’s run_provider API (TODO: link) with the provider’s name.
<Providers manager="toolbar"> <Provider tab="Markers" section="Place markers" name="pm1" mouse_mode="mark maximum" display_name="Maximum" description="Mark maximum"/> </Providers>
Mouse mode buttons are similar to basic buttons, with the mouse_mode identifying which mode mode to set and the default display_name. The optional icon can be given, but is normally found with the registered mouse mode.
<Providers manager="toolbar"> <Provider tab="Graphics" help="help:..." name="layout1" before="Nucleotides" after="Molecule Display"/> <Provider tab="Molecule Display" section="Cartoons" help="help:..." name="layout2" before="Surfaces" after="Atoms"/> </Providers>
Tabs, sections, and buttons can have layout contraints:
Information can also be given at the tab and section levels of the hierachy. The name needs to be unique amoung the bundle’s Provider’s, but is otherwise unused. The before and after constraints refer to items at that level. And a URL can be given with the help option.