KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*******************************************************************************
2  * Copyright (c) 2000, 2003 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 import org.eclipse.swt.internal.SWTEventListener;
15
16 /**
17  * Classes that implement this interface provide methods
18  * that deal with the events that are generated when an
19  * accessibility client sends a message to a control.
20  * <p>
21  * After creating an instance of a class that implements
22  * this interface it can be added to a control using the
23  * <code>addAccessibleListener</code> method and removed
24  * using the <code>removeAccessibleListener</code> method.
25  * When a client requests information, the appropriate method
26  * will be invoked.
27  * </p><p>
28  * Note: Accessibility clients use child identifiers to specify
29  * whether they want information about a control or one of its children.
30  * Child identifiers are increasing integers beginning with 0.
31  * The identifier CHILDID_SELF represents the control itself.
32  * </p>
33  *
34  * @see AccessibleAdapter
35  * @see AccessibleEvent
36  *
37  * @since 2.0
38  */

39 public interface AccessibleListener extends SWTEventListener {
40
41     /**
42      * Sent when an accessibility client requests the name
43      * of the control, or the name of a child of the control.
44      * <p>
45      * Return the name of the control or specified child in the
46      * <code>result</code> field of the event object. Returning
47      * an empty string tells the client that the control or child
48      * does not have a name, and returning null tells the client
49      * to use the platform name.
50      * </p>
51      *
52      * @param e an event object containing the following fields:<ul>
53      * <li>childID [IN] - an identifier specifying the control or one of its children</li>
54      * <li>result [OUT] - the requested name string, or null</li>
55      * </ul>
56      */

57     public void getName(AccessibleEvent e);
58
59     /**
60      * Sent when an accessibility client requests the help string
61      * of the control, or the help string of a child of the control.
62      * <p>
63      * The information in this property should be similar to the help
64      * provided by toolTipText. It describes what the control or child
65      * does or how to use it, as opposed to getDescription, which
66      * describes appearance.
67      * </p><p>
68      * Return the help string of the control or specified child in
69      * the <code>result</code> field of the event object. Returning
70      * an empty string tells the client that the control or child
71      * does not have a help string, and returning null tells the
72      * client to use the platform help string.
73      * </p>
74      *
75      * @param e an event object containing the following fields:<ul>
76      * <li>childID [IN] - an identifier specifying the control or one of its children</li>
77      * <li>result [OUT] - the requested help string, or null</li>
78      * </ul>
79      */

80     public void getHelp(AccessibleEvent e);
81
82     /**
83      * Sent when an accessibility client requests the keyboard shortcut
84      * of the control, or the keyboard shortcut of a child of the control.
85      * <p>
86      * A keyboard shortcut can either be a mnemonic, or an accelerator.
87      * As a general rule, if the control or child can receive keyboard focus,
88      * then you should expose its mnemonic, and if it cannot receive keyboard
89      * focus, then you should expose its accelerator.
90      * </p><p>
91      * Return the keyboard shortcut string of the control or specified child
92      * in the <code>result</code> field of the event object. Returning an
93      * empty string tells the client that the control or child does not
94      * have a keyboard shortcut string, and returning null tells the client
95      * to use the platform keyboard shortcut string.
96      * </p>
97      *
98      * @param e an event object containing the following fields:<ul>
99      * <li>childID [IN] - an identifier specifying the control or one of its children</li>
100      * <li>result [OUT] - the requested keyboard shortcut string (example: "ALT+N"), or null</li>
101      * </ul>
102      */

103     public void getKeyboardShortcut(AccessibleEvent e);
104
105     /**
106      * Sent when an accessibility client requests a description
107      * of the control, or a description of a child of the control.
108      * <p>
109      * This is a textual description of the control or child's visual
110      * appearance, which is typically only necessary if it cannot be
111      * determined from other properties such as role.
112      * </p><p>
113      * Return the description of the control or specified child in
114      * the <code>result</code> field of the event object. Returning
115      * an empty string tells the client that the control or child
116      * does not have a description, and returning null tells the
117      * client to use the platform description.
118      * </p>
119      *
120      * @param e an event object containing the following fields:<ul>
121      * <li>childID [IN] - an identifier specifying the control or one of its children</li>
122      * <li>result [OUT] - the requested description string, or null</li>
123      * </ul>
124      */

125     public void getDescription(AccessibleEvent e);
126 }
127
Popular Tags