/* * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2021, JetBrains s.r.o.. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions.
*/
if (!testResult) { thrownew RuntimeException(a11yTest.exceptionString);
}
}
@java.lang.Override public CountDownLatch createCountDownLatch() { returnnew CountDownLatch(1);
}
publicvoid createSimpleList() {
INSTRUCTIONS = "INSTRUCTIONS:\n"
+ "Check a11y of JList.\n\n"
+ "Turn screen reader on, and Tab to the list.\n"
+ "Press the up and down arrow buttons to move through the list.\n\n"
+ "If you can hear menu items tab further and press PASS, otherwise press FAIL.\n";
JPanel frame = new JPanel();
JList<String> list = new JList<>(NAMES);
frame.setLayout(new FlowLayout());
frame.add(list);
exceptionString = "Accessible JList simple list test failed!"; super.createUI(frame, "Accessible JList test");
}
publicvoid createSimpleListRenderer() {
INSTRUCTIONS = "INSTRUCTIONS:\n"
+ "Check a11y of JList with renderer.\n\n"
+ "Turn screen reader on, and Tab to the list.\n"
+ "Press the up and down arrow buttons to move through the list.\n\n"
+ "If you can hear menu items tab further and press PASS, otherwise press FAIL.\n";
JPanel frame = new JPanel();
JList<String> list = new JList<>(NAMES);
list.setCellRenderer(new AccessibleJListTestRenderer());
frame.setLayout(new FlowLayout());
frame.add(list);
exceptionString = "Accessible JList with renderer simple list test failed!"; super.createUI(frame, "Accessible JList test");
}
publicvoid createSimpleListNamed() {
INSTRUCTIONS = "INSTRUCTIONS:\n"
+ "Check a11y of named JList.\n\n"
+ "Turn screen reader on, and Tab to the list.\n"
+ "Press the tab button to move to second list.\n\n"
+ "If you can hear second list name: \"second list\" - tab further and press PASS, otherwise press FAIL.\n";
JPanel frame = new JPanel();
JList<String> list = new JList<>(NAMES);
JList<String> secondList = new JList<>(NAMES);
secondList.getAccessibleContext().setAccessibleName("Second list");
frame.setLayout(new FlowLayout());
frame.add(list);
frame.add(secondList);
exceptionString = "Accessible JList simple list named test failed!"; super.createUI(frame, "Accessible JList test");
}
publicvoid createCombobox() {
INSTRUCTIONS = "INSTRUCTIONS:\n"
+ "Check a11y of JList in a combobox.\n\n"
+ "Turn screen reader on, and Tab to the combobox.\n"
+ "Press the up and down arrow buttons to move through the list.\n\n"
+ "If you can hear combobox items tab further and press PASS, otherwise press FAIL.\n";
publicvoid createPushButton() {
INSTRUCTIONS = "INSTRUCTIONS:\n"
+ "Check a11y of JList in a popup in a simple window.\n\n"
+ "Turn screen reader on, and Tab to the show button and press space.\n"
+ "Press the up and down arrow buttons to move through the list.\n\n"
+ "If you can hear popup menu items tab further and press PASS, otherwise press FAIL.\n";
JPanel frame = new JPanel();
JButton button = new JButton("show");
button.setPreferredSize(new Dimension(100, 35));
frame.setLayout(new FlowLayout());
frame.add(button);
exceptionString = "Accessible JList push button with simple window test failed!"; super.createUI(frame, "Accessible JList test");
}
publicvoid createPushButtonHeavyWeight() {
INSTRUCTIONS = "INSTRUCTIONS:\n"
+ "Check a11y of JList in a popup in a heavy weight window.\n\n"
+ "Turn screen reader on, and Tab to the show button and press space.\n"
+ "Press the up and down arrow buttons to move through the list.\n\n"
+ "If you can hear popup menu items tab further and press PASS, otherwise press FAIL.\n";
JPanel frame = new JPanel();
JButton button = new JButton("show");
button.setPreferredSize(new Dimension(100, 35));
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.