Package javax.swing.filechooser

Examples of javax.swing.filechooser.FileSystemView$AbstractFileSystemView


  {
    // this test shows an unusual behaviour of this method - if the current
    // directory is a root directory, changing to the parent directory
    // makes the current directory the user's home directory...
    JFileChooser fc = new JFileChooser();
    FileSystemView fsv = fc.getFileSystemView();
    File[] roots = fsv.getRoots();
    File root = roots[0];
    fc.setCurrentDirectory(root);
    fc.addPropertyChangeListener(this);
    fc.changeToParentDirectory();
    harness.check(fc.getCurrentDirectory(),
View Full Code Here


      return;
    }
    bgColor = viewer.getBackgroundArgb();
    javaname = name.replaceAll("[^a-zA-Z_0-9-]", "_"); //escape filename characters
    whichWidgets=new BitSet(nWidgets);
    FileSystemView Directories = FileSystemView.getFileSystemView();
    File homedir = Directories.getHomeDirectory();
    String homedirpath = homedir.getPath();
    String scratchpath = homedirpath + "/.jmol_WPM";
    File scratchfile = new File(scratchpath);
    if (!(scratchfile.exists())) {//make the directory if necessary. we will delete when done
      boolean made_scratchdir = scratchfile.mkdir();
View Full Code Here

  public void windowStateChanged(WindowEvent e) {
  }

  public static void cleanUp() {
    //gets rid of scratch files.
    FileSystemView Directories = FileSystemView.getFileSystemView();
    File homedir = Directories.getHomeDirectory();
    String homedirpath = homedir.getPath();
    String scratchpath = homedirpath + "/.jmol_WPM";
    File scratchdir = new File(scratchpath);
    if (scratchdir.exists()) {
      File[] dirListing = null;
View Full Code Here

    public FileSystemView getFileSystemView() {
        return fileSystemView;
    }

    public void setFileSystemView(final FileSystemView fsv) {
        FileSystemView oldValue = fileSystemView;
        fileSystemView = fsv;
        firePropertyChange(FILE_SYSTEM_VIEW_CHANGED_PROPERTY, oldValue, fsv);
    }
View Full Code Here

        public Boolean isHidden(final File f) {
            return f.isHidden() ? Boolean.TRUE : Boolean.FALSE;
        }

        private Icon getIconForFile(final File file) {
            FileSystemView view = getFileChooser().getFileSystemView();
            if (file == null) {
                return null;
            } else if (view.isComputerNode(file)) {
                return computerIcon;
            } else if (view.isFloppyDrive(file)) {
                return floppyDriveIcon;
            } else if (view.isDrive(file)) {
                return hardDriveIcon;
            } else if (file.isFile()) {
                return fileIcon;
            } else if (file.isDirectory()) {
                return directoryIcon;
View Full Code Here

            processRoots();
            appendFileStructure(getFileChooser().getFileSystemView().getDefaultDirectory(), predefinedStructure);
        }

        private void processRoots() {
            FileSystemView fileSystemView = getFileChooser().getFileSystemView();
            File[] roots = fileSystemView.getRoots();
            for (int i = 0; i < roots.length; i++) {
                predefinedStructure.add(roots[i]);
                File[] children = fileSystemView.getFiles(roots[i], false);
                if (children != null) {
                    for (int j = 0; j < children.length; j++) {
                        processRoot(children[j]);
                    }
                }
View Full Code Here

                }
            }
        }

        private void processRoot(final File root) {
            FileSystemView fileSystemView = getFileChooser().getFileSystemView();
            if (!fileSystemView.isFileSystem(root) || fileSystemView.isFileSystemRoot(root)) {
                predefinedStructure.add(root);
                if (!fileSystemView.isFileSystemRoot(root)) {
                    File[] children = fileSystemView.getFiles(root, false);
                    if (files != null) {
                        for (int i = 0; i < children.length; i++) {
                            if (fileSystemView.isFileSystemRoot(children[i])) {
                                predefinedStructure.add(children[i]);
                            }
                        }
                    }
                }
View Full Code Here

            processRoots();
            appendFileStructure(getFileChooser().getFileSystemView().getDefaultDirectory(), predefinedStructure);
        }

        private void processRoots() {
            FileSystemView fileSystemView = getFileChooser().getFileSystemView();
            File[] roots = fileSystemView.getRoots();
            for (int i = 0; i < roots.length; i++) {
                predefinedStructure.add(roots[i]);
                File[] children = fileSystemView.getFiles(roots[i], false);
                if (children != null) {
                    for (int j = 0; j < children.length; j++) {
                        processRoot(children[j]);
                    }
                }
View Full Code Here

                }
            }
        }

        private void processRoot(final File root) {
            FileSystemView fileSystemView = getFileChooser().getFileSystemView();
            if (!fileSystemView.isFileSystem(root) || fileSystemView.isFileSystemRoot(root)) {
                predefinedStructure.add(root);
                if (!fileSystemView.isFileSystemRoot(root)) {
                    File[] children = fileSystemView.getFiles(root, false);
                    if (files != null) {
                        for (int i = 0; i < children.length; i++) {
                            if (fileSystemView.isFileSystemRoot(children[i])) {
                                predefinedStructure.add(children[i]);
                            }
                        }
                    }
                }
View Full Code Here

            processRoots();
            appendFileStructure(getFileChooser().getFileSystemView().getDefaultDirectory(), predefinedStructure);
        }

        private void processRoots() {
            FileSystemView fileSystemView = getFileChooser().getFileSystemView();
            File[] roots = fileSystemView.getRoots();
            for (int i = 0; i < roots.length; i++) {
                predefinedStructure.add(roots[i]);
                File[] children = fileSystemView.getFiles(roots[i], false);
                if (children != null) {
                    for (int j = 0; j < children.length; j++) {
                        processRoot(children[j]);
                    }
                }
View Full Code Here

TOP

Related Classes of javax.swing.filechooser.FileSystemView$AbstractFileSystemView

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.