public abstract class JComponent.AccessibleJComponent extends Container.AccessibleAWTContainer implements AccessibleExtendedComponent
Inner class of JComponent used to provide default support for accessibility. This class is not meant to be used directly by application developers, but is instead meant only to be subclassed by component developers.
Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. As of 1.4, support for long term storage of all JavaBeans™ has been added to the java.beans
package. Please see XMLEncoder
.
Modifier and Type | Class and Description |
---|---|
protected class |
JComponent.AccessibleJComponent.AccessibleContainerHandler Fire PropertyChange listener, if one is registered, when children added/removed. |
protected class |
JComponent.AccessibleJComponent.AccessibleFocusHandler Fire PropertyChange listener, if one is registered, when focus events happen |
Component.AccessibleAWTComponent.AccessibleAWTComponentHandler, Component.AccessibleAWTComponent.AccessibleAWTFocusHandler
@Deprecated protected FocusListener accessibleFocusHandler
Deprecated.
This field duplicates the function of the accessibleAWTFocusHandler field in java.awt.Component.AccessibleAWTComponent, so it has been deprecated.
protected AccessibleJComponent()
Though the class is abstract, this should be called by all sub-classes.
public void addPropertyChangeListener(PropertyChangeListener listener)
Adds a PropertyChangeListener to the listener list.
addPropertyChangeListener
in class Container.AccessibleAWTContainer
listener
- the PropertyChangeListener to be addedAccessibleContext.ACCESSIBLE_NAME_PROPERTY
, AccessibleContext.ACCESSIBLE_DESCRIPTION_PROPERTY
, AccessibleContext.ACCESSIBLE_STATE_PROPERTY
, AccessibleContext.ACCESSIBLE_VALUE_PROPERTY
, AccessibleContext.ACCESSIBLE_SELECTION_PROPERTY
, AccessibleContext.ACCESSIBLE_TEXT_PROPERTY
, AccessibleContext.ACCESSIBLE_VISIBLE_DATA_PROPERTY
public void removePropertyChangeListener(PropertyChangeListener listener)
Removes a PropertyChangeListener from the listener list. This removes a PropertyChangeListener that was registered for all properties.
removePropertyChangeListener
in class Container.AccessibleAWTContainer
listener
- the PropertyChangeListener to be removedprotected String getBorderTitle(Border b)
Recursively search through the border hierarchy (if it exists) for a TitledBorder with a non-null title. This does a depth first search on first the inside borders then the outside borders. The assumption is that titles make really pretty inside borders but not very pretty outside borders in compound border situations. It's rather arbitrary, but hopefully decent UI programmers will not create multiple titled borders for the same component.
public String getAccessibleName()
Gets the accessible name of this object. This should almost never return java.awt.Component.getName(), as that generally isn't a localized name, and doesn't have meaning for the user. If the object is fundamentally a text object (such as a menu item), the accessible name should be the text of the object (for example, "save"). If the object has a tooltip, the tooltip text may also be an appropriate String to return.
getAccessibleName
in class Component.AccessibleAWTComponent
AccessibleContext.setAccessibleName(java.lang.String)
public String getAccessibleDescription()
Gets the accessible description of this object. This should be a concise, localized description of what this object is - what is its meaning to the user. If the object has a tooltip, the tooltip text may be an appropriate string to return, assuming it contains a concise description of the object (instead of just the name of the object - for example a "Save" icon on a toolbar that had "save" as the tooltip text shouldn't return the tooltip text as the description, but something like "Saves the current text document" instead).
getAccessibleDescription
in class Component.AccessibleAWTComponent
AccessibleContext.setAccessibleDescription(java.lang.String)
public AccessibleRole getAccessibleRole()
Gets the role of this object.
getAccessibleRole
in class Component.AccessibleAWTComponent
AccessibleRole
public AccessibleStateSet getAccessibleStateSet()
Gets the state of this object.
getAccessibleStateSet
in class Component.AccessibleAWTComponent
AccessibleState
public int getAccessibleChildrenCount()
Returns the number of accessible children in the object. If all of the children of this object implement Accessible, than this method should return the number of children of this object.
getAccessibleChildrenCount
in class Container.AccessibleAWTContainer
public Accessible getAccessibleChild(int i)
Returns the nth Accessible child of the object.
getAccessibleChild
in class Container.AccessibleAWTContainer
i
- zero-based index of childAccessibleContext.getAccessibleChildrenCount()
public String getToolTipText()
Returns the tool tip text
getToolTipText
in interface AccessibleExtendedComponent
public String getTitledBorderText()
Returns the titled border text
getTitledBorderText
in interface AccessibleExtendedComponent
public AccessibleKeyBinding getAccessibleKeyBinding()
Returns key bindings associated with this object
getAccessibleKeyBinding
in interface AccessibleExtendedComponent
AccessibleKeyBinding
© 1993–2017, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.