javax.swing

Class JComponent.AccessibleJComponent

public abstract class JComponent.AccessibleJComponent extends AccessibleAWTContainer implements AccessibleExtendedComponent

Basic accessibility support for JComponent derived widgets.
Nested Class Summary
protected classJComponent.AccessibleJComponent.AccessibleContainerHandler
Receives notification if there are child components are added or removed from the JComponent and fires appropriate PropertyChangeEvents to interested listeners on the AccessibleJComponent.
protected classJComponent.AccessibleJComponent.AccessibleFocusHandler
Receives notification if the focus on the JComponent changes and fires appropriate PropertyChangeEvents to listeners registered with the AccessibleJComponent.
Field Summary
protected ContainerListeneraccessibleContainerHandler
Receives notification when a child component is added to the JComponent and fires a PropertyChangeEvent on listeners registered with the AccessibleJComponent.
protected FocusListeneraccessibleFocusHandler
Receives notification if the focus on the JComponent changes and fires appropriate PropertyChangeEvents to listeners registered with the AccessibleJComponent.
Constructor Summary
protected AccessibleJComponent()
Creates a new AccessibleJComponent.
Method Summary
voidaddPropertyChangeListener(PropertyChangeListener listener)
Adds a property change listener to the list of registered listeners.
AccessiblegetAccessibleChild(int i)
Returns the accessible child component at index i.
intgetAccessibleChildrenCount()
Returns the number of accessible children of this object.
StringgetAccessibleDescription()
Returns the localized description of this object.
AccessibleKeyBindinggetAccessibleKeyBinding()
Returns the keybindings associated with this accessible component or null if the component does not support key bindings.
StringgetAccessibleName()
Returns the localized name for this object.
AccessibleRolegetAccessibleRole()
Returns the accessible role of this component.
AccessibleStateSetgetAccessibleStateSet()
Returns the accessible state set of this component.
protected StringgetBorderTitle(Border border)
Recursivly searches a border hierarchy (starting at border) for a titled border and returns the title if one is found, null otherwise.
StringgetTitledBorderText()
Returns the title of the border of this accessible component if this component has a titled border, otherwise returns null.
StringgetToolTipText()
Returns the tooltip text for this accessible component.
voidremovePropertyChangeListener(PropertyChangeListener listener)
Removes a property change listener from the list of registered listeners.

Field Detail

accessibleContainerHandler

protected ContainerListener accessibleContainerHandler
Receives notification when a child component is added to the JComponent and fires a PropertyChangeEvent on listeners registered with the AccessibleJComponent.

UNKNOWN: AccessibleAWTContainer has a protected field with the same name. Looks like a bug or nasty misdesign to me.

accessibleFocusHandler

protected FocusListener accessibleFocusHandler
Receives notification if the focus on the JComponent changes and fires appropriate PropertyChangeEvents to listeners registered with the AccessibleJComponent.

UNKNOWN: AccessibleAWTComponent has a protected field accessibleAWTFocusHandler. Looks like a bug or nasty misdesign to me.

Constructor Detail

AccessibleJComponent

protected AccessibleJComponent()
Creates a new AccessibleJComponent.

Method Detail

addPropertyChangeListener

public void addPropertyChangeListener(PropertyChangeListener listener)
Adds a property change listener to the list of registered listeners. This sets up the {@link #accessibleContainerHandler} and {@link #accessibleFocusHandler} fields and calls super.addPropertyChangeListener(listener).

Parameters: listener the listener to add

getAccessibleChild

public Accessible getAccessibleChild(int i)
Returns the accessible child component at index i.

Parameters: i the index of the accessible child to return

Returns: the accessible child component at index i

getAccessibleChildrenCount

public int getAccessibleChildrenCount()
Returns the number of accessible children of this object.

Returns: the number of accessible children of this object

getAccessibleDescription

public String getAccessibleDescription()
Returns the localized description of this object.

Returns: the localized description of this object or null if this object has no description

getAccessibleKeyBinding

public AccessibleKeyBinding getAccessibleKeyBinding()
Returns the keybindings associated with this accessible component or null if the component does not support key bindings.

Returns: the keybindings associated with this accessible component

getAccessibleName

public String getAccessibleName()
Returns the localized name for this object. Generally this should almost never return {@link Component#getName()} since that is not a localized name. If the object is some kind of text component (like a menu item), then the value of the object may be returned. Also, if the object has a tooltip, the value of the tooltip may also be appropriate.

Returns: the localized name for this object or null if this object has no name

getAccessibleRole

public AccessibleRole getAccessibleRole()
Returns the accessible role of this component.

Returns: the accessible role of this component

See Also: AccessibleRole

getAccessibleStateSet

public AccessibleStateSet getAccessibleStateSet()
Returns the accessible state set of this component.

Returns: the accessible state set of this component

getBorderTitle

protected String getBorderTitle(Border border)
Recursivly searches a border hierarchy (starting at border) for a titled border and returns the title if one is found, null otherwise.

Parameters: border the border to start search from

Returns: the border title of a possibly found titled border

getTitledBorderText

public String getTitledBorderText()
Returns the title of the border of this accessible component if this component has a titled border, otherwise returns null.

Returns: the title of the border of this accessible component if this component has a titled border, otherwise returns null

getToolTipText

public String getToolTipText()
Returns the tooltip text for this accessible component.

Returns: the tooltip text for this accessible component

removePropertyChangeListener

public void removePropertyChangeListener(PropertyChangeListener listener)
Removes a property change listener from the list of registered listeners. This uninstalls the {@link #accessibleContainerHandler} and {@link #accessibleFocusHandler} fields and calls super.removePropertyChangeListener(listener).

Parameters: listener the listener to remove