AccessibleSelection (Java SE 15 & JDK 15) (original) (raw)
All Known Implementing Classes:
[CheckboxMenuItem.AccessibleAWTCheckboxMenuItem](../../java/awt/CheckboxMenuItem.AccessibleAWTCheckboxMenuItem.html "class in java.awt")
, [JComboBox.AccessibleJComboBox](../swing/JComboBox.AccessibleJComboBox.html "class in javax.swing")
, [JList.AccessibleJList](../swing/JList.AccessibleJList.html "class in javax.swing")
, [JMenu.AccessibleJMenu](../swing/JMenu.AccessibleJMenu.html "class in javax.swing")
, [JMenuBar.AccessibleJMenuBar](../swing/JMenuBar.AccessibleJMenuBar.html "class in javax.swing")
, [JTabbedPane.AccessibleJTabbedPane](../swing/JTabbedPane.AccessibleJTabbedPane.html "class in javax.swing")
, [JTable.AccessibleJTable](../swing/JTable.AccessibleJTable.html "class in javax.swing")
, [JTree.AccessibleJTree](../swing/JTree.AccessibleJTree.html "class in javax.swing")
, [JTree.AccessibleJTree.AccessibleJTreeNode](../swing/JTree.AccessibleJTree.AccessibleJTreeNode.html "class in javax.swing")
, [List.AccessibleAWTList](../../java/awt/List.AccessibleAWTList.html "class in java.awt")
, [Menu.AccessibleAWTMenu](../../java/awt/Menu.AccessibleAWTMenu.html "class in java.awt")
, [MenuBar.AccessibleAWTMenuBar](../../java/awt/MenuBar.AccessibleAWTMenuBar.html "class in java.awt")
, [MenuComponent.AccessibleAWTMenuComponent](../../java/awt/MenuComponent.AccessibleAWTMenuComponent.html "class in java.awt")
, [MenuItem.AccessibleAWTMenuItem](../../java/awt/MenuItem.AccessibleAWTMenuItem.html "class in java.awt")
, [PopupMenu.AccessibleAWTPopupMenu](../../java/awt/PopupMenu.AccessibleAWTPopupMenu.html "class in java.awt")
public interface AccessibleSelection
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 theAccessibleSelection
interface by first obtaining itsAccessibleContext
(see Accessible) and then calling theAccessibleContext.getAccessibleSelection() method. If the return value is not null
, the object supports this interface.
See Also:
Accessible, Accessible.getAccessibleContext(), AccessibleContext, AccessibleContext.getAccessibleSelection()
Method Summary
Modifier and Type | Method | Description |
---|---|---|
void | addAccessibleSelection(int i) | Adds the specified Accessible child of the object to the object's selection. |
void | clearAccessibleSelection() | Clears the selection in the object, so that no children in the object are selected. |
Accessible | getAccessibleSelection(int i) | Returns an Accessible representing the specified selected child of the object. |
int | getAccessibleSelectionCount() | Returns the number of Accessible children currently selected. |
boolean | isAccessibleChildSelected(int i) | Determines if the current child of this object is selected. |
void | removeAccessibleSelection(int i) | Removes the specified child of the object from the object's selection. |
void | selectAllAccessibleSelection() | Causes every child of the object to be selected if the object supports multiple selections. |
Method Details
getAccessibleSelectionCount
int getAccessibleSelectionCount()
Returns the number ofAccessible
children currently selected. If no children are selected, the return value will be 0.
Returns:
the number of items currently selectedgetAccessibleSelection
Accessible getAccessibleSelection(int i)
Returns anAccessible
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 benull
.
Note that the index represents the i-th selected child, which is different from the i-th child.
Parameters:
i
- the zero-based index of selected children
Returns:
the i-th selected child
See Also:
getAccessibleSelectionCount()isAccessibleChildSelected
boolean isAccessibleChildSelected(int i)
Determines if the current child of this object is selected.
Parameters:
i
- the zero-based index of the child in thisAccessible
object
Returns:
true
if the current child of this object is selected; elsefalse
See Also:
AccessibleContext.getAccessibleChild(int)addAccessibleSelection
void addAccessibleSelection(int i)
Adds the specifiedAccessible
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
- the zero-based index of the child
See Also:
AccessibleContext.getAccessibleChild(int)removeAccessibleSelection
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
- the zero-based index of the child
See Also:
AccessibleContext.getAccessibleChild(int)clearAccessibleSelection
void clearAccessibleSelection()
Clears the selection in the object, so that no children in the object are selected.selectAllAccessibleSelection
void selectAllAccessibleSelection()
Causes every child of the object to be selected if the object supports multiple selections.