KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > swt > accessibility > AccessibleControlAdapter


1 /*******************************************************************************
2  * Copyright (c) 2000, 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.swt.accessibility;
12
13
14 /**
15  * This adapter class provides default implementations for the
16  * methods described by the <code>AccessibleControlListener</code> interface.
17  * <p>
18  * Classes that wish to deal with <code>AccessibleControlEvent</code>s can
19  * extend this class and override only the methods that they are
20  * interested in.
21  * </p><p>
22  * Note: Accessibility clients use child identifiers to specify
23  * whether they want information about a control or one of its children.
24  * Child identifiers are increasing integers beginning with 0.
25  * The identifier CHILDID_SELF represents the control itself.
26  * When returning a child identifier to a client, you may use CHILDID_NONE
27  * to indicate that no child or control has the required information.
28  * </p><p>
29  * Note: This adapter is typically used by implementors of
30  * a custom control to provide very detailed information about
31  * the control instance to accessibility clients.
32  * </p>
33  *
34  * @see AccessibleControlListener
35  * @see AccessibleControlEvent
36  *
37  * @since 2.0
38  */

39 public abstract class AccessibleControlAdapter implements AccessibleControlListener {
40
41     /**
42      * Sent when an accessibility client requests the identifier
43      * of the control child at the specified display coordinates.
44      * The default behavior is to do nothing.
45      * <p>
46      * Return the identifier of the child at display point (x, y)
47      * in the <code>childID</code> field of the event object.
48      * Return CHILDID_SELF if point (x, y) is in the control itself
49      * and not in any child. Return CHILDID_NONE if point (x, y)
50      * is not contained in either the control or any of its children.
51      * </p>
52      *
53      * @param e an event object containing the following fields:<ul>
54      * <li>x, y [IN] - the specified point in display coordinates</li>
55      * <li>childID [Typical OUT] - the ID of the child at point, or CHILDID_SELF, or CHILDID_NONE</li>
56      * <li>accessible [Optional OUT] - the accessible object for the control or child may be returned instead of the childID</li>
57      * </ul>
58      */

59     public void getChildAtPoint(AccessibleControlEvent e) {
60     }
61     
62     /**
63      * Sent when an accessibility client requests the location
64      * of the control, or the location of a child of the control.
65      * The default behavior is to do nothing.
66      * <p>
67      * Return a rectangle describing the location of the specified
68      * control or child in the <code>x, y, width, and height</code>
69      * fields of the event object.
70      * </p>
71      *
72      * @param e an event object containing the following fields:<ul>
73      * <li>childID [IN] - an identifier specifying the control or one of its children</li>
74      * <li>x, y, width, height [OUT] - the control or child location in display coordinates</li>
75      * </ul>
76      */

77     public void getLocation(AccessibleControlEvent e) {
78     }
79     
80     /**
81      * Sent when an accessibility client requests the accessible object
82      * for a child of the control.
83      * The default behavior is to do nothing.
84      * <p>
85      * Return an <code>Accessible</code> for the specified control or
86      * child in the <code>accessible</code> field of the event object.
87      * Return null if the specified child does not have its own
88      * <code>Accessible</code>.
89      * </p>
90      *
91      * @param e an event object containing the following fields:<ul>
92      * <li>childID [IN] - an identifier specifying a child of the control</li>
93      * <li>accessible [OUT] - an Accessible for the specified childID, or null if one does not exist</li>
94      * </ul>
95      */

96     public void getChild(AccessibleControlEvent e) {
97     }
98     
99     /**
100      * Sent when an accessibility client requests the number of
101      * children in the control.
102      * The default behavior is to do nothing.
103      * <p>
104      * Return the number of child items in the <code>detail</code>
105      * field of the event object.
106      * </p>
107      *
108      * @param e an event object containing the following fields:<ul>
109      * <li>detail [OUT] - the number of child items in this control</li>
110      * </ul>
111      */

112     public void getChildCount(AccessibleControlEvent e) {
113     }
114     
115     /**
116      * Sent when an accessibility client requests the default action
117      * of the control, or the default action of a child of the control.
118      * The default behavior is to do nothing.
119      * <p>
120      * This string is typically a verb describing what the user does to it.
121      * For example, a Push Button's default action is "Press", a Check Button's
122      * is "Check" or "UnCheck", and List items have the default action "Double Click".
123      * </p><p>
124      * Return a string describing the default action of the specified
125      * control or child in the <code>result</code> field of the event object.
126      * Returning null tells the client to use the platform default action string.
127      * </p>
128      *
129      * @param e an event object containing the following fields:<ul>
130      * <li>childID [IN] - an identifier specifying the control or one of its children</li>
131      * <li>result [OUT] - the requested default action string, or null</li>
132      * </ul>
133      */

134     public void getDefaultAction(AccessibleControlEvent e) {
135     }
136     
137     /**
138      * Sent when an accessibility client requests the identity of
139      * the child or control that has keyboard focus.
140      * The default behavior is to do nothing.
141      * <p>
142      * Return the identifier of the child that has focus in the
143      * <code>childID</code> field of the event object.
144      * Return CHILDID_SELF if the control itself has keyboard focus.
145      * Return CHILDID_NONE if neither the control nor any of its children has focus.
146      * </p>
147      *
148      * @param e an event object containing the following fields:<ul>
149      * <li>childID [Typical OUT] - the ID of the child with focus, or CHILDID_SELF, or CHILDID_NONE</li>
150      * <li>accessible [Optional OUT] - the accessible object for a child may be returned instead of its childID</li>
151      * </ul>
152      */

153     public void getFocus(AccessibleControlEvent e) {
154     }
155     
156     /**
157      * Sent when an accessibility client requests the role
158      * of the control, or the role of a child of the control.
159      * The default behavior is to do nothing.
160      * <p>
161      * Return a role constant (constant defined in ACC beginning with ROLE_)
162      * that describes the role of the specified control or child in the
163      * <code>detail</code> field of the event object.
164      * </p>
165      *
166      * @param e an event object containing the following fields:<ul>
167      * <li>childID [IN] - an identifier specifying the control or one of its children</li>
168      * <li>detail [OUT] - a role constant describing the role of the control or child</li>
169      * </ul>
170      */

171     public void getRole(AccessibleControlEvent e) {
172     }
173     
174     /**
175      * Sent when an accessibility client requests the identity of
176      * the child or control that is currently selected.
177      * The default behavior is to do nothing.
178      * <p>
179      * Return the identifier of the selected child in the
180      * <code>childID</code> field of the event object.
181      * Return CHILDID_SELF if the control itself is selected.
182      * Return CHILDID_MULTIPLE if multiple children are selected, and return an array of childIDs in the <code>children</code> field.
183      * Return CHILDID_NONE if neither the control nor any of its children are selected.
184      * </p>
185      *
186      * @param e an event object containing the following fields:<ul>
187      * <li>childID [Typical OUT] - the ID of the selected child, or CHILDID_SELF, or CHILDID_MULTIPLE, or CHILDID_NONE</li>
188      * <li>accessible [Optional OUT] - the accessible object for the control or child may be returned instead of the childID</li>
189      * </ul>
190      */

191     public void getSelection(AccessibleControlEvent e) {
192     }
193     
194     /**
195      * Sent when an accessibility client requests the state
196      * of the control, or the state of a child of the control.
197      * The default behavior is to do nothing.
198      * <p>
199      * Return a state mask (mask bit constants defined in ACC beginning with STATE_)
200      * that describes the current state of the specified control or child in the
201      * <code>detail</code> field of the event object.
202      * </p>
203      *
204      * @param e an event object containing the following fields:<ul>
205      * <li>childID [IN] - an identifier specifying the control or one of its children</li>
206      * <li>detail [OUT] - a state mask describing the current state of the control or child</li>
207      * </ul>
208      */

209     public void getState(AccessibleControlEvent e) {
210     }
211     
212     /**
213      * Sent when an accessibility client requests the value
214      * of the control, or the value of a child of the control.
215      * The default behavior is to do nothing.
216      * <p>
217      * Many controls do not return a value. Examples of controls
218      * that do are: Combo returns the text string, Text returns
219      * its contents, ProgressBar returns a string representing a
220      * percentage, and Tree items return a string representing
221      * their level in the tree.
222      * </p><p>
223      * Return a string describing the value of the specified control
224      * or child in the <code>result</code> field of the event object.
225      * Returning null tells the client to use the platform value string.
226      * </p>
227      *
228      * @param e an event object containing the following fields:<ul>
229      * <li>childID [IN] - an identifier specifying the control or one of its children</li>
230      * <li>result [OUT] - the requested value string, or null</li>
231      * </ul>
232      */

233     public void getValue(AccessibleControlEvent e) {
234     }
235     
236     /**
237      * Sent when an accessibility client requests the children of the control.
238      * The default behavior is to do nothing.
239      * <p>
240      * Return the children as an array of childIDs in the <code>children</code>
241      * field of the event object.
242      * </p>
243      *
244      * @param e an event object containing the following fields:<ul>
245      * <li>children [Typical OUT] - an array of childIDs</li>
246      * <li>accessible [Optional OUT] - an array of accessible objects for the children may be returned instead of the childIDs</li>
247      * </ul>
248      */

249     public void getChildren(AccessibleControlEvent e) {
250     }
251 }
252
Popular Tags