1 /*******************************************************************************
2 * Copyright (c) 2000, 2016 IBM Corporation and others.
4 * This program and the accompanying materials
5 * are made available under the terms of the Eclipse Public License 2.0
6 * which accompanies this distribution, and is available at
7 * https://www.eclipse.org/legal/epl-2.0/
9 * SPDX-License-Identifier: EPL-2.0
12 * IBM Corporation - initial API and implementation
13 *******************************************************************************/
14 package org.eclipse.swt.accessibility;
18 * This adapter class provides default implementations for the
19 * methods described by the <code>AccessibleListener</code> interface.
21 * Classes that wish to deal with <code>AccessibleEvent</code>s can
22 * extend this class and override only the methods that they are
25 * Note: Accessibility clients use child identifiers to specify
26 * whether they want information about a control or one of its children.
27 * Child identifiers are increasing integers beginning with 0.
28 * The identifier CHILDID_SELF represents the control itself.
31 * @see AccessibleListener
32 * @see AccessibleEvent
33 * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
37 public abstract class AccessibleAdapter implements AccessibleListener {
40 * Sent when an accessibility client requests the name
41 * of the control, or the name of a child of the control.
42 * The default behavior is to do nothing.
44 * Return the name of the control or specified child in the
45 * <code>result</code> field of the event object. Returning
46 * an empty string tells the client that the control or child
47 * does not have a name, and returning null tells the client
48 * to use the platform name.
51 * @param e an event object containing the following fields:<ul>
52 * <li>childID [IN] - an identifier specifying the control or one of its children</li>
53 * <li>result [OUT] - the requested name string, or null</li>
57 public void getName(AccessibleEvent e) {
61 * Sent when an accessibility client requests the help string
62 * of the control, or the help string of a child of the control.
63 * The default behavior is to do nothing.
65 * The information in this property should be similar to the help
66 * provided by toolTipText. It describes what the control or child
67 * does or how to use it, as opposed to getDescription, which
68 * describes appearance.
70 * Return the help string of the control or specified child in
71 * the <code>result</code> field of the event object. Returning
72 * an empty string tells the client that the control or child
73 * does not have a help string, and returning null tells the
74 * client to use the platform help string.
77 * @param e an event object containing the following fields:<ul>
78 * <li>childID [IN] - an identifier specifying the control or one of its children</li>
79 * <li>result [OUT] - the requested help string, or null</li>
83 public void getHelp(AccessibleEvent e) {
87 * Sent when an accessibility client requests the keyboard shortcut
88 * of the control, or the keyboard shortcut of a child of the control.
89 * The default behavior is to do nothing.
91 * A keyboard shortcut can either be a mnemonic, or an accelerator.
92 * As a general rule, if the control or child can receive keyboard focus,
93 * then you should expose its mnemonic, and if it cannot receive keyboard
94 * focus, then you should expose its accelerator.
96 * Return the keyboard shortcut string of the control or specified child
97 * in the <code>result</code> field of the event object. Returning an
98 * empty string tells the client that the control or child does not
99 * have a keyboard shortcut string, and returning null tells the client
100 * to use the platform keyboard shortcut string.
103 * @param e an event object containing the following fields:<ul>
104 * <li>childID [IN] - an identifier specifying the control or one of its children</li>
105 * <li>result [OUT] - the requested keyboard shortcut string (example: "ALT+N"), or null</li>
109 public void getKeyboardShortcut(AccessibleEvent e) {
113 * Sent when an accessibility client requests a description
114 * of the control, or a description of a child of the control.
115 * The default behavior is to do nothing.
117 * This is a textual description of the control or child's visual
118 * appearance, which is typically only necessary if it cannot be
119 * determined from other properties such as role.
121 * Return the description of the control or specified child in
122 * the <code>result</code> field of the event object. Returning
123 * an empty string tells the client that the control or child
124 * does not have a description, and returning null tells the
125 * client to use the platform description.
128 * @param e an event object containing the following fields:<ul>
129 * <li>childID [IN] - an identifier specifying the control or one of its children</li>
130 * <li>result [OUT] - the requested description string, or null</li>
134 public void getDescription(AccessibleEvent e) {