oracle.ide.util
Class MnemonicSolver

java.lang.Object
oracle.ide.util.MnemonicSolver

public class MnemonicSolver

extends java.lang.Object

This class can be used to resolve mnemonic conflicts in menus. The class
manages a list of MnemonicSolver.MenuLabel recording all labels
whose mnemonics need to be resolved.
To use the mnemonic solver class you create a instance of the solver,
you then add a pull down menu, popup menu, or individual menu items
to the solver. Once all menu items are added you just call the
solve() method to put this class to work.
The registered menu items may have their mnemonics changed when the
solve() method is executed.

addMenuLabel

Adds a new menu label to the list of labels whose mnemonic needs to
be resolved. The specified mnemonic is the suggested
mnemonic for the label. If conflicts exist, the suggested mnemonic
may not be used.

addMenuLabel

Adds a new menu label to the list of labels whose mnemonic needs to
be resolved. The specified mnemonic is the suggested
mnemonic for the label. If the parameter fixed is
specified as true, the suggested mnemonic will be used
unless the same mnemonic is also fixed by another menu. In this case
the menu with smaller number of characters will have preference in
using the specified mnemonic.

addMenuLabel

Adds a new menuItem to the list of menu items whose
mnemonic needs be resolved. The menu item mnemonic, if set, is used
as the suggested mnemonic for the menu label. If conflicts exist, the
suggested mnemonic may not be used.

addMenuLabel

Adds a new menuItem to the list of menu items whose
mnemonic needs be resolved. The menu item mnemonic, if set, is used
as the suggested mnemonic for the menu label. If conflicts exist, the
suggested mnemonic may not be used.

addMenuLabel

Adds a new menuItem to the list of menu items whose
mnemonic needs be resolved. The menu item mnemonic, if set, is used
as the suggested mnemonic for the menu label. If the parameter
fixed is specified as true, the suggested
mnemonic will be used unless the same mnemonic is also fixed by
another menu. In this case the menu with smaller number of
characters will have preference in using the specified mnemonic.
If the specified menuItem is already registered this
method will only set the given fixed value.

addMenuLabel

Adds a new menuItem to the list of menu items whose
mnemonic needs be resolved. The menu item mnemonic, if set, is used
as the suggested mnemonic for the menu label. If the parameter
fixed is specified as true, the suggested
mnemonic will be used unless the same mnemonic is also fixed by
another menu. In this case the menu with smaller number of
characters will have preference in using the specified mnemonic.
If the specified menuItem is already registered this
method will only set the given fixed value.

addMenuLabel

Adds a new menuItem to the list of menu items whose
mnemonic needs be resolved. The menu item mnemonic, if set, is used
as the suggested mnemonic for the menu label. If the text
parameter is specified it overrides the menuItem text.
If the parameter fixed is specified as true,
the suggested mnemonic will be used unless the same mnemonic is also
fixed by another menu. In this case the menu with smaller number of
characters will have preference in using the specified mnemonic.
If the specified menuItem is already registered this
method will only set the given fixed value.

addMenuLabel

Adds a new menuItem to the list of menu items whose
mnemonic needs be resolved. The menu item mnemonic, if set, is used
as the suggested mnemonic for the menu label. If the text
parameter is specified it overrides the menuItem text.
If the parameter fixed is specified as true,
the suggested mnemonic will be used unless the same mnemonic is also
fixed by another menu. In this case the menu with smaller number of
characters will have preference in using the specified mnemonic.
If the specified menuItem is already registered this
method will only set the given fixed value.

addMenuLabel

If the specified component is a AbstractButton it
adds it to the list of menu items whose mnemonic needs be resolved.
The menu item mnemonic, if set, is used as the suggested mnemonic for
the menu label. If the parameter fixed is specified as
true, the suggested mnemonic will be used unless the same
mnemonic is also fixed by another menu. In this case the menu with
smaller number of characters will have preference in using the specified
mnemonic.
If the specified menuItem is already registered this
method will only set the given fixed value.

addMenuLabel

If the specified component is a AbstractButton it
adds it to the list of menu items whose mnemonic needs be resolved.
The menu item mnemonic, if set, is used as the suggested mnemonic for
the menu label. If the text parameter is specified it
overrides the menuItem text. If the parameter
fixed is specified as true,
the suggested mnemonic will be used unless the same mnemonic is also
fixed by another menu. In this case the menu with smaller number of
characters will have preference in using the specified mnemonic.
If the specified menuItem is already registered this
method will only set the given fixed value.

addMenuLabels

public java.util.Collection addMenuLabels(javax.swing.JMenu menu)

Adds all menu items contained in the specified menu to
the list of items whose mnemonic needs resolution.