protected class

JMenu.AccessibleJMenu

extends JMenuItem.AccessibleJMenuItem
implements AccessibleSelection
java.lang.Object
   ↳ javax.accessibility.AccessibleContext
     ↳ java.awt.Component.AccessibleAWTComponent
       ↳ java.awt.Container.AccessibleAWTContainer
         ↳ javax.swing.JComponent.AccessibleJComponent
           ↳ javax.swing.AbstractButton.AccessibleAbstractButton
             ↳ javax.swing.JMenuItem.AccessibleJMenuItem
               ↳ javax.swing.JMenu.AccessibleJMenu

Class Overview

This class implements accessibility support for the JMenu class. It provides an implementation of the Java Accessibility API appropriate to menu user-interface elements.

Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. As of 1.4, support for long term storage of all JavaBeansTM has been added to the java.beans package. Please see XMLEncoder.

Summary

[Expand]
Inherited Constants
From class javax.accessibility.AccessibleContext
From interface javax.accessibility.AccessibleText
[Expand]
Inherited Fields
From class javax.swing.JComponent.AccessibleJComponent
From class java.awt.Container.AccessibleAWTContainer
From class java.awt.Component.AccessibleAWTComponent
From class javax.accessibility.AccessibleContext
From interface javax.accessibility.AccessibleAction
Protected Constructors
JMenu.AccessibleJMenu()
Public Methods
void addAccessibleSelection(int i)
Selects the ith menu in the menu.
void clearAccessibleSelection()
Clears the selection in the object, so that nothing in the object is selected.
Accessible getAccessibleChild(int i)
Returns the nth Accessible child of the object.
int getAccessibleChildrenCount()
Returns the number of accessible children in the object.
AccessibleRole getAccessibleRole()
Get the role of this object.
Accessible getAccessibleSelection(int i)
Returns the currently selected sub-menu if one is selected, otherwise null (there can only be one selection, and it can only be a sub-menu, as otherwise menu items don't remain selected).
AccessibleSelection getAccessibleSelection()
Get the AccessibleSelection associated with this object.
int getAccessibleSelectionCount()
Returns 1 if a sub-menu is currently selected in this menu.
boolean isAccessibleChildSelected(int i)
Returns true if the current child of this object is selected (that is, if this child is a popped-up submenu).
void removeAccessibleSelection(int i)
Removes the nth item from the selection.
void selectAllAccessibleSelection()
Normally causes every selected item in the object to be selected if the object supports multiple selections.
[Expand]
Inherited Methods
From class javax.swing.JMenuItem.AccessibleJMenuItem
From class javax.swing.AbstractButton.AccessibleAbstractButton
From class javax.swing.JComponent.AccessibleJComponent
From class java.awt.Container.AccessibleAWTContainer
From class java.awt.Component.AccessibleAWTComponent
From class javax.accessibility.AccessibleContext
From class java.lang.Object
From interface javax.accessibility.AccessibleAction
From interface javax.accessibility.AccessibleComponent
From interface javax.accessibility.AccessibleExtendedComponent
From interface javax.accessibility.AccessibleSelection
From interface javax.accessibility.AccessibleText
From interface javax.accessibility.AccessibleValue
From interface javax.swing.event.ChangeListener

Protected Constructors

protected JMenu.AccessibleJMenu ()

Public Methods

public void addAccessibleSelection (int i)

Selects the ith menu in the menu. If that item is a submenu, it will pop up in response. If a different item is already popped up, this will force it to close. If this is a sub-menu that is already popped up (selected), this method has no effect.

Parameters
i the index of the item to be selected

public void clearAccessibleSelection ()

Clears the selection in the object, so that nothing in the object is selected. This will close any open sub-menu.

public Accessible getAccessibleChild (int i)

Returns the nth Accessible child of the object.

Parameters
i zero-based index of child
Returns
  • the nth Accessible child of the object

public int getAccessibleChildrenCount ()

Returns the number of accessible children in the object. If all of the children of this object implement Accessible, than this method should return the number of children of this object.

Returns
  • the number of accessible children in the object.

public AccessibleRole getAccessibleRole ()

Get the role of this object.

Returns
  • an instance of AccessibleRole describing the role of the object
See Also

public Accessible getAccessibleSelection (int i)

Returns the currently selected sub-menu if one is selected, otherwise null (there can only be one selection, and it can only be a sub-menu, as otherwise menu items don't remain selected).

Parameters
i the zero-based index of selected children
Returns
  • the i-th selected child

public AccessibleSelection getAccessibleSelection ()

Get the AccessibleSelection associated with this object. In the implementation of the Java Accessibility API for this class, return this object, which is responsible for implementing the AccessibleSelection interface on behalf of itself.

Returns
  • this object

public int getAccessibleSelectionCount ()

Returns 1 if a sub-menu is currently selected in this menu.

Returns
  • 1 if a menu is currently selected, else 0

public boolean isAccessibleChildSelected (int i)

Returns true if the current child of this object is selected (that is, if this child is a popped-up submenu).

Parameters
i the zero-based index of the child in this Accessible object.
Returns
  • true if the current child of this object is selected; else false.

public void removeAccessibleSelection (int i)

Removes the nth item from the selection. In general, menus can only have one item within them selected at a time (e.g. one sub-menu popped open).

Parameters
i the zero-based index of the selected item

public void selectAllAccessibleSelection ()

Normally causes every selected item in the object to be selected if the object supports multiple selections. This method makes no sense in a menu bar, and so does nothing.