1 /*******************************************************************************
2 * Copyright (c) 2010, 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;
17 * This adapter class provides default implementations for the
18 * methods in the <code>AccessibleEditableTextListener</code> interface.
20 * Classes that wish to deal with <code>AccessibleEditableText</code> events can
21 * extend this class and override only the methods that they are
25 * @see AccessibleEditableTextListener
26 * @see AccessibleEditableTextEvent
27 * @see AccessibleTextAttributeEvent
31 public class AccessibleEditableTextAdapter implements AccessibleEditableTextListener {
33 * Copies the substring beginning at the specified <code>start</code> offset
34 * and extending to the character at offset <code>end - 1</code> to the clipboard.
36 * @param e an event object containing the following information:<ul>
37 * <li>[in] start - the 0 based offset of the first character of the substring
38 * to be copied to the clipboard</li>
39 * <li>[in] end - the 0 based offset after the last character of the substring
40 * to be copied to the clipboard</li>
41 * <li>[out] result - set to {@link ACC#OK} if the operation was completed successfully</li>
45 public void copyText(AccessibleEditableTextEvent e) {}
48 * Moves the substring beginning at the specified <code>start</code> offset
49 * and extending to the character at offset <code>end - 1</code> to the clipboard.
51 * @param e an event object containing the following information:<ul>
52 * <li>[in] start - the 0 based offset of the first character of the substring
53 * to be moved to the clipboard</li>
54 * <li>[in] end - the 0 based offset after the last character of the substring
55 * to be moved to the clipboard</li>
56 * <li>[out] result - set to {@link ACC#OK} if the operation was completed successfully</li>
60 public void cutText(AccessibleEditableTextEvent e) {}
63 * Inserts the text in the clipboard at the leading edge of the specified <code>start</code> offset.
65 * @param e an event object containing the following information:<ul>
66 * <li>[in] start - the offset at which to insert the text from the clipboard.
67 * The valid range is 0..length</li>
68 * <li>[out] result - set to {@link ACC#OK} if the operation was completed successfully</li>
72 public void pasteText(AccessibleEditableTextEvent e) {}
75 * Replaces the substring beginning at the specified <code>start</code> offset
76 * and extending to the character at offset <code>end - 1</code> by the specified string.
78 * This event notification is also used to delete text if <code>string</code> is an empty string,
79 * or to insert text at the leading edge of the specified offset if <code>start</code> and <code>end</code> are equal.
82 * @param e an event object containing the following information:<ul>
83 * <li>[in] start - the 0 based offset of the first character of the substring
85 * <li>[in] end - the 0 based offset after the last character of the substring
87 * <li>[in] string - the string that replaces the substring beginning at
88 * <code>start</code> and extending to <code>end - 1</code></li>
89 * <li>[out] result - set to {@link ACC#OK} if the operation was completed successfully</li>
93 public void replaceText(AccessibleEditableTextEvent e) {}
96 * Replaces the set of attributes of the substring beginning at the specified <code>start</code> offset
97 * and extending to the character at offset <code>end - 1</code> by the specified set of attributes.
99 * @param e an event object containing the following information:<ul>
100 * <li>[in] start - the 0 based offset of the first character of the substring
101 * whose attributes are modified</li>
102 * <li>[in] end - the 0 based offset after the last character of the substring
103 * whose attributes are modified</li>
104 * <li>[in] textStyle - the TextStyle which contains attributes that replace the old set of attributes.
105 * The foreground, background, and font fields of this TextStyle are only valid for the duration of the event.
106 * The value of this field may be null if none of the attributes to be set correspond to TextStyle fields.</li>
107 * <li>[in] attributes - an array of alternating key and value Strings that represent the complete
108 * set of attributes to replace the old set of attributes.
109 * The value of this field may be null if no attributes are to be set.</li>
110 * <li>[out] result - set to {@link ACC#OK} if the operation was completed successfully</li>
114 public void setTextAttributes(AccessibleTextAttributeEvent e) {}