Class Accessible
getAccessible, and then add an accessible listener
 to override simple items like the name and help string, or they
 can add an accessible control listener to override complex items.
 As a rule of thumb, an application would only want to use the
 accessible control listener to implement accessibility for a
 custom control.- Since:
- 2.0
- See Also:
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedDeprecated.Accessible(Accessible parent) Constructs a new instance of this class given its parent.
- 
Method SummaryModifier and TypeMethodDescriptionvoidAdds the listener to the collection of listeners that will be notified when an accessible client asks for any of the properties defined in theAccessibleActionListenerinterface.voidAdds the listener to the collection of listeners that will be notified when an accessible client asks for any of the properties defined in theAccessibleAttributeListenerinterface.voidAdds the listener to the collection of listeners who will be notified when an accessible client asks for custom control specific information.voidAdds the listener to the collection of listeners that will be notified when an accessible client asks for any of the properties defined in theAccessibleEditableTextListenerinterface.voidAdds the listener to the collection of listeners that will be notified when an accessible client asks for any of the properties defined in theAccessibleHyperlinkListenerinterface.voidaddAccessibleListener(AccessibleListener listener) Adds the listener to the collection of listeners who will be notified when an accessible client asks for certain strings, such as name, description, help, or keyboard shortcut.voidAdds the listener to the collection of listeners that will be notified when an accessible client asks for any of the properties defined in theAccessibleTableCellListenerinterface.voidAdds the listener to the collection of listeners that will be notified when an accessible client asks for any of the properties defined in theAccessibleTableListenerinterface.voidAdds the listener to the collection of listeners who will be notified when an accessible client asks for custom text control specific information.voidAdds the listener to the collection of listeners that will be notified when an accessible client asks for any of the properties defined in theAccessibleValueListenerinterface.voidaddRelation(int type, Accessible target) Adds a relation with the specified type and target to the receiver's set of relations.voiddispose()Disposes of the operating system resources associated with the receiver, and removes the receiver from its parent's list of children.Returns the control for this Accessible object.voidInvokes platform specific functionality to dispose an accessible object.static Accessibleinternal_new_Accessible(Control control) Invokes platform specific functionality to allocate a new accessible object.longinternal_WM_GETOBJECT(long wParam, long lParam) Invokes platform specific functionality to handle a window message.voidRemoves the listener from the collection of listeners that will be notified when an accessible client asks for any of the properties defined in theAccessibleActionListenerinterface.voidRemoves the listener from the collection of listeners that will be notified when an accessible client asks for any of the properties defined in theAccessibleAttributeListenerinterface.voidRemoves the listener from the collection of listeners who will be notified when an accessible client asks for custom control specific information.voidRemoves the listener from the collection of listeners that will be notified when an accessible client asks for any of the properties defined in theAccessibleEditableTextListenerinterface.voidRemoves the listener from the collection of listeners that will be notified when an accessible client asks for any of the properties defined in theAccessibleHyperlinkListenerinterface.voidremoveAccessibleListener(AccessibleListener listener) Removes the listener from the collection of listeners who will be notified when an accessible client asks for certain strings, such as name, description, help, or keyboard shortcut.voidRemoves the listener from the collection of listeners that will be notified when an accessible client asks for any of the properties defined in theAccessibleTableCellListenerinterface.voidRemoves the listener from the collection of listeners that will be notified when an accessible client asks for any of the properties defined in theAccessibleTableListenerinterface.voidRemoves the listener from the collection of listeners who will be notified when an accessible client asks for custom text control specific information.voidRemoves the listener from the collection of listeners that will be notified when an accessible client asks for any of the properties defined in theAccessibleValueListenerinterface.voidremoveRelation(int type, Accessible target) Removes the relation with the specified type and target from the receiver's set of relations.voidSends a message to accessible clients that the child selection within a custom container control has changed.voidSends a message with event-specific data to accessible clients indicating that something has changed within a custom control.voidSends a message with event-specific data and a childID to accessible clients, indicating that something has changed within a custom control.voidsetFocus(int childID) Sends a message to accessible clients indicating that the focus has changed within a custom control.voidtextCaretMoved(int index) Sends a message to accessible clients that the text caret has moved within a custom control.voidtextChanged(int type, int startIndex, int length) Sends a message to accessible clients that the text within a custom control has changed.voidSends a message to accessible clients that the text selection has changed within a custom control.toString()
- 
Constructor Details- 
AccessibleConstructs a new instance of this class given its parent.- Parameters:
- parent- the Accessible parent, which must not be null
- Throws:
- IllegalArgumentException-- ERROR_NULL_ARGUMENT - if the parent is null
 
