/* * 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.
*/
@Override public CountDownLatch createCountDownLatch() { returnnew CountDownLatch(1);
}
publicvoid createUI() {
INSTRUCTIONS = "INSTRUCTIONS:\n"
+ "Check a11y of JTable.\n\n"
+ "Turn screen reader on, and Tab to the table.\n"
+ "On Windows press the arrow buttons to move through the table.\n\n"
+ "On MacOS, use the up and down arrow buttons to move through rows, and VoiceOver fast navigation to move through columns.\n\n"
+ "If you can hear table cells ctrl+tab further and press PASS, otherwise press FAIL.\n";
JTable table = new JTable(data, columnNames);
JPanel panel = new JPanel();
panel.setLayout(new FlowLayout());
JScrollPane scrollPane = new JScrollPane(table);
panel.add(scrollPane);
panel.setFocusable(false);
exceptionString = "AccessibleJTable test failed!"; super.createUI(panel, "AccessibleJTableTest");
}
publicvoid createUIDraggable() {
INSTRUCTIONS = "INSTRUCTIONS:\n"
+ "Check that table is properly updated when column order is changed.\n\n"
+ "Turn screen reader on, and Tab to the table.\n"
+ "Using arrow keys navigate to the last cell in the first row in the table."
+ "Screen reader should announce it as \"Column 3 row 1\"\n\n"
+ "Using mouse drag the header of the last culumn so the last column becomes the first one."
+ "Wait for the screen reader to finish announcing new position in table.\n\n"
+ "If new position in table corresponds to the new table layout ctrl+tab further "
+ "and press PASS, otherwise press FAIL.\n";
JTable table = new JTable(data, columnNames);
JPanel panel = new JPanel();
panel.setLayout(new FlowLayout());
JScrollPane scrollPane = new JScrollPane(table);
panel.add(scrollPane);
panel.setFocusable(false);
exceptionString = "AccessibleJTable test failed!"; super.createUI(panel, "AccessibleJTableTest");
}
publicvoid createUINamed() {
INSTRUCTIONS = "INSTRUCTIONS:\n"
+ "Check a11y of named JTable.\n\n"
+ "Turn screen reader on, and Tab to the table.\n"
+ "Press the ctrl+tab button to move to second table.\n\n"
+ "If you can hear second table name: \"second table\" - ctrl+tab further and press PASS, otherwise press FAIL.\n";
JTable table = new JTable(data, columnNames);
JTable secondTable = new JTable(data, columnNames);
secondTable.getAccessibleContext().setAccessibleName("Second table");
JPanel panel = new JPanel();
panel.setLayout(new FlowLayout());
JScrollPane scrollPane = new JScrollPane(table);
JScrollPane secondScrollPane = new JScrollPane(secondTable);
panel.add(scrollPane);
panel.add(secondScrollPane);
panel.setFocusable(false);
exceptionString = "AccessibleJTable test failed!"; super.createUI(panel, "AccessibleJTableTest");
}
publicvoid createUIWithChangingContent() {
INSTRUCTIONS = "INSTRUCTIONS:\n"
+ "Check a11y of dynamic JTable.\n\n"
+ "Turn screen reader on, and Tab to the table.\n"
+ "Add and remove rows and columns using the appropriate buttons and try to move around the table\n\n"
+ "If you hear changes in the table - ctrl+tab further and press PASS, otherwise press FAIL.\n";
JTable table = new JTable(new TestTableModel(3, 3));
JPanel panel = new JPanel();
panel.setLayout(new FlowLayout());
JScrollPane scrollPane = new JScrollPane(table);
panel.add(scrollPane);
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.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.