javax.swing

Class JMenuBar.AccessibleJMenuBar

protected class JMenuBar.AccessibleJMenuBar extends AccessibleJComponent implements AccessibleSelection

Provides accessibility support for JMenuBar.
Method Summary
voidaddAccessibleSelection(int i)
Selects the menu with index i.
voidclearAccessibleSelection()
Deselects all possibly selected menus.
AccessibleRolegetAccessibleRole()
Returns the accessible role of JMenuBar, which is {@link AccessibleRole#MENU_BAR}.
AccessiblegetAccessibleSelection(int i)
Returns the selected with index i menu, or null if the specified menu is not selected.
AccessibleSelectiongetAccessibleSelection()
Returns the AccessibleSelection for this object.
intgetAccessibleSelectionCount()
Returns the number of selected items in the menu bar.
AccessibleStateSetgetAccessibleStateSet()
Returns the state of this AccessibleJMenuBar.
booleanisAccessibleChildSelected(int i)
Returns true if the specified menu is selected, false otherwise.
voidremoveAccessibleSelection(int i)
Deselects the menu with index i.
voidselectAllAccessibleSelection()
In menu bars it is not possible to select all items, so this method does nothing.

Method Detail

addAccessibleSelection

public void addAccessibleSelection(int i)
Selects the menu with index i. If another menu is already selected, this will be deselected.

Parameters: i the menu to be selected

clearAccessibleSelection

public void clearAccessibleSelection()
Deselects all possibly selected menus.

getAccessibleRole

public AccessibleRole getAccessibleRole()
Returns the accessible role of JMenuBar, which is {@link AccessibleRole#MENU_BAR}.

Returns: the accessible role of JMenuBar, which is {@link AccessibleRole#MENU_BAR}

getAccessibleSelection

public Accessible getAccessibleSelection(int i)
Returns the selected with index i menu, or null if the specified menu is not selected.

Parameters: i the index of the menu to return

Returns: the selected with index i menu, or null if the specified menu is not selected

getAccessibleSelection

public AccessibleSelection getAccessibleSelection()
Returns the AccessibleSelection for this object. This method returns this, since the AccessibleJMenuBar manages its selection itself.

Returns: the AccessibleSelection for this object

getAccessibleSelectionCount

public int getAccessibleSelectionCount()
Returns the number of selected items in the menu bar. Possible values are 0 if nothing is selected, or 1 if one item is selected.

Returns: the number of selected items in the menu bar

getAccessibleStateSet

public AccessibleStateSet getAccessibleStateSet()
Returns the state of this AccessibleJMenuBar.

Returns: the state of this AccessibleJMenuBar.

isAccessibleChildSelected

public boolean isAccessibleChildSelected(int i)
Returns true if the specified menu is selected, false otherwise.

Parameters: i the index of the menu to check

Returns: true if the specified menu is selected, false otherwise

removeAccessibleSelection

public void removeAccessibleSelection(int i)
Deselects the menu with index i.

Parameters: i the menu index to be deselected

selectAllAccessibleSelection

public void selectAllAccessibleSelection()
In menu bars it is not possible to select all items, so this method does nothing.