- Since:
- 3.6
- See Also:
 
- 
AccessibleDeprecated.- Since:
- 3.5
 
 
- 
- 
Method Details- 
internal_new_AccessibleInvokes platform specific functionality to allocate a new accessible object.IMPORTANT: This method is not part of the public API for Accessible. It is marked public only so that it can be shared within the packages provided by SWT. It is not available on all platforms, and should never be called from application code.- Parameters:
- control- the control to get the accessible object for
- Returns:
- the platform specific accessible object
- Restriction:
- This method is not intended to be referenced by clients.
 
- 
addAccessibleListenerAdds the listener to the collection of listeners who will be notified when an accessible client asks for certain strings, such as name, description, help, or keyboard shortcut. The listener is notified by sending it one of the messages defined in theAccessibleListenerinterface.- Parameters:
- listener- the listener that should be notified when the receiver is asked for a name, description, help, or keyboard shortcut string
- Throws:
- IllegalArgumentException-- ERROR_NULL_ARGUMENT - if the listener is null
 
- SWTException-- ERROR_WIDGET_DISPOSED - if the receiver's control has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver's control
 
- See Also:
 
- 
addAccessibleControlListenerAdds the listener to the collection of listeners who will be notified when an accessible client asks for custom control specific information. The listener is notified by sending it one of the messages defined in theAccessibleControlListenerinterface.- Parameters:
- listener- the listener that should be notified when the receiver is asked for custom control specific information
- Throws:
- IllegalArgumentException-- ERROR_NULL_ARGUMENT - if the listener is null
 
- SWTException-- ERROR_WIDGET_DISPOSED - if the receiver's control has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver's control
 
- See Also:
 
- 
addAccessibleTextListenerAdds the listener to the collection of listeners who will be notified when an accessible client asks for custom text control specific information. The listener is notified by sending it one of the messages defined in theAccessibleTextListenerandAccessibleTextExtendedListenerinterfaces.- Parameters:
- listener- the listener that should be notified when the receiver is asked for custom text control specific information
- Throws:
- IllegalArgumentException-- ERROR_NULL_ARGUMENT - if the listener is null
 
- SWTException-- ERROR_WIDGET_DISPOSED - if the receiver's control has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver's control
 
- Since:
- 3.0
- See Also:
 
- 
addAccessibleActionListenerAdds the listener to the collection of listeners that will be notified when an accessible client asks for any of the properties defined in theAccessibleActionListenerinterface.- Parameters:
- listener- the listener that should be notified when the receiver is asked for- AccessibleActionListenerinterface properties
- Throws:
- IllegalArgumentException-- ERROR_NULL_ARGUMENT - if the listener is null
 
- SWTException-- ERROR_WIDGET_DISPOSED - if the receiver's control has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver's control
 
- Since:
- 3.6
- See Also:
 
- 
addAccessibleEditableTextListenerAdds the listener to the collection of listeners that will be notified when an accessible client asks for any of the properties defined in theAccessibleEditableTextListenerinterface.- Parameters:
- listener- the listener that should be notified when the receiver is asked for- AccessibleEditableTextListenerinterface properties
- Throws:
- IllegalArgumentException-- ERROR_NULL_ARGUMENT - if the listener is null
 
- SWTException-- ERROR_WIDGET_DISPOSED - if the receiver's control has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver's control
 
- Since:
- 3.7
- See Also:
 
- 
addAccessibleHyperlinkListenerAdds the listener to the collection of listeners that will be notified when an accessible client asks for any of the properties defined in theAccessibleHyperlinkListenerinterface.- Parameters:
- listener- the listener that should be notified when the receiver is asked for- AccessibleHyperlinkListenerinterface properties
- Throws:
- IllegalArgumentException-- ERROR_NULL_ARGUMENT - if the listener is null
 
