01: /*******************************************************************************
02: * Copyright (c) 2000, 2005 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.jdt.testplugin.util;
11:
12: import java.util.ArrayList;
13:
14: /*
15: * This test pass verifies the initial focus of a dialog
16: * when it is given focus.
17: */
18: public class FocusTestPass implements IDialogTestPass {
19: private static final int CHECKLIST_SIZE = 1;
20:
21: /**
22: * @see IDialogTestPass#title()
23: */
24: public String title() {
25: return "Test Pass: Initial Focus";
26: }
27:
28: /**
29: * @see IDialogTestPass#description()
30: */
31: public String description() {
32: return "Verify the initial focus of the dialogs.";
33: }
34:
35: /**
36: * @see IDialogTestPass#label()
37: */
38: public String label() {
39: return "&Initial Focus";
40: }
41:
42: /**
43: * @see IDialogTestPass#checkListTexts()
44: */
45: public ArrayList checkListTexts() {
46: ArrayList list = new ArrayList(CHECKLIST_SIZE);
47: list.add("&1) the initial focus is appropriate.");
48: return list;
49: }
50:
51: /**
52: * @see IDialogTestPass#failureTexts()
53: * Size of the return array must be the same size as the checkListTexts'
54: * ArrayList.
55: */
56: public String[] failureTexts() {
57: String[] failureText = new String[CHECKLIST_SIZE];
58: failureText[0] = "The initial focus is inappropriate.";
59: return failureText;
60: }
61:
62: /**
63: * @see IDialogTestPass#queryText()
64: */
65: public String queryText() {
66: return "Is the initial focus of the dialog correct?";
67: }
68:
69: /**
70: * @see IDialogTestPass#getID()
71: */
72: public int getID() {
73: return VerifyDialog.TEST_FOCUS;
74: }
75: }
|