2527N/A/*
2527N/A * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
2527N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
2527N/A *
2527N/A * This code is free software; you can redistribute it and/or modify it
2527N/A * under the terms of the GNU General Public License version 2 only, as
2527N/A * published by the Free Software Foundation.
2527N/A *
2527N/A * This code is distributed in the hope that it will be useful, but WITHOUT
2527N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
2527N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
2527N/A * version 2 for more details (a copy is included in the LICENSE file that
2527N/A * accompanied this code).
2527N/A *
2527N/A * You should have received a copy of the GNU General Public License version
2527N/A * 2 along with this work; if not, write to the Free Software Foundation,
2527N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
2527N/A *
2685N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2685N/A * or visit www.oracle.com if you need additional information or have any
2685N/A * questions.
2527N/A */
2527N/A
2527N/A/* @test
2527N/A @bug 6963870
2527N/A @summary Tests that GTKPainter.ListTableFocusBorder.getBorderInsets()
2527N/A doesn't return null
2527N/A @author Peter Zhelezniakov
2527N/A @run main Test6963870
2527N/A*/
2527N/A
2527N/Aimport java.awt.Insets;
2527N/Aimport javax.swing.SwingUtilities;
2527N/Aimport javax.swing.UIManager;
2527N/Aimport javax.swing.border.Border;
2527N/A
2527N/Apublic class Test6963870 implements Runnable {
2527N/A
2527N/A final static String[] UI_NAMES = {
2527N/A "List.focusCellHighlightBorder",
2527N/A "List.focusSelectedCellHighlightBorder",
2527N/A "List.noFocusBorder",
2527N/A "Table.focusCellHighlightBorder",
2527N/A "Table.focusSelectedCellHighlightBorder",
2527N/A };
2527N/A
2527N/A public void run() {
2527N/A for (String uiName: UI_NAMES) {
2527N/A test(uiName);
2527N/A }
2527N/A }
2527N/A
2527N/A void test(String uiName) {
2527N/A Border b = UIManager.getBorder(uiName);
2527N/A Insets i = b.getBorderInsets(null);
2527N/A if (i == null) {
2527N/A throw new RuntimeException("getBorderInsets() returns null for " + uiName);
2527N/A }
2527N/A }
2527N/A
2527N/A public static void main(String[] args) throws Exception {
2527N/A try {
2527N/A UIManager.setLookAndFeel("com.sun.java.swing.plaf.gtk.GTKLookAndFeel");
2527N/A } catch (Exception e) {
2527N/A System.out.println("GTKLookAndFeel cannot be set, skipping this test");
2527N/A return;
2527N/A }
2527N/A
2527N/A SwingUtilities.invokeAndWait(new Test6963870());
2527N/A }
2527N/A}
2527N/A