Package sun.awt.shell

Examples of sun.awt.shell.ShellFolder


     * @param f a <code>File</code> object
     * @return <code>true</code> if <code>f</code> is a real file or directory.
     */
    public static boolean isFileSystem(File f) {
        if (f instanceof ShellFolder) {
            ShellFolder sf = (ShellFolder) f;
            // Shortcuts to directories are treated as not being file system objects,
            // so that they are never returned by JFileChooser.
            return sf.isFileSystem() && !(sf.isLink() && sf.isDirectory());
        }
        else {
            return true;
        }
    }
View Full Code Here


        if ( dir instanceof ShellFolder ) {
            //
            // This is a hack to work around the problem of scanning the
            // "Network" pseudo-folder that takes a long time.
            //
            final ShellFolder sf = (ShellFolder)dir;
            if ( sf.getDisplayName().equals( "Network" ) )
                return 0;
        }
        final File[] contents =
            FileUtil.listFiles( dir, DirectoryOnlyFilter.INSTANCE, false );
        int hashCode = 0;
View Full Code Here

    private void changeDirectory(File dir) {
  JFileChooser fc = getFileChooser();
  // Traverse shortcuts on Windows
        if (dir != null && FilePane.usesShellFolder(fc)) {
      try {
                ShellFolder shellFolder = ShellFolder.getShellFolder(dir);
                if (shellFolder.isLink()) {
                    File linkedTo = shellFolder.getLinkLocation();
                    if (linkedTo != null && fc.isTraversable(linkedTo)) {
                        dir = linkedTo;
                    } else {
                        return;
                    }
View Full Code Here

    private void changeDirectory(File dir) {
        JFileChooser fc = getFileChooser();
        // Traverse shortcuts on Windows
        if (dir != null && FilePane.usesShellFolder(fc)) {
            try {
                ShellFolder shellFolder = ShellFolder.getShellFolder(dir);

                if (shellFolder.isLink()) {
                    File linkedTo = shellFolder.getLinkLocation();

                    // If linkedTo is null we try to use dir
                    if (linkedTo != null) {
                        if (fc.isTraversable(linkedTo)) {
                            dir = linkedTo;
View Full Code Here

     * @param f a <code>File</code> object
     * @return <code>true</code> if <code>f</code> is a real file or directory.
     */
    public static boolean isFileSystem(File f) {
        if (f instanceof ShellFolder) {
            ShellFolder sf = (ShellFolder) f;
            // Shortcuts to directories are treated as not being file system objects,
            // so that they are never returned by JFileChooser.
            return sf.isFileSystem() && !(sf.isLink() && sf.isDirectory());
        }
        else {
            return true;
        }
    }
View Full Code Here

                    folderName = folderName.substring(index + 1);
                }
                Icon icon = null;
                if (files[i] instanceof ShellFolder) {
                    // We want a large icon, fsv only gives us a small.
                    ShellFolder sf = (ShellFolder)files[i];
                    icon = new ImageIcon(sf.getIcon(true), sf.getFolderType());
                } else {
                    icon = fsv.getSystemIcon(files[i]);
                }
                buttons[i] = new JToggleButton(folderName, icon);
                if (xp != null) {
View Full Code Here

import sun.awt.shell.ShellFolder;

public class bug6484091 {
    public static void main(String[] args) {
        ShellFolder dir = (ShellFolder) FileSystemView.getFileSystemView().getDefaultDirectory();

        printDirContent(dir);

        System.setSecurityManager(new SecurityManager());
View Full Code Here

        File file = (File)node;

        // Update the image view
        Image icon = null;

        ShellFolder shellFolder = null;
        try {
            shellFolder = ShellFolder.getShellFolder(file);
        } catch(FileNotFoundException exception) {
        }

        java.awt.Image image = null;
        if (shellFolder != null) {
            image = shellFolder.getIcon(false);
        }

        if (image instanceof BufferedImage
            && useNativeIcons) {
            icon = new Picture((BufferedImage)image);
View Full Code Here

TOP

Related Classes of sun.awt.shell.ShellFolder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.