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