Class XFileSystemView


  • public abstract class XFileSystemView
    extends javax.swing.filechooser.FileSystemView
    XFileSystemView class allows the XFileChooser to provide XFile object data to the FileSystemView of the JFileChooser. This class overrides the FileSystemView provided by JFileChooser. Whenever an XFileChooser constructor is called the FileSystemView that is set would be the XFileSystemView.
    • Constructor Summary

      Constructors 
      Constructor Description
      XFileSystemView()  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.io.File createFileObject​(java.io.File dir, java.lang.String filename)
      Creates a File object constructed from File obj and filename
      java.io.File createFileObject​(java.lang.String path)
      Creates a file object constructed from give pathname
      java.io.File[] getFiles​(java.io.File dir, boolean useFileHiding)
      Returns the list of files in a directory
      static javax.swing.filechooser.FileSystemView getFileSystemView()
      Depending on type of operating system (e.g.
      java.io.File getHomeDirectory()
      Returns the user's home directory
      java.io.File getParentDirectory​(java.io.File dir)
      Returns the parent directory of specified directory/file object
      boolean isRoot​(java.io.File f)
      Returns true if the given file object is root.
      • Methods inherited from class javax.swing.filechooser.FileSystemView

        createFileSystemRoot, createNewFolder, getChild, getChooserComboBoxFiles, getDefaultDirectory, getLinkLocation, getRoots, getSystemDisplayName, getSystemIcon, getSystemTypeDescription, isComputerNode, isDrive, isFileSystem, isFileSystemRoot, isFloppyDrive, isHiddenFile, isLink, isParent, isTraversable
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • XFileSystemView

        public XFileSystemView()
    • Method Detail

      • getFileSystemView

        public static javax.swing.filechooser.FileSystemView getFileSystemView()
        Depending on type of operating system (e.g. unix, windows, or generic) it would return the file system view.
        Returns:
        FileSystemView the operating system file system view
      • createFileObject

        public java.io.File createFileObject​(java.io.File dir,
                                             java.lang.String filename)
        Creates a File object constructed from File obj and filename
        Overrides:
        createFileObject in class javax.swing.filechooser.FileSystemView
        Parameters:
        dir - file object of directory
        filename - name of file in directory
        Returns:
        File object created
      • createFileObject

        public java.io.File createFileObject​(java.lang.String path)
        Creates a file object constructed from give pathname
        Overrides:
        createFileObject in class javax.swing.filechooser.FileSystemView
        Returns:
        File object constructed from the given path string.
      • getFiles

        public java.io.File[] getFiles​(java.io.File dir,
                                       boolean useFileHiding)
        Returns the list of files in a directory
        Overrides:
        getFiles in class javax.swing.filechooser.FileSystemView
        Parameters:
        dir - directory
        useFileHiding - flag to indicate to either show files hidden or not.
        Returns:
        File[] array of files in the directory
      • getHomeDirectory

        public java.io.File getHomeDirectory()
        Returns the user's home directory
        Overrides:
        getHomeDirectory in class javax.swing.filechooser.FileSystemView
        Returns:
        File object of user's home directory
      • getParentDirectory

        public java.io.File getParentDirectory​(java.io.File dir)
        Returns the parent directory of specified directory/file object
        Overrides:
        getParentDirectory in class javax.swing.filechooser.FileSystemView
        Parameters:
        dir - directory
        Returns:
        parent directory
      • isRoot

        public boolean isRoot​(java.io.File f)
        Returns true if the given file object is root.
        Overrides:
        isRoot in class javax.swing.filechooser.FileSystemView
        Parameters:
        f - file object to check if root
        Returns:
        boolean value if file object is root (true) or not (false)