Package be.ugent.caagt.swirl.menus
Provides XML-based configuration of buttons and menus.
See:
Description
Class Summary |
MenuBuilder |
Allows menus to be constructed from a configuration file. |
Package be.ugent.caagt.swirl.menus Description
Provides XML-based configuration of buttons and menus.
The most important class of this package
is MenuBuilder
which can be used to
build menus, tool bars and individual buttons from descriptions given in
an XML configuration file. All descriptions are internationalized by means of
a corresponding resource bundle.
More information can be found in the MenuBuilder tutorial.
Button descriptions
For each button or menu item, the following information can be placed in the
configuration file:
- The (internationalized) caption.
- An (internationalized) mnemonic.
- An (internationalized) acceleration key.
- An (internationalized) tool tip for use in tool bars.
- An icon for use in menus.
- A 'disabled' icon for use in menus.
- An icon for use in tool bars.
- A 'disabled' icon for use in tool bars.
You can also configure caption, mnemonic and acceleration key for menus
and submenus.
Actions, toggles and groups.
Menu items and tool bar buttons are built indirectly from one of the following
types of entities:
- Standard Swing actions (of type
Action
)
are used to create standard menu items and push buttons.
- Toggles are instantiated as check boxes in menus and toggle buttons
in tool bars. An
ItemListener
can be registered with a toggle to
process changes in its selection state.
- Groups become 'button groups' of radio buttons (in menus) or of toggle
buttons (in tool bars). Groups are governed by a selection model of type
GenericSelectionModel
.
Actions, toggles and groups have an associated identifier, allowing the same
entity to occur more than once in the same application, in which case they will
share their model.