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>AccessibleTextListener</code> interface.
21 * Classes that wish to deal with <code>AccessibleTextEvent</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.
29 * When returning a child identifier to a client, you may use CHILDID_NONE
30 * to indicate that no child or control has the required information.
32 * Note: This adapter is typically used by implementors of
33 * a custom control to provide very detailed information about
34 * the control instance to accessibility clients.
37 * @see AccessibleTextListener
38 * @see AccessibleTextEvent
39 * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
43 public abstract class AccessibleTextAdapter implements AccessibleTextListener {
46 * Sent when an accessibility client requests the current character offset
48 * The default behavior is to do nothing.
50 * Return the caret offset in the <code>offset</code>
51 * field of the event object.
54 * @param e an event object containing the following fields:<ul>
55 * <li>childID [IN] - an identifier specifying a child of the control</li>
56 * <li>offset [OUT] - the current offset of the text caret</li>
60 public void getCaretOffset (AccessibleTextEvent e) {
64 * Sent when an accessibility client requests the range of the current
66 * The default behavior is to do nothing.
68 * Return the selection start offset and non-negative length in the
69 * <code>offset</code> and <code>length</code> fields of the event object.
72 * @param e an event object containing the following fields:<ul>
73 * <li>childID [IN] - an identifier specifying a child of the control</li>
74 * <li>offset [OUT] - the offset of the current text selection</li>
75 * <li>length [OUT] - the length of the current text selection</li>
79 public void getSelectionRange (AccessibleTextEvent e) {