javax.swing

Class JMenu.AccessibleJMenu

protected class JMenu.AccessibleJMenu extends AccessibleJMenuItem implements AccessibleSelection

Implements support for assisitive technologies for JMenu.
Constructor Summary
protected AccessibleJMenu()
Method Summary
voidaddAccessibleSelection(int index)
Selects the accessible child with the specified index.
voidclearAccessibleSelection()
Removes all possibly selected accessible children of this object from the selection.
AccessiblegetAccessibleChild(int index)
Returns the accessible child with the specified index.
intgetAccessibleChildrenCount()
Returns the number of accessible children of this object.
AccessibleRolegetAccessibleRole()
Returns the accessible role of this object, which is {@link AccessibleRole#MENU} for the AccessibleJMenu.
AccessibleSelectiongetAccessibleSelection()
Returns the accessible selection of this object.
AccessiblegetAccessibleSelection(int index)
Returns the selected accessible child with the specified index.
intgetAccessibleSelectionCount()
Returns the number of selected accessible children.
booleanisAccessibleChildSelected(int index)
Returns true if the accessible child with the specified index is selected, false otherwise.
voidremoveAccessibleSelection(int index)
Removes the item with the specified index from the selection.
voidselectAllAccessibleSelection()
AccessibleJMenu don't support multiple selection, so this method does nothing.

Constructor Detail

AccessibleJMenu

protected AccessibleJMenu()

Method Detail

addAccessibleSelection

public void addAccessibleSelection(int index)
Selects the accessible child with the specified index.

Parameters: index the index of the accessible child to select

clearAccessibleSelection

public void clearAccessibleSelection()
Removes all possibly selected accessible children of this object from the selection.

getAccessibleChild

public Accessible getAccessibleChild(int index)
Returns the accessible child with the specified index.

Parameters: index the index of the child to fetch

Returns: the accessible child with the specified index

getAccessibleChildrenCount

public int getAccessibleChildrenCount()
Returns the number of accessible children of this object.

Returns: the number of accessible children of this object

getAccessibleRole

public AccessibleRole getAccessibleRole()
Returns the accessible role of this object, which is {@link AccessibleRole#MENU} for the AccessibleJMenu.

Returns: the accessible role of this object

getAccessibleSelection

public AccessibleSelection getAccessibleSelection()
Returns the accessible selection of this object. AccessibleJMenus handle their selection themselves, so we always return this here.

Returns: the accessible selection of this object

getAccessibleSelection

public Accessible getAccessibleSelection(int index)
Returns the selected accessible child with the specified index.

Parameters: index the index of the accessible selected child to return

Returns: the selected accessible child with the specified index

getAccessibleSelectionCount

public int getAccessibleSelectionCount()
Returns the number of selected accessible children. This will be 0 if no item is selected, or 1 if an item is selected. AccessibleJMenu can have maximum 1 selected item.

Returns: the number of selected accessible children

isAccessibleChildSelected

public boolean isAccessibleChildSelected(int index)
Returns true if the accessible child with the specified index is selected, false otherwise.

Parameters: index the index of the accessible child to check

Returns: true if the accessible child with the specified index is selected, false otherwise

removeAccessibleSelection

public void removeAccessibleSelection(int index)
Removes the item with the specified index from the selection.

Parameters: index the index of the selected item to remove from the selection

selectAllAccessibleSelection

public void selectAllAccessibleSelection()
AccessibleJMenu don't support multiple selection, so this method does nothing.