APIdia Launch Partner
Top Description Methods
javax.accessibility

public Interface AccessibleSelection

Known Direct Implementers
javax.swing.JComboBox.AccessibleJComboBox, javax.swing.JList.AccessibleJList, javax.swing.JTabbedPane.AccessibleJTabbedPane, javax.swing.JMenu.AccessibleJMenu, javax.swing.JMenuBar.AccessibleJMenuBar, javax.swing.JTable.AccessibleJTable, javax.swing.JTree.AccessibleJTree, javax.swing.JTree.AccessibleJTree.AccessibleJTreeNode, java.awt.List.AccessibleAWTList, java.awt.MenuComponent.AccessibleAWTMenuComponent

This AccessibleSelection interface provides the standard mechanism for an assistive technology to determine what the current selected children are, as well as modify the selection set. Any object that has children that can be selected should support the AccessibleSelection interface. Applications can determine if an object supports the AccessibleSelection interface by first obtaining its AccessibleContext (see Accessible) and then calling the AccessibleContext#getAccessibleSelection method. If the return value is not null, the object supports this interface.
Authors
Peter Korn, Hans Muller, Willie Walker
See Also
Accessible, Accessible#getAccessibleContext, AccessibleContext, AccessibleContext#getAccessibleSelection

Method Summary

Modifier and TypeMethod and Description
public void
addAccessibleSelection(int
the zero-based index of the child
i
)

Adds the specified Accessible child of the object to the object's selection.

public void
clearAccessibleSelection()

Clears the selection in the object, so that no children in the object are selected.

public Accessible

Returns:

the i-th selected child
getAccessibleSelection
(int
the zero-based index of selected children
i
)

Returns an Accessible representing the specified selected child of the object.

public int

Returns:

the number of items currently selected
getAccessibleSelectionCount
()

Returns the number of Accessible children currently selected.

public boolean

Returns:

true if the current child of this object is selected; else false
isAccessibleChildSelected
(int
the zero-based index of the child in this Accessible object
i
)

Determines if the current child of this object is selected.

public void
removeAccessibleSelection(int
the zero-based index of the child
i
)

Removes the specified child of the object from the object's selection.

public void
selectAllAccessibleSelection()

Causes every child of the object to be selected if the object supports multiple selections.

Method Detail

addAccessibleSelectionback to summary
public void addAccessibleSelection(int i)

Adds the specified Accessible child of the object to the object's selection. If the object supports multiple selections, the specified child is added to any existing selection, otherwise it replaces any existing selection in the object. If the specified child is already selected, this method has no effect.

Parameters
i:int

the zero-based index of the child

See Also
AccessibleContext#getAccessibleChild
clearAccessibleSelectionback to summary
public void clearAccessibleSelection()

Clears the selection in the object, so that no children in the object are selected.

getAccessibleSelectionback to summary
public Accessible getAccessibleSelection(int i)

Returns an Accessible representing the specified selected child of the object. If there isn't a selection, or there are fewer children selected than the integer passed in, the return value will be null.

Note that the index represents the i-th selected child, which is different from the i-th child.

Parameters
i:int

the zero-based index of selected children

Returns:Accessible

the i-th selected child

See Also
getAccessibleSelectionCount
getAccessibleSelectionCountback to summary
public int getAccessibleSelectionCount()

Returns the number of Accessible children currently selected. If no children are selected, the return value will be 0.

Returns:int

the number of items currently selected

isAccessibleChildSelectedback to summary
public boolean isAccessibleChildSelected(int i)

Determines if the current child of this object is selected.

Parameters
i:int

the zero-based index of the child in this Accessible object

Returns:boolean

true if the current child of this object is selected; else false

See Also
AccessibleContext#getAccessibleChild
removeAccessibleSelectionback to summary
public void removeAccessibleSelection(int i)

Removes the specified child of the object from the object's selection. If the specified item isn't currently selected, this method has no effect.

Parameters
i:int

the zero-based index of the child

See Also
AccessibleContext#getAccessibleChild
selectAllAccessibleSelectionback to summary
public void selectAllAccessibleSelection()

Causes every child of the object to be selected if the object supports multiple selections.