- SWTException-- ERROR_WIDGET_DISPOSED - if the receiver's control has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver's control
 
- Since:
- 3.6
- See Also:
 
- 
addAccessibleTableListenerAdds the listener to the collection of listeners that will be notified when an accessible client asks for any of the properties defined in theAccessibleTableListenerinterface.- Parameters:
- listener- the listener that should be notified when the receiver is asked for- AccessibleTableListenerinterface properties
- Throws:
- IllegalArgumentException-- ERROR_NULL_ARGUMENT - if the listener is null
 
- SWTException-- ERROR_WIDGET_DISPOSED - if the receiver's control has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver's control
 
- Since:
- 3.6
- See Also:
 
- 
addAccessibleTableCellListenerAdds the listener to the collection of listeners that will be notified when an accessible client asks for any of the properties defined in theAccessibleTableCellListenerinterface.- Parameters:
- listener- the listener that should be notified when the receiver is asked for- AccessibleTableCellListenerinterface properties
- Throws:
- IllegalArgumentException-- ERROR_NULL_ARGUMENT - if the listener is null
 
- SWTException-- ERROR_WIDGET_DISPOSED - if the receiver's control has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver's control
 
- Since:
- 3.6
- See Also:
 
- 
addAccessibleValueListenerAdds the listener to the collection of listeners that will be notified when an accessible client asks for any of the properties defined in theAccessibleValueListenerinterface.- Parameters:
- listener- the listener that should be notified when the receiver is asked for- AccessibleValueListenerinterface properties
- Throws:
- IllegalArgumentException-- ERROR_NULL_ARGUMENT - if the listener is null
 
- SWTException-- ERROR_WIDGET_DISPOSED - if the receiver's control has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver's control
 
- Since:
- 3.6
- See Also:
 
- 
addAccessibleAttributeListenerAdds the listener to the collection of listeners that will be notified when an accessible client asks for any of the properties defined in theAccessibleAttributeListenerinterface.- Parameters:
- listener- the listener that should be notified when the receiver is asked for- AccessibleAttributeListenerinterface properties
- Throws:
- IllegalArgumentException-- ERROR_NULL_ARGUMENT - if the listener is null
 
- SWTException-- ERROR_WIDGET_DISPOSED - if the receiver's control has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver's control
 
- Since:
- 3.6
- See Also:
 
- 
addRelationAdds a relation with the specified type and target to the receiver's set of relations.- Parameters:
- type- an- ACCconstant beginning with RELATION_* indicating the type of relation
- target- the accessible that is the target for this relation
- Throws:
- IllegalArgumentException- ERROR_NULL_ARGUMENT - if the Accessible target is null
- Since:
- 3.6
 
- 
disposepublic void dispose()Disposes of the operating system resources associated with the receiver, and removes the receiver from its parent's list of children.This method should be called when an accessible that was created with the public constructor Accessible(Accessible parent)is no longer needed. You do not need to call this when the receiver's control is disposed, because allAccessibleinstances associated with a control are released when the control is disposed. It is also not necessary to call this for instances ofAccessiblethat were retrieved withControl.getAccessible().- Since:
- 3.6
 
- 
getControlReturns the control for this Accessible object.- Returns:
- the receiver's control
- Since:
- 3.0
 
- 
internal_dispose_Accessiblepublic void internal_dispose_Accessible()Invokes platform specific functionality to dispose an accessible object.IMPORTANT: This method is not part of the public API for Accessible. It is marked public only so that it can be shared within the packages provided by SWT. It is not available on all platforms, and should never be called from application code.- Restriction:
- This method is not intended to be referenced by clients.
 
- 
internal_WM_GETOBJECTpublic long internal_WM_GETOBJECT(long wParam, long lParam) Invokes platform specific functionality to handle a window message.IMPORTANT: This method is not part of the public API for Accessible. It is marked public only so that it can be shared within the packages provided by SWT. It is not available on all platforms, and should never be called from application code.- Restriction:
- This method is not intended to be referenced by clients.
 
- 
removeAccessibleListenerRemoves the listener from the collection of listeners who will be notified when an accessible client asks for certain strings, such as name, description, help, or keyboard shortcut.- Parameters:
- listener- the listener that should no longer be notified when the receiver is asked for a name, description, help, or keyboard shortcut string
- Throws:
- IllegalArgumentException-- ERROR_NULL_ARGUMENT - if the listener is null
 
