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.-
Constructor Summary
ModifierConstructorDescriptionprotected
Deprecated.Accessible
(Accessible parent) Constructs a new instance of this class given its parent. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds the listener to the collection of listeners that will be notified when an accessible client asks for any of the properties defined in theAccessibleActionListener
interface.void
Adds the listener to the collection of listeners that will be notified when an accessible client asks for any of the properties defined in theAccessibleAttributeListener
interface.void
Adds the listener to the collection of listeners who will be notified when an accessible client asks for custom control specific information.void
Adds the listener to the collection of listeners that will be notified when an accessible client asks for any of the properties defined in theAccessibleEditableTextListener
interface.void
Adds the listener to the collection of listeners that will be notified when an accessible client asks for any of the properties defined in theAccessibleHyperlinkListener
interface.void
addAccessibleListener
(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.void
Adds the listener to the collection of listeners that will be notified when an accessible client asks for any of the properties defined in theAccessibleTableCellListener
interface.void
Adds the listener to the collection of listeners that will be notified when an accessible client asks for any of the properties defined in theAccessibleTableListener
interface.void
Adds the listener to the collection of listeners who will be notified when an accessible client asks for custom text control specific information.void
Adds the listener to the collection of listeners that will be notified when an accessible client asks for any of the properties defined in theAccessibleValueListener
interface.void
addRelation
(int type, Accessible target) Adds a relation with the specified type and target to the receiver's set of relations.void
dispose()
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.void
Invokes platform specific functionality to dispose an accessible object.static Accessible
internal_new_Accessible
(Control control) Invokes platform specific functionality to allocate a new accessible object.long
internal_WM_GETOBJECT
(long wParam, long lParam) Invokes platform specific functionality to handle a window message.void
Removes the listener from the collection of listeners that will be notified when an accessible client asks for any of the properties defined in theAccessibleActionListener
interface.void
Removes the listener from the collection of listeners that will be notified when an accessible client asks for any of the properties defined in theAccessibleAttributeListener
interface.void
Removes the listener from the collection of listeners who will be notified when an accessible client asks for custom control specific information.void
Removes the listener from the collection of listeners that will be notified when an accessible client asks for any of the properties defined in theAccessibleEditableTextListener
interface.void
Removes the listener from the collection of listeners that will be notified when an accessible client asks for any of the properties defined in theAccessibleHyperlinkListener
interface.void
removeAccessibleListener
(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.void
Removes the listener from the collection of listeners that will be notified when an accessible client asks for any of the properties defined in theAccessibleTableCellListener
interface.void
Removes the listener from the collection of listeners that will be notified when an accessible client asks for any of the properties defined in theAccessibleTableListener
interface.void
Removes the listener from the collection of listeners who will be notified when an accessible client asks for custom text control specific information.void
Removes the listener from the collection of listeners that will be notified when an accessible client asks for any of the properties defined in theAccessibleValueListener
interface.void
removeRelation
(int type, Accessible target) Removes the relation with the specified type and target from the receiver's set of relations.void
Sends a message to accessible clients that the child selection within a custom container control has changed.void
Sends a message with event-specific data to accessible clients indicating that something has changed within a custom control.void
Sends a message with event-specific data and a childID to accessible clients, indicating that something has changed within a custom control.void
setFocus
(int childID) Sends a message to accessible clients indicating that the focus has changed within a custom control.void
textCaretMoved
(int index) Sends a message to accessible clients that the text caret has moved within a custom control.void
textChanged
(int type, int startIndex, int length) Sends a message to accessible clients that the text within a custom control has changed.void
Sends a message to accessible clients that the text selection has changed within a custom control.toString()
-
Constructor Details
-
Accessible
Constructs 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:
-
Accessible
Deprecated.- Since:
- 3.5
-
-
Method Details
-
internal_new_Accessible
Invokes 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.
-
addAccessibleListener
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. The listener is notified by sending it one of the messages defined in theAccessibleListener
interface.- 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:
-
addAccessibleControlListener
Adds 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 theAccessibleControlListener
interface.- 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:
-
addAccessibleTextListener
Adds 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 theAccessibleTextListener
andAccessibleTextExtendedListener
interfaces.- 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:
-
addAccessibleActionListener
Adds the listener to the collection of listeners that will be notified when an accessible client asks for any of the properties defined in theAccessibleActionListener
interface.- Parameters:
listener
- the listener that should be notified when the receiver is asked forAccessibleActionListener
interface 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:
-
addAccessibleEditableTextListener
Adds the listener to the collection of listeners that will be notified when an accessible client asks for any of the properties defined in theAccessibleEditableTextListener
interface.- Parameters:
listener
- the listener that should be notified when the receiver is asked forAccessibleEditableTextListener
interface 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:
-
addAccessibleHyperlinkListener
Adds the listener to the collection of listeners that will be notified when an accessible client asks for any of the properties defined in theAccessibleHyperlinkListener
interface.- Parameters:
listener
- the listener that should be notified when the receiver is asked forAccessibleHyperlinkListener
interface 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:
-
addAccessibleTableListener
Adds the listener to the collection of listeners that will be notified when an accessible client asks for any of the properties defined in theAccessibleTableListener
interface.- Parameters:
listener
- the listener that should be notified when the receiver is asked forAccessibleTableListener
interface 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:
-
addAccessibleTableCellListener
Adds the listener to the collection of listeners that will be notified when an accessible client asks for any of the properties defined in theAccessibleTableCellListener
interface.- Parameters:
listener
- the listener that should be notified when the receiver is asked forAccessibleTableCellListener
interface 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:
-
addAccessibleValueListener
Adds the listener to the collection of listeners that will be notified when an accessible client asks for any of the properties defined in theAccessibleValueListener
interface.- Parameters:
listener
- the listener that should be notified when the receiver is asked forAccessibleValueListener
interface 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:
-
addAccessibleAttributeListener
Adds the listener to the collection of listeners that will be notified when an accessible client asks for any of the properties defined in theAccessibleAttributeListener
interface.- Parameters:
listener
- the listener that should be notified when the receiver is asked forAccessibleAttributeListener
interface 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:
-
addRelation
Adds a relation with the specified type and target to the receiver's set of relations.- Parameters:
type
- anACC
constant beginning with RELATION_* indicating the type of relationtarget
- the accessible that is the target for this relation- Throws:
IllegalArgumentException
- ERROR_NULL_ARGUMENT - if the Accessible target is null- Since:
- 3.6
-
dispose
public 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 allAccessible
instances associated with a control are released when the control is disposed. It is also not necessary to call this for instances ofAccessible
that were retrieved withControl.getAccessible()
.- Since:
- 3.6
-
getControl
Returns the control for this Accessible object.- Returns:
- the receiver's control
- Since:
- 3.0
-
internal_dispose_Accessible
public 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_GETOBJECT
public 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.
-
removeAccessibleListener
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.- 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:
-
removeAccessibleControlListener
Removes 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:
-
removeAccessibleTextListener
Removes 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:
-
removeAccessibleActionListener
Removes the listener from the collection of listeners that will be notified when an accessible client asks for any of the properties defined in theAccessibleActionListener
interface.- Parameters:
listener
- the listener that should no longer be notified when the receiver is asked forAccessibleActionListener
interface 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:
-
removeAccessibleEditableTextListener
Removes the listener from the collection of listeners that will be notified when an accessible client asks for any of the properties defined in theAccessibleEditableTextListener
interface.- Parameters:
listener
- the listener that should no longer be notified when the receiver is asked forAccessibleEditableTextListener
interface 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:
-
removeAccessibleHyperlinkListener
Removes the listener from the collection of listeners that will be notified when an accessible client asks for any of the properties defined in theAccessibleHyperlinkListener
interface.- Parameters:
listener
- the listener that should no longer be notified when the receiver is asked forAccessibleHyperlinkListener
interface 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:
-
removeAccessibleTableListener
Removes the listener from the collection of listeners that will be notified when an accessible client asks for any of the properties defined in theAccessibleTableListener
interface.- Parameters:
listener
- the listener that should no longer be notified when the receiver is asked forAccessibleTableListener
interface 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:
-
removeAccessibleTableCellListener
Removes the listener from the collection of listeners that will be notified when an accessible client asks for any of the properties defined in theAccessibleTableCellListener
interface.- Parameters:
listener
- the listener that should no longer be notified when the receiver is asked forAccessibleTableCellListener
interface 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:
-
removeAccessibleValueListener
Removes the listener from the collection of listeners that will be notified when an accessible client asks for any of the properties defined in theAccessibleValueListener
interface.- Parameters:
listener
- the listener that should no longer be notified when the receiver is asked forAccessibleValueListener
interface 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:
-
removeAccessibleAttributeListener
Removes the listener from the collection of listeners that will be notified when an accessible client asks for any of the properties defined in theAccessibleAttributeListener
interface.- Parameters:
listener
- the listener that should no longer be notified when the receiver is asked forAccessibleAttributeListener
interface 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:
-
removeRelation
Removes the relation with the specified type and target from the receiver's set of relations.- Parameters:
type
- anACC
constant beginning with RELATION_* indicating the type of relationtarget
- the accessible that is the target for this relation- Throws:
IllegalArgumentException
- ERROR_NULL_ARGUMENT - if the Accessible target is null- Since:
- 3.6
-
sendEvent
Sends a message with event-specific data to accessible clients indicating that something has changed within a custom control.- Parameters:
event
- anACC
constant beginning with EVENT_* indicating the message to sendeventData
- 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:
-
ACC.EVENT_ACTION_CHANGED
ACC.EVENT_ATTRIBUTE_CHANGED
ACC.EVENT_DESCRIPTION_CHANGED
ACC.EVENT_DOCUMENT_LOAD_COMPLETE
ACC.EVENT_DOCUMENT_LOAD_STOPPED
ACC.EVENT_DOCUMENT_RELOAD
ACC.EVENT_HYPERLINK_ACTIVATED
ACC.EVENT_HYPERLINK_ANCHOR_COUNT_CHANGED
ACC.EVENT_HYPERLINK_END_INDEX_CHANGED
ACC.EVENT_HYPERLINK_SELECTED_LINK_CHANGED
ACC.EVENT_HYPERLINK_START_INDEX_CHANGED
ACC.EVENT_HYPERTEXT_LINK_COUNT_CHANGED
ACC.EVENT_HYPERTEXT_LINK_SELECTED
ACC.EVENT_LOCATION_CHANGED
ACC.EVENT_NAME_CHANGED
ACC.EVENT_PAGE_CHANGED
ACC.EVENT_SECTION_CHANGED
ACC.EVENT_SELECTION_CHANGED
ACC.EVENT_STATE_CHANGED
ACC.EVENT_TABLE_CAPTION_CHANGED
ACC.EVENT_TABLE_CHANGED
ACC.EVENT_TABLE_COLUMN_DESCRIPTION_CHANGED
ACC.EVENT_TABLE_COLUMN_HEADER_CHANGED
ACC.EVENT_TABLE_ROW_DESCRIPTION_CHANGED
ACC.EVENT_TABLE_ROW_HEADER_CHANGED
ACC.EVENT_TABLE_SUMMARY_CHANGED
ACC.EVENT_TEXT_ATTRIBUTE_CHANGED
ACC.EVENT_TEXT_CARET_MOVED
ACC.EVENT_TEXT_CHANGED
ACC.EVENT_TEXT_COLUMN_CHANGED
ACC.EVENT_TEXT_SELECTION_CHANGED
ACC.EVENT_VALUE_CHANGED
-
sendEvent
Sends 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
- anACC
constant beginning with EVENT_* indicating the message to sendeventData
- 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:
-
selectionChanged
public 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
-
setFocus
public 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
-
textCaretMoved
public 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
-
textChanged
public 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 ofACC.TEXT_INSERT
orACC.TEXT_DELETE
startIndex
- the text index within the control where the insertion or deletion beginslength
- 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:
-
textSelectionChanged
public 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
-