1 /*******************************************************************************
2 * Copyright (c) 2009, 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>AccessibleActionListener</code> interface.
20 * Classes that wish to deal with <code>AccessibleAction</code> events can
21 * extend this class and override only the methods that they are
25 * @see AccessibleActionListener
26 * @see AccessibleActionEvent
30 public class AccessibleActionAdapter implements AccessibleActionListener {
32 * Returns the number of accessible actions available in this object.
34 * If there are more than one, the first one (index 0) is considered the
35 * "default" action of the object.
38 * @param e an event object containing the following fields:<ul>
39 * <li>[out] count - the number of actions, or zero if there are no actions</li>
43 public void getActionCount(AccessibleActionEvent e) {}
46 * Performs the specified action on the object.
48 * @param e an event object containing the following fields:<ul>
49 * <li>[in] index - a 0 based index specifying the action to perform.
50 * If the index lies outside the valid range no action is performed.</li>
51 * <li>[out] result - set to {@link ACC#OK} if the action was performed.</li>
55 public void doAction(AccessibleActionEvent e) {}
58 * Returns a description of the specified action.
60 * @param e an event object containing the following fields:<ul>
61 * <li>[in] index - a 0 based index specifying which action's description to return</li>
62 * <li>[out] result - a localized string describing the specified action,
63 * or null if the index lies outside the valid range</li>
67 public void getDescription(AccessibleActionEvent e) {}
70 * Returns a string representing one or more key bindings, if there
71 * are any, associated with the specified action.
73 * The returned string is of the following form: mnemonic;accelerator
74 * for example: "C;CTRL+C" for the Copy item in a typical Edit menu.
77 * @param e an event object containing the following fields:<ul>
78 * <li>[in] index - a 0 based index specifying which action's key bindings to return</li>
79 * <li>[out] result - a semicolon-delimited string of localized key bindings
80 * (example: "C;CTRL+C"), or null if the index lies outside the valid range</li>
84 public void getKeyBinding(AccessibleActionEvent e) {}
87 * Returns the name of the specified action.
89 * There is no need to implement this method for single action controls
90 * since that would be redundant with AccessibleControlListener.getDefaultAction.
93 * @param e an event object containing the following fields:<ul>
94 * <li>[in] index - a 0 based index specifying which action's name to return</li>
95 * <li>[in] localized - a boolean indicating whether or not to return a localized name</li>
96 * <li>[out] result - the name of the specified action,
97 * or null if the index lies outside the valid range</li>
101 public void getName(AccessibleActionEvent e) {}