- SWTException-- ERROR_WIDGET_DISPOSED - if the receiver's control has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver's control
 
- See Also:
 
- 
removeAccessibleControlListenerRemoves the listener from the collection of listeners who will be notified when an accessible client asks for custom control specific information.- Parameters:
- listener- the listener that should no longer be notified when the receiver is asked for custom control specific information
- Throws:
- IllegalArgumentException-- ERROR_NULL_ARGUMENT - if the listener is null
 
- SWTException-- ERROR_WIDGET_DISPOSED - if the receiver's control has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver's control
 
- See Also:
 
- 
removeAccessibleTextListenerRemoves the listener from the collection of listeners who will be notified when an accessible client asks for custom text control specific information.- Parameters:
- listener- the listener that should no longer be notified when the receiver is asked for custom text control specific information
- Throws:
- IllegalArgumentException-- ERROR_NULL_ARGUMENT - if the listener is null
 
- SWTException-- ERROR_WIDGET_DISPOSED - if the receiver's control has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver's control
 
- Since:
- 3.0
- See Also:
 
- 
removeAccessibleActionListenerRemoves the listener from the collection of listeners that will be notified when an accessible client asks for any of the properties defined in theAccessibleActionListenerinterface.- Parameters:
- listener- the listener that should no longer be notified when the receiver is asked for- AccessibleActionListenerinterface properties
- Throws:
- IllegalArgumentException-- ERROR_NULL_ARGUMENT - if the listener is null
 
- SWTException-- ERROR_WIDGET_DISPOSED - if the receiver's control has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver's control
 
- Since:
- 3.6
- See Also:
 
- 
removeAccessibleEditableTextListenerRemoves the listener from the collection of listeners that will be notified when an accessible client asks for any of the properties defined in theAccessibleEditableTextListenerinterface.- Parameters:
- listener- the listener that should no longer be notified when the receiver is asked for- AccessibleEditableTextListenerinterface properties
- Throws:
- IllegalArgumentException-- ERROR_NULL_ARGUMENT - if the listener is null
 
- SWTException-- ERROR_WIDGET_DISPOSED - if the receiver's control has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver's control
 
- Since:
- 3.7
- See Also:
 
- 
removeAccessibleHyperlinkListenerRemoves the listener from the collection of listeners that will be notified when an accessible client asks for any of the properties defined in theAccessibleHyperlinkListenerinterface.- Parameters:
- listener- the listener that should no longer be notified when the receiver is asked for- AccessibleHyperlinkListenerinterface properties
- Throws:
- IllegalArgumentException-- ERROR_NULL_ARGUMENT - if the listener is null
 
- SWTException-- ERROR_WIDGET_DISPOSED - if the receiver's control has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver's control
 
- Since:
- 3.6
- See Also:
 
- 
removeAccessibleTableListenerRemoves the listener from the collection of listeners that will be notified when an accessible client asks for any of the properties defined in theAccessibleTableListenerinterface.- Parameters:
- listener- the listener that should no longer be notified when the receiver is asked for- AccessibleTableListenerinterface properties
- Throws:
- IllegalArgumentException-- ERROR_NULL_ARGUMENT - if the listener is null
 
- SWTException-- ERROR_WIDGET_DISPOSED - if the receiver's control has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver's control
 
- Since:
- 3.6
- See Also:
 
- 
removeAccessibleTableCellListenerRemoves the listener from the collection of listeners that will be notified when an accessible client asks for any of the properties defined in theAccessibleTableCellListenerinterface.- Parameters:
- listener- the listener that should no longer be notified when the receiver is asked for- AccessibleTableCellListenerinterface properties
- Throws:
- IllegalArgumentException-- ERROR_NULL_ARGUMENT - if the listener is null
 
- SWTException-- ERROR_WIDGET_DISPOSED - if the receiver's control has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver's control
 
- Since:
- 3.6
- See Also:
 
