javax.swing

Class JComboBox.AccessibleJComboBox

protected class JComboBox.AccessibleJComboBox extends AccessibleJComponent implements AccessibleAction, AccessibleSelection

Accessibility support for JComboBox.
Constructor Summary
AccessibleJComboBox()
Method Summary
voidaddAccessibleSelection(int index)
Sets the current selection to the specified index.
voidclearAccessibleSelection()
Clears the current selection.
booleandoAccessibleAction(int actionIndex)
Performs the accessible action with the specified index.
AccessibleActiongetAccessibleAction()
Returns the accessible action associated to this accessible object.
intgetAccessibleActionCount()
Returns the number of accessible actions that can be performed by this object.
StringgetAccessibleActionDescription(int actionIndex)
Returns the description of the specified action.
AccessiblegetAccessibleChild(int index)
Returns the number of accessible children of this object.
intgetAccessibleChildrenCount()
Returns the number of accessible children of this object.
AccessibleRolegetAccessibleRole()
Returns the accessible role for the JComboBox component.
AccessibleSelectiongetAccessibleSelection()
Returns the AccessibleSelection object associated with this object.
AccessiblegetAccessibleSelection(int index)
Returns the accessible selection from this AccssibleJComboBox.
intgetAccessibleSelectionCount()
Returns the number of selected accessible children of this object.
booleanisAccessibleChildSelected(int index)
Returns true if the accessible child with the specified index is selected, false otherwise.
voidremoveAccessibleSelection(int index)
Removes the specified index from the current selection.
voidselectAllAccessibleSelection()
Multiple selection is not supported by AccessibleJComboBox, so this does nothing.

Constructor Detail

AccessibleJComboBox

public AccessibleJComboBox()

UNKNOWN: This constructor was protected in 1.4, but made public in 1.5.

Method Detail

addAccessibleSelection

public void addAccessibleSelection(int index)
Sets the current selection to the specified index.

Parameters: index the index to set as selection

clearAccessibleSelection

public void clearAccessibleSelection()
Clears the current selection.

doAccessibleAction

public boolean doAccessibleAction(int actionIndex)
Performs the accessible action with the specified index. AccessibleJComboBox has 1 accessible action (actionIndex == 0), which is to toggle the popup menu. All other action indices have no effect and return false.

Parameters: actionIndex the index of the action to perform

Returns: true if the action has been performed, false otherwise

getAccessibleAction

public AccessibleAction getAccessibleAction()
Returns the accessible action associated to this accessible object. AccessibleJComboBox implements its own AccessibleAction, so this method returns this.

Returns: the accessible action associated to this accessible object

getAccessibleActionCount

public int getAccessibleActionCount()
Returns the number of accessible actions that can be performed by this object. AccessibleJComboBox implement s one accessible action (toggle the popup menu), so this method always returns 1.

Returns: the number of accessible actions that can be performed by this object

getAccessibleActionDescription

public String getAccessibleActionDescription(int actionIndex)
Returns the description of the specified action. AccessibleJComboBox implements 1 action (toggle the popup menu) and thus returns UIManager.getString("ComboBox.togglePopupText")

Parameters: actionIndex the index of the action for which to return the description

Returns: the description of the specified action

getAccessibleChild

public Accessible getAccessibleChild(int index)
Returns the number of accessible children of this object. The implementation of AccessibleJComboBox delegates this call to the UI of the associated JComboBox.

Parameters: index the index of the accessible child to fetch

Returns: the number of accessible children of this object

See Also: ComponentUI

getAccessibleChildrenCount

public int getAccessibleChildrenCount()
Returns the number of accessible children of this object. The implementation of AccessibleJComboBox delegates this call to the UI of the associated JComboBox.

Returns: the number of accessible children of this object

See Also: getAccessibleChildrenCount

getAccessibleRole

public AccessibleRole getAccessibleRole()
Returns the accessible role for the JComboBox component.

Returns: {@link AccessibleRole#COMBO_BOX}.

getAccessibleSelection

public AccessibleSelection getAccessibleSelection()
Returns the AccessibleSelection object associated with this object. AccessibleJComboBoxes handle their selection themselves, so this always returns this.

Returns: the AccessibleSelection object associated with this object

getAccessibleSelection

public Accessible getAccessibleSelection(int index)
Returns the accessible selection from this AccssibleJComboBox.

Parameters: index the index of the selected child to fetch

Returns: the accessible selection from this AccssibleJComboBox

getAccessibleSelectionCount

public int getAccessibleSelectionCount()
Returns the number of selected accessible children of this object. This returns 1 if the combobox has a selected entry, 0 otherwise.

Returns: the number of selected accessible children of this object

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

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

removeAccessibleSelection

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

Parameters: index the index to remove from the selection

selectAllAccessibleSelection

public void selectAllAccessibleSelection()
Multiple selection is not supported by AccessibleJComboBox, so this does nothing.