01: /*******************************************************************************
02: * Copyright (c) 2000, 2006 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: *******************************************************************************/package org.eclipse.ui.tests.internal.util;
11:
12: import java.util.ArrayList;
13:
14: public class AccessibilityTestPass implements IDialogTestPass {
15: private static final int CHECKLIST_SIZE = 5;
16:
17: /**
18: * @see IDialogTestPass#title()
19: */
20: public String title() {
21: return "Test Pass: Accessibility";
22: }
23:
24: /**
25: * @see IDialogTestPass#description()
26: */
27: public String description() {
28: return "Verify the accessibility of the dialogs.";
29: }
30:
31: /**
32: * @see IDialogTestPass#label()
33: */
34: public String label() {
35: return "&Accessibility";
36: }
37:
38: /**
39: * @see IDialogTestPass#checkListTexts()
40: */
41: public ArrayList checkListTexts() {
42: ArrayList list = new ArrayList(CHECKLIST_SIZE);
43: list.add("&1) all widgets are accessible by tabbing.");
44: list
45: .add("&2) forwards and backwards tabbing is in a logical order");
46: list
47: .add("&3) all the widgets with labels have an appropriate mnemonic.");
48: list.add("&4) there are no duplicate mnemonics.");
49: list
50: .add("&5) selectable widgets can be selected using the spacebar.");
51: return list;
52: }
53:
54: /**
55: * @see IDialogTestPass#failureTexts()
56: * Size of the return array must be the same size as the checkListTexts'
57: * ArrayList.
58: */
59: public String[] failureTexts() {
60: String[] failureText = new String[CHECKLIST_SIZE];
61: failureText[0] = "Some widgets aren't accessible by tabbing.";
62: failureText[1] = "Tabbing order is illogical.";
63: failureText[2] = "Missing or inappropriate mnemonics.";
64: failureText[3] = "Duplicate mnemonics.";
65: failureText[4] = "Some widgets cannot be selected using the spacebar.";
66: return failureText;
67: }
68:
69: /**
70: * @see IDialogTestPass#queryText()
71: */
72: public String queryText() {
73: return "Is the accessibility of the dialog acceptable?";
74: }
75:
76: /**
77: * @see IDialogTestPass#getID()
78: */
79: public int getID() {
80: return VerifyDialog.TEST_ACCESS;
81: }
82: }
|