bug6550546.java revision 2362
6443N/A/*
6443N/A * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
6443N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6443N/A *
6443N/A * This code is free software; you can redistribute it and/or modify it
6443N/A * under the terms of the GNU General Public License version 2 only, as
6443N/A * published by the Free Software Foundation.
6443N/A *
6443N/A * This code is distributed in the hope that it will be useful, but WITHOUT
6443N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
6443N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
6443N/A * version 2 for more details (a copy is included in the LICENSE file that
6443N/A * accompanied this code).
6443N/A *
6443N/A * You should have received a copy of the GNU General Public License version
6443N/A * 2 along with this work; if not, write to the Free Software Foundation,
6443N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
6443N/A *
6443N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
6443N/A * or visit www.oracle.com if you need additional information or have any
6443N/A * questions.
6443N/A */
7073N/A
6443N/A/* @test
6443N/A @bug 6550546
6443N/A @summary Win LAF: JFileChooser -> Look in Drop down should not display any shortcuts created on desktop
6443N/A @author Pavel Porvatov
6443N/A @run main bug6550546
7073N/A*/
7073N/A
7089N/Aimport sun.awt.OSInfo;
6443N/Aimport sun.awt.shell.ShellFolder;
6443N/A
6443N/Aimport javax.swing.*;
6443N/Aimport java.io.File;
6443N/A
6443N/Apublic class bug6550546 {
6443N/A public static void main(String[] args) throws Exception {
6443N/A if (OSInfo.getOSType() != OSInfo.OSType.WINDOWS) {
6443N/A System.out.println("The test is suitable only for Windows, skipped.");
6443N/A
6443N/A return;
6443N/A }
6443N/A
6443N/A SwingUtilities.invokeAndWait(new Runnable() {
6443N/A public void run() {
6443N/A File[] files = (File[]) ShellFolder.get("fileChooserComboBoxFolders");
6443N/A
6443N/A for (File file : files) {
6443N/A if (file instanceof ShellFolder && ((ShellFolder) file).isLink()) {
6443N/A throw new RuntimeException("Link shouldn't be in FileChooser combobox, " + file.getPath());
6443N/A }
6443N/A }
6443N/A }
6443N/A });
6443N/A }
6443N/A}
6443N/A