- java.lang.Object
-
- javax.accessibility.AccessibleContext
-
- javax.swing.JList.AccessibleJList.AccessibleJListChild
-
- All Implemented Interfaces:
Accessible
,AccessibleAction
,AccessibleComponent
- Enclosing class:
- JList.AccessibleJList
protected class JList.AccessibleJList.AccessibleJListChild extends AccessibleContext implements Accessible, AccessibleComponent, AccessibleAction
This class implements accessibility support appropriate for list children.
-
-
Field Summary
-
Fields declared in interface javax.accessibility.AccessibleAction
CLICK, DECREMENT, INCREMENT, TOGGLE_EXPAND, TOGGLE_POPUP
-
Fields declared in class javax.accessibility.AccessibleContext
ACCESSIBLE_ACTION_PROPERTY, ACCESSIBLE_ACTIVE_DESCENDANT_PROPERTY, ACCESSIBLE_CARET_PROPERTY, ACCESSIBLE_CHILD_PROPERTY, ACCESSIBLE_COMPONENT_BOUNDS_CHANGED, ACCESSIBLE_DESCRIPTION_PROPERTY, ACCESSIBLE_HYPERTEXT_OFFSET, ACCESSIBLE_INVALIDATE_CHILDREN, ACCESSIBLE_NAME_PROPERTY, ACCESSIBLE_SELECTION_PROPERTY, ACCESSIBLE_STATE_PROPERTY, ACCESSIBLE_TABLE_CAPTION_CHANGED, ACCESSIBLE_TABLE_COLUMN_DESCRIPTION_CHANGED, ACCESSIBLE_TABLE_COLUMN_HEADER_CHANGED, ACCESSIBLE_TABLE_MODEL_CHANGED, ACCESSIBLE_TABLE_ROW_DESCRIPTION_CHANGED, ACCESSIBLE_TABLE_ROW_HEADER_CHANGED, ACCESSIBLE_TABLE_SUMMARY_CHANGED, ACCESSIBLE_TEXT_ATTRIBUTES_CHANGED, ACCESSIBLE_TEXT_PROPERTY, ACCESSIBLE_VALUE_PROPERTY, ACCESSIBLE_VISIBLE_DATA_PROPERTY, accessibleDescription, accessibleName, accessibleParent
-
-
Constructor Summary
Constructors Constructor Description AccessibleJListChild(JList<E> parent, int indexInParent)
Constructs anAccessibleJListChild
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
doAccessibleAction(int i)
Performs the specified action on the object.AccessibleAction
getAccessibleAction()
Gets theAccessibleAction
associated with this object that supports one or more actions.int
getAccessibleActionCount()
Returns the number of accessible actions available in this object If there are more than one, the first one is considered the "default" action of the object.String
getAccessibleActionDescription(int i)
Returns a description of the specified action of the object.AccessibleComponent
getAccessibleComponent()
Get the AccessibleComponent associated with this object.AccessibleContext
getAccessibleContext()
Get the AccessibleContext for this object.AccessibleIcon[]
getAccessibleIcon()
Returns the icon for the element renderer, as the only item of an array ofAccessibleIcon
s or anull
array if the renderer component contains no icons.-
Methods declared in interface javax.accessibility.AccessibleComponent
addFocusListener, contains, getAccessibleAt, getBackground, getBounds, getCursor, getFont, getFontMetrics, getForeground, getLocation, getLocationOnScreen, getSize, isEnabled, isFocusTraversable, isShowing, isVisible, removeFocusListener, requestFocus, setBackground, setBounds, setCursor, setEnabled, setFont, setForeground, setLocation, setSize, setVisible
-
Methods declared in class javax.accessibility.AccessibleContext
addPropertyChangeListener, firePropertyChange, getAccessibleChild, getAccessibleChildrenCount, getAccessibleDescription, getAccessibleEditableText, getAccessibleIndexInParent, getAccessibleName, getAccessibleParent, getAccessibleRelationSet, getAccessibleRole, getAccessibleSelection, getAccessibleStateSet, getAccessibleTable, getAccessibleText, getAccessibleValue, getLocale, removePropertyChangeListener, setAccessibleDescription, setAccessibleName, setAccessibleParent
-
-
-
-
Method Detail
-
getAccessibleContext
public AccessibleContext getAccessibleContext()
Get the AccessibleContext for this object. In the implementation of the Java Accessibility API for this class, returns this object, which is its own AccessibleContext.- Specified by:
getAccessibleContext
in interfaceAccessible
- Returns:
- this object
-
getAccessibleComponent
public AccessibleComponent getAccessibleComponent()
Get the AccessibleComponent associated with this object. In the implementation of the Java Accessibility API for this class, return this object, which is responsible for implementing the AccessibleComponent interface on behalf of itself.- Overrides:
getAccessibleComponent
in classAccessibleContext
- Returns:
- this object
- See Also:
AccessibleComponent
-
getAccessibleIcon
public AccessibleIcon[] getAccessibleIcon()
Returns the icon for the element renderer, as the only item of an array ofAccessibleIcon
s or anull
array if the renderer component contains no icons.- Overrides:
getAccessibleIcon
in classAccessibleContext
- Returns:
- an array containing the accessible icon
or a
null
array if none - Since:
- 1.3
- See Also:
AccessibleIcon
-
getAccessibleAction
public AccessibleAction getAccessibleAction()
Gets theAccessibleAction
associated with this object that supports one or more actions.- Overrides:
getAccessibleAction
in classAccessibleContext
- Implementation Requirements:
- Returns the AccessibleAction for this AccessibleJListChild as follows: First getListCellRendererComponent of the ListCellRenderer for the component at the "index in parent" of this child is called. Then its AccessibleContext is fetched and that AccessibleContext's AccessibleAction is returned. Note that if an AccessibleAction is not found using this process then this object with its implementation of the AccessibleAction interface is returned.
- Returns:
AccessibleAction
if supported by object; else returnnull
- Since:
- 9
- See Also:
AccessibleAction
-
doAccessibleAction
public boolean doAccessibleAction(int i)
Performs the specified action on the object.- Specified by:
doAccessibleAction
in interfaceAccessibleAction
- Implementation Requirements:
- If i == 0 selects this AccessibleJListChild by calling JList.this.setSelectedIndex(indexInParent) and then returns true; otherwise returns false.
- Parameters:
i
- zero-based index of actions- Returns:
true
if the action was performed; otherwisefalse
- Since:
- 9
- See Also:
AccessibleAction.getAccessibleActionCount()
-
getAccessibleActionDescription
public String getAccessibleActionDescription(int i)
Returns a description of the specified action of the object.- Specified by:
getAccessibleActionDescription
in interfaceAccessibleAction
- Implementation Requirements:
- If i == 0 returns the action description fetched from UIManager.getString("AbstractButton.clickText"); otherwise returns null.
- Parameters:
i
- zero-based index of the actions- Returns:
- a
String
description of the action - Since:
- 9
- See Also:
AccessibleAction.getAccessibleActionCount()
-
getAccessibleActionCount
public int getAccessibleActionCount()
Returns the number of accessible actions available in this object If there are more than one, the first one is considered the "default" action of the object.- Specified by:
getAccessibleActionCount
in interfaceAccessibleAction
- Implementation Requirements:
- Returns 1, i.e. there is only one action.
- Returns:
- the zero-based number of actions in this object
- Since:
- 9
-
-