001: /*******************************************************************************
002: * Copyright (c) 2000, 2003 IBM Corporation and others.
003: * All rights reserved. This program and the accompanying materials
004: * are made available under the terms of the Eclipse Public License v1.0
005: * which accompanies this distribution, and is available at
006: * http://www.eclipse.org/legal/epl-v10.html
007: *
008: * Contributors:
009: * IBM Corporation - initial API and implementation
010: *******************************************************************************/package org.eclipse.swt.accessibility;
011:
012: /**
013: * This adapter class provides default implementations for the
014: * methods described by the <code>AccessibleListener</code> interface.
015: * <p>
016: * Classes that wish to deal with <code>AccessibleEvent</code>s can
017: * extend this class and override only the methods that they are
018: * interested in.
019: * </p><p>
020: * Note: Accessibility clients use child identifiers to specify
021: * whether they want information about a control or one of its children.
022: * Child identifiers are increasing integers beginning with 0.
023: * The identifier CHILDID_SELF represents the control itself.
024: * </p>
025: *
026: * @see AccessibleListener
027: * @see AccessibleEvent
028: *
029: * @since 2.0
030: */
031: public abstract class AccessibleAdapter implements AccessibleListener {
032:
033: /**
034: * Sent when an accessibility client requests the name
035: * of the control, or the name of a child of the control.
036: * The default behavior is to do nothing.
037: * <p>
038: * Return the name of the control or specified child in the
039: * <code>result</code> field of the event object. Returning
040: * an empty string tells the client that the control or child
041: * does not have a name, and returning null tells the client
042: * to use the platform name.
043: * </p>
044: *
045: * @param e an event object containing the following fields:<ul>
046: * <li>childID [IN] - an identifier specifying the control or one of its children</li>
047: * <li>result [OUT] - the requested name string, or null</li>
048: * </ul>
049: */
050: public void getName(AccessibleEvent e) {
051: }
052:
053: /**
054: * Sent when an accessibility client requests the help string
055: * of the control, or the help string of a child of the control.
056: * The default behavior is to do nothing.
057: * <p>
058: * The information in this property should be similar to the help
059: * provided by toolTipText. It describes what the control or child
060: * does or how to use it, as opposed to getDescription, which
061: * describes appearance.
062: * </p><p>
063: * Return the help string of the control or specified child in
064: * the <code>result</code> field of the event object. Returning
065: * an empty string tells the client that the control or child
066: * does not have a help string, and returning null tells the
067: * client to use the platform help string.
068: * </p>
069: *
070: * @param e an event object containing the following fields:<ul>
071: * <li>childID [IN] - an identifier specifying the control or one of its children</li>
072: * <li>result [OUT] - the requested help string, or null</li>
073: * </ul>
074: */
075: public void getHelp(AccessibleEvent e) {
076: }
077:
078: /**
079: * Sent when an accessibility client requests the keyboard shortcut
080: * of the control, or the keyboard shortcut of a child of the control.
081: * The default behavior is to do nothing.
082: * <p>
083: * A keyboard shortcut can either be a mnemonic, or an accelerator.
084: * As a general rule, if the control or child can receive keyboard focus,
085: * then you should expose its mnemonic, and if it cannot receive keyboard
086: * focus, then you should expose its accelerator.
087: * </p><p>
088: * Return the keyboard shortcut string of the control or specified child
089: * in the <code>result</code> field of the event object. Returning an
090: * empty string tells the client that the control or child does not
091: * have a keyboard shortcut string, and returning null tells the client
092: * to use the platform keyboard shortcut string.
093: * </p>
094: *
095: * @param e an event object containing the following fields:<ul>
096: * <li>childID [IN] - an identifier specifying the control or one of its children</li>
097: * <li>result [OUT] - the requested keyboard shortcut string (example: "ALT+N"), or null</li>
098: * </ul>
099: */
100: public void getKeyboardShortcut(AccessibleEvent e) {
101: }
102:
103: /**
104: * Sent when an accessibility client requests a description
105: * of the control, or a description of a child of the control.
106: * The default behavior is to do nothing.
107: * <p>
108: * This is a textual description of the control or child's visual
109: * appearance, which is typically only necessary if it cannot be
110: * determined from other properties such as role.
111: * </p><p>
112: * Return the description of the control or specified child in
113: * the <code>result</code> field of the event object. Returning
114: * an empty string tells the client that the control or child
115: * does not have a description, and returning null tells the
116: * client to use the platform description.
117: * </p>
118: *
119: * @param e an event object containing the following fields:<ul>
120: * <li>childID [IN] - an identifier specifying the control or one of its children</li>
121: * <li>result [OUT] - the requested description string, or null</li>
122: * </ul>
123: */
124: public void getDescription(AccessibleEvent e) {
125: }
126: }
|