- 
removeAccessibleValueListenerRemoves the listener from the collection of listeners that will be notified when an accessible client asks for any of the properties defined in theAccessibleValueListenerinterface.- Parameters:
- listener- the listener that should no longer be notified when the receiver is asked for- AccessibleValueListenerinterface properties
- Throws:
- IllegalArgumentException-- ERROR_NULL_ARGUMENT - if the listener is null
 
- SWTException-- ERROR_WIDGET_DISPOSED - if the receiver's control has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver's control
 
- Since:
- 3.6
- See Also:
 
- 
removeAccessibleAttributeListenerRemoves the listener from the collection of listeners that will be notified when an accessible client asks for any of the properties defined in theAccessibleAttributeListenerinterface.- Parameters:
- listener- the listener that should no longer be notified when the receiver is asked for- AccessibleAttributeListenerinterface properties
- Throws:
- IllegalArgumentException-- ERROR_NULL_ARGUMENT - if the listener is null
 
- SWTException-- ERROR_WIDGET_DISPOSED - if the receiver's control has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver's control
 
- Since:
- 3.6
- See Also:
 
- 
removeRelationRemoves the relation with the specified type and target from the receiver's set of relations.- Parameters:
- type- an- ACCconstant beginning with RELATION_* indicating the type of relation
- target- the accessible that is the target for this relation
- Throws:
- IllegalArgumentException- ERROR_NULL_ARGUMENT - if the Accessible target is null
- Since:
- 3.6
 
- 
sendEventSends a message with event-specific data to accessible clients indicating that something has changed within a custom control.- Parameters:
- event- an- ACCconstant beginning with EVENT_* indicating the message to send
- eventData- an object containing event-specific data, or null if there is no event-specific data (eventData is specified in the documentation for individual ACC.EVENT_* constants)
- Throws:
- SWTException-- ERROR_WIDGET_DISPOSED - if the receiver's control has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver's control
 
- Since:
- 3.6
- See Also:
 
- 
sendEventSends a message with event-specific data and a childID to accessible clients, indicating that something has changed within a custom control. NOTE: This API is intended for applications that are still using childIDs. Moving forward, applications should use accessible objects instead of childIDs.- Parameters:
- event- an- ACCconstant beginning with EVENT_* indicating the message to send
- eventData- an object containing event-specific data, or null if there is no event-specific data (eventData is specified in the documentation for individual ACC.EVENT_* constants)
- childID- an identifier specifying a child of the control
- Throws:
- SWTException-- ERROR_WIDGET_DISPOSED - if the receiver's control has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver's control
 
- Since:
- 3.8
- See Also:
 
- 
selectionChangedpublic void selectionChanged()Sends a message to accessible clients that the child selection within a custom container control has changed.- Throws:
- SWTException-- ERROR_WIDGET_DISPOSED - if the receiver's control has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver's control
 
- Since:
- 3.0
 
- 
setFocuspublic void setFocus(int childID) Sends a message to accessible clients indicating that the focus has changed within a custom control.- Parameters:
- childID- an identifier specifying a child of the control
- Throws:
- SWTException-- ERROR_WIDGET_DISPOSED - if the receiver's control has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver's control
 
 
- 
textCaretMovedpublic void textCaretMoved(int index) Sends a message to accessible clients that the text caret has moved within a custom control.- Parameters:
- index- the new caret index within the control
- Throws:
- SWTException-- ERROR_WIDGET_DISPOSED - if the receiver's control has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver's control
 
- Since:
- 3.0
 
- 
textChangedpublic void textChanged(int type, int startIndex, int length) Sends a message to accessible clients that the text within a custom control has changed.- Parameters:
- type- the type of change, one of- ACC.TEXT_INSERTor- ACC.TEXT_DELETE
- startIndex- the text index within the control where the insertion or deletion begins
- length- the non-negative length in characters of the insertion or deletion
- Throws:
- SWTException-- ERROR_WIDGET_DISPOSED - if the receiver's control has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver's control
 
- Since:
- 3.0
- See Also:
 
- 
textSelectionChangedpublic void textSelectionChanged()Sends a message to accessible clients that the text selection has changed within a custom control.- Throws:
- SWTException-- ERROR_WIDGET_DISPOSED - if the receiver's control has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver's control
 
- Since:
- 3.0
 
- 
toString
 
-