|
||||||||||
PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES |
See:
Description
Class Summary | |
---|---|
ButtonFactory | Provides various methods to create buttons from internationalized descriptions. |
Description | An object of this class describes caption, mnemonic and accelerator key of a GUI component. |
ExtensionFileFilter | Implements a Swing file filter that filters files on extensions. |
FileAction | Common (abstract) super class of FileOpenAction and
FileSaveAction . |
FileOpenAction | Abstract super class for actions that allow files to be loaded. |
FileSaveAction | Abstract super class for actions that allow files to be saved. |
HideWindow | Action that makes a particular window invisible. |
MenuButton | Button for use in a menu. |
MenuCheckBoxButton | Check box button for use in a menu. |
MenuRadioButton | Radio button for use in a menu. |
ShowWindow | Action that makes a particular window visible (if it was not) and brings it to the front. |
SimpleAction | Abstract action (controller) based on an internationalized description. |
SingleSelectionAction | Simple action which selects a given index in a SingleSelectionModel . |
ToolBarButton | Button for use on a tool bar. |
ToolBarToggleButton | Button for use on a tool bar. |
Provides support for standard Swing actions.
The package contains several classes that help with internationalization of actions and buttons.
For most practical applications
however, we suggest the use of the menu builder
(MenuBuilder
) which has built-in internationalization, and uses
the classes from this package behind the scenes.
The package also includes some (abstract) implementations of general purpose actions:
ShowWindow
shows an existing
window and brings it to the front. HideWindow
hides a window.FileOpenAction
displays an 'open file' dialog and
loads the selected files. FileSaveAction
is
used in a similar way to save files.
Javadoc inde&x search [shift F1]can be used to provide a button with the caption '
Javadoc index search
', the mnemonic 'x
' and the
accelerator key shift-F1.Description strings are typically retrieved from resource bundles, making internationalization of buttons and actions fairly straightforward.
In most cases buttons and menu
items can most easily be internationalized using actions that
extend SimpleAction
or through one of
the class methods of ButtonFactory
.
ToolBarButton
replaces JButton
for use in a tool bar.ToolBarToggleButton
replaces JToggleButton
for use in a tool bar.MenuButton
replaces JMenuItem
.MenuRadioButton
replaces JRadioButtonMenuItem
.MenuCheckBoxButton
replaces JCheckBoxMenuItem
.
SimpleAction.TOGGLE_BUTTON_MODEL
to allow
a check box menu item and a toggle button to share state: selecting one of them,
automatically selects the other.
Action action = new SomeAction (...); action.putValue ( SimpleAction.TOGGLE_MENU_BUTTON, new JToggleButton.ToggleButtonModel () ); MenuCheckBoxItem checkBox = new MenuCheckBoxItem (action); ... ToolBarToggleButton toggleButton = new ToolBarToggleButton (action); ...The same technique can be used with radio buttons.
Note that if two 'button groups' need to be synchronised, only one of them needs to be put inside a
ButtonGroup
object. However, in this case
classes SelectionGroup
or
GenericSelectionGroup
often provide a
better alternative. Two 'selection groups' that share the same selection
model are always
automatically synchronised, and then there is no need for the
individual button models to be shared.
|
||||||||||
PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES |