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
ConstructorsConstructorDescriptionAccessible(Accessible parent) Constructs a new instance of this class given its parent. -
Method Summary
Modifier 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 theAccessibleActioninterface.voidAdds the listener to the collection of listeners that will be notified when an accessible client asks for any of the properties defined in theAccessibleAttributeinterface.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 theAccessibleEditableTextinterface.voidAdds the listener to the collection of listeners that will be notified when an accessible client asks for any of the properties defined in theAccessibleHyperlinkinterface.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 theAccessibleTableCellinterface.voidAdds the listener to the collection of listeners that will be notified when an accessible client asks for any of the properties defined in theAccessibleTableinterface.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 theAccessibleValueinterface.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.intinternal_WM_GETOBJECT(int wParam, int 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 theAccessibleActioninterface.voidRemoves the listener from the collection of listeners that will be notified when an accessible client asks for any of the properties defined in theAccessibleAttributeinterface.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 theAccessibleEditableTextinterface.voidRemoves the listener from the collection of listeners that will be notified when an accessible client asks for any of the properties defined in theAccessibleHyperlinkinterface.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 theAccessibleTableCellinterface.voidRemoves the listener from the collection of listeners that will be notified when an accessible client asks for any of the properties defined in theAccessibleTableinterface.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 theAccessibleValueinterface.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.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.
-
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
- See Also:
-
-
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
-
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 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:
-
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:
-
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 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:
-
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:
-
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 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
- 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
- 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 theAccessibleActioninterface.- Parameters:
listener- the listener that should be notified when the receiver is asked forAccessibleActioninterface 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
- 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 theAccessibleEditableTextinterface.- Parameters:
listener- the listener that should be notified when the receiver is asked forAccessibleEditableTextinterface 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
- 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 theAccessibleHyperlinkinterface.- Parameters:
listener- the listener that should be notified when the receiver is asked forAccessibleHyperlinkinterface 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
- 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 theAccessibleTableinterface.- Parameters:
listener- the listener that should be notified when the receiver is asked forAccessibleTableinterface 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
- 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 theAccessibleTableCellinterface.- Parameters:
listener- the listener that should be notified when the receiver is asked forAccessibleTableCellinterface 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
- 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 theAccessibleValueinterface.- Parameters:
listener- the listener that should be notified when the receiver is asked forAccessibleValueinterface 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
- 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 theAccessibleAttributeinterface.- Parameters:
listener- the listener that should be notified when the receiver is asked forAccessibleAttributeinterface 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
- See Also:
-
addRelation
Adds a relation with the specified type and target to the receiver's set of relations.- Parameters:
type- anACCconstant beginning with RELATION_* indicating the type of relationtarget- the accessible that is the target for this relation
-
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 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(). -
getControl
Returns the control for this Accessible object.- Returns:
- the receiver's control
-
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 theAccessibleActioninterface.- Parameters:
listener- the listener that should no longer be notified when the receiver is asked forAccessibleActioninterface 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
- 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 theAccessibleEditableTextinterface.- Parameters:
listener- the listener that should no longer be notified when the receiver is asked forAccessibleEditableTextinterface 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
- 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 theAccessibleHyperlinkinterface.- Parameters:
listener- the listener that should no longer be notified when the receiver is asked forAccessibleHyperlinkinterface 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
- 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 theAccessibleTableinterface.- Parameters:
listener- the listener that should no longer be notified when the receiver is asked forAccessibleTableinterface 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
- 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 theAccessibleTableCellinterface.- Parameters:
listener- the listener that should no longer be notified when the receiver is asked forAccessibleTableCellinterface 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
- 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 theAccessibleValueinterface.- Parameters:
listener- the listener that should no longer be notified when the receiver is asked forAccessibleValueinterface 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
- 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 theAccessibleAttributeinterface.- Parameters:
listener- the listener that should no longer be notified when the receiver is asked forAccessibleAttributeinterface 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
- See Also:
-
removeRelation
Removes the relation with the specified type and target from the receiver's set of relations.- Parameters:
type- anACCconstant beginning with RELATION_* indicating the type of relationtarget- the accessible that is the target for this relation
-
sendEvent
Sends a message with event-specific data to accessible clients indicating that something has changed within a custom control.- Parameters:
event- anACCconstant beginning with EVENT_* indicating the message to sendeventData- an object containing event-specific data, or null if there is no event-specific data- 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
- See Also:
-
ACC.EVENT_ACTION_CHANGEDACC.EVENT_ATTRIBUTE_CHANGEDACC.EVENT_DESCRIPTION_CHANGEDACC.EVENT_DOCUMENT_LOAD_COMPLETEACC.EVENT_DOCUMENT_LOAD_STOPPEDACC.EVENT_DOCUMENT_RELOADACC.EVENT_HYPERLINK_ACTIVATEDACC.EVENT_HYPERLINK_ANCHOR_COUNT_CHANGEDACC.EVENT_HYPERLINK_END_INDEX_CHANGEDACC.EVENT_HYPERLINK_SELECTED_LINK_CHANGEDACC.EVENT_HYPERLINK_START_INDEX_CHANGEDACC.EVENT_HYPERTEXT_LINK_COUNT_CHANGEDACC.EVENT_HYPERTEXT_LINK_SELECTEDACC.EVENT_LOCATION_CHANGEDACC.EVENT_NAME_CHANGEDACC.EVENT_PAGE_CHANGEDACC.EVENT_SECTION_CHANGEDACC.EVENT_SELECTION_CHANGEDACC.EVENT_STATE_CHANGEDACC.EVENT_TABLE_CAPTION_CHANGEDACC.EVENT_TABLE_CHANGEDACC.EVENT_TABLE_COLUMN_DESCRIPTION_CHANGEDACC.EVENT_TABLE_COLUMN_HEADER_CHANGEDACC.EVENT_TABLE_ROW_DESCRIPTION_CHANGEDACC.EVENT_TABLE_ROW_HEADER_CHANGEDACC.EVENT_TABLE_SUMMARY_CHANGEDACC.EVENT_TEXT_ATTRIBUTE_CHANGEDACC.EVENT_TEXT_CARET_MOVEDACC.EVENT_TEXT_CHANGEDACC.EVENT_TEXT_COLUMN_CHANGEDACC.EVENT_TEXT_SELECTION_CHANGEDACC.EVENT_VALUE_CHANGED
-
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
-
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
-
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_INSERTorACC.TEXT_DELETEstartIndex- 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
- 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
-
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
-
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. -
internal_WM_GETOBJECT
public int internal_WM_GETOBJECT(int wParam, int 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.
-