javax.swing

Class JList.AccessibleJList

protected class JList.AccessibleJList extends AccessibleJComponent implements AccessibleSelection, PropertyChangeListener, ListSelectionListener, ListDataListener

Provides accessibility support for JList.
Nested Class Summary
protected classJList.AccessibleJList.AccessibleJListChild
Provides accessibility support for list elements in JLists.
Constructor Summary
AccessibleJList()
Create a new AccessibleJList.
Method Summary
voidaddAccessibleSelection(int i)
Adds the accessible item with the specified index to the selected items.
voidclearAccessibleSelection()
Remove all selection items from the selection.
voidcontentsChanged(ListDataEvent event)
Receives notification when items have changed in the JList.
AccessiblegetAccessibleAt(Point p)
Returns the accessible child at the visual location p (relative to the upper left corner of the JList).
AccessiblegetAccessibleChild(int n)
Returns the n-th accessible child of this JList.
intgetAccessibleChildrenCount()
Returns the number of accessible children in the JList.
AccessibleRolegetAccessibleRole()
Returns the accessible role for JList, {@link AccessibleRole#LIST}.
AccessiblegetAccessibleSelection(int n)
Returns the n-th selected accessible child.
intgetAccessibleSelectionCount()
Returns the number of selected accessible children.
AccessibleStateSetgetAccessibleStateSet()
Return the state set of the JList.
voidintervalAdded(ListDataEvent event)
Receives notification when items are inserted into the JList.
voidintervalRemoved(ListDataEvent event)
Receives notification when items are removed from the JList.
booleanisAccessibleChildSelected(int n)
Returns true if the n-th child is selected, false otherwise.
voidpropertyChange(PropertyChangeEvent e)
Receives notification about changes of the JList's properties.
voidremoveAccessibleSelection(int i)
Removes the accessible item with the specified index to the selection.
voidselectAllAccessibleSelection()
Selects all items if multiple selections are supported.
voidvalueChanged(ListSelectionEvent event)
Receices notification when the list selection is changed.

Constructor Detail

AccessibleJList

public AccessibleJList()
Create a new AccessibleJList.

Method Detail

addAccessibleSelection

public void addAccessibleSelection(int i)
Adds the accessible item with the specified index to the selected items. If multiple selections are supported, the item is added to the selection, otherwise the item replaces the current selection.

Parameters: i the index of the item to add to the selection

clearAccessibleSelection

public void clearAccessibleSelection()
Remove all selection items from the selection.

contentsChanged

public void contentsChanged(ListDataEvent event)
Receives notification when items have changed in the JList. This method fires a property change event with {@link AccessibleContext#ACCESSIBLE_VISIBLE_DATA_PROPERTY}.

Parameters: event the list data event

getAccessibleAt

public Accessible getAccessibleAt(Point p)
Returns the accessible child at the visual location p (relative to the upper left corner of the JList). If there is no child at that location, this returns null.

Parameters: p the screen location for which to return the accessible child

Returns: the accessible child at the specified location, or null if there is no child at that location

getAccessibleChild

public Accessible getAccessibleChild(int n)
Returns the n-th accessible child of this JList. This will be an instance of {@link AccessibleJListChild}. If there is no child at that index, null is returned.

Parameters: n the index of the child to return

Returns: the n-th accessible child of this JList

getAccessibleChildrenCount

public int getAccessibleChildrenCount()
Returns the number of accessible children in the JList.

Returns: the number of accessible children in the JList

getAccessibleRole

public AccessibleRole getAccessibleRole()
Returns the accessible role for JList, {@link AccessibleRole#LIST}.

Returns: the accessible role for JList

getAccessibleSelection

public Accessible getAccessibleSelection(int n)
Returns the n-th selected accessible child.

Parameters: n the index of the selected child to return

Returns: the n-th selected accessible child

getAccessibleSelectionCount

public int getAccessibleSelectionCount()
Returns the number of selected accessible children.

Returns: the number of selected accessible children

getAccessibleStateSet

public AccessibleStateSet getAccessibleStateSet()
Return the state set of the JList.

Returns: the state set of the JList

intervalAdded

public void intervalAdded(ListDataEvent event)
Receives notification when items are inserted into the JList. This method fires a property change event with {@link AccessibleContext#ACCESSIBLE_VISIBLE_DATA_PROPERTY}.

Parameters: event the list data event

intervalRemoved

public void intervalRemoved(ListDataEvent event)
Receives notification when items are removed from the JList. This method fires a property change event with {@link AccessibleContext#ACCESSIBLE_VISIBLE_DATA_PROPERTY}.

Parameters: event the list data event

isAccessibleChildSelected

public boolean isAccessibleChildSelected(int n)
Returns true if the n-th child is selected, false otherwise.

Parameters: n the index of the child of which the selected state is queried

Returns: true if the n-th child is selected, false otherwise

propertyChange

public void propertyChange(PropertyChangeEvent e)
Receives notification about changes of the JList's properties. This is used to re-register this object as listener to the data model and selection model when the data model or selection model changes.

Parameters: e the property change event

removeAccessibleSelection

public void removeAccessibleSelection(int i)
Removes the accessible item with the specified index to the selection.

Parameters: i the index of the item to be removed from the selection

selectAllAccessibleSelection

public void selectAllAccessibleSelection()
Selects all items if multiple selections are supported. Otherwise do nothing.

valueChanged

public void valueChanged(ListSelectionEvent event)
Receices notification when the list selection is changed. This method fires two property change events, the first with {@link AccessibleContext#ACCESSIBLE_VISIBLE_DATA_PROPERTY} and the second with {@link AccessibleContext#ACCESSIBLE_SELECTION_PROPERTY}.

Parameters: event the list selection event