|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--javax.swing.filechooser.FileSystemView
|
+--com.ibm.as400.vaccess.IFSFileSystemView
IFSFileSystemView provides a gateway to the iSeries integrated file system, for use when constructing javax.swing.JFileChooser objects.
JFileChooser is a standard Java way to build dialogs for navigating
and choosing files, and is the recommended replacement for
IFSFileDialog.
The following example demonstrates the use of IFSFileSystemView.
import com.ibm.as400.access.AS400;
import com.ibm.as400.access.IFSJavaFile;
import com.ibm.as400.vaccess.IFSFileSystemView;
import javax.swing.JFileChooser;
import java.awt.Frame;
// Work with directory /Dir on the system myAS400.
AS400 system = new AS400("myAS400");
IFSJavaFile dir = new IFSJavaFile(system, "/Dir");
JFileChooser chooser = new JFileChooser(dir, new IFSFileSystemView(system));
Frame parent = new Frame();
int returnVal = chooser.showOpenDialog(parent);
if (returnVal == JFileChooser.APPROVE_OPTION) {
IFSJavaFile chosenFile = (IFSJavaFile)(chooser.getSelectedFile());
System.out.println("You selected the file named " +
chosenFile.getName());
}
IFSFileDialog,
IFSJavaFile| Constructor Summary | |
IFSFileSystemView(AS400 system)
Constructs an IFSFileSystemView object. |
|
| Method Summary | |
java.io.File |
createFileObject(java.io.File containingDir,
java.lang.String name)
Returns a File object constructed in directory from the given filename. |
java.io.File |
createFileObject(java.lang.String path)
Returns a File object constructed from the given path string. |
java.io.File |
createNewFolder(java.io.File containingDir)
Creates a new folder with a default name. |
java.io.File[] |
getFiles(java.io.File directory,
boolean useFileHiding)
Gets the list of shown (that is, not hidden) files in the directory. |
java.io.File |
getHomeDirectory()
Returns the home directory. |
java.io.File |
getParentDirectory(java.io.File directory)
Returns the parent directory of specified directory. |
java.io.File[] |
getRoots()
Returns all root partitions on this system. |
boolean |
isHiddenFile(java.io.File file)
Returns whether a file is hidden or not. |
boolean |
isRoot(java.io.File file)
Determines if the given file is a root in the navigatable tree(s). |
| Methods inherited from class javax.swing.filechooser.FileSystemView |
createFileSystemRoot, getChild, getDefaultDirectory, getFileSystemView, getSystemDisplayName, getSystemIcon, getSystemTypeDescription, isComputerNode, isDrive, isFileSystem, isFileSystemRoot, isFloppyDrive, isParent, isTraversable |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public IFSFileSystemView(AS400 system)
system - The iSeries system that contains the file.| Method Detail |
public java.io.File createFileObject(java.io.File containingDir,
java.lang.String name)
createFileObject in class javax.swing.filechooser.FileSystemViewcontainingDir - The directory in which to create the file.
IFSJavaFile.name - The file name.
public java.io.File createFileObject(java.lang.String path)
createFileObject in class javax.swing.filechooser.FileSystemViewpath - The file path name.
public java.io.File createNewFolder(java.io.File containingDir)
throws java.io.IOException
createNewFolder in class javax.swing.filechooser.FileSystemViewcontainingDir - The parent directory in which to create the folder.
Must be of type IFSJavaFile.
java.io.IOException
public java.io.File[] getFiles(java.io.File directory,
boolean useFileHiding)
getFiles in class javax.swing.filechooser.FileSystemViewdirectory - The directory to search.useFileHiding - This parameter is ignored.
public java.io.File getHomeDirectory()
getHomeDirectory in class javax.swing.filechooser.FileSystemViewpublic java.io.File getParentDirectory(java.io.File directory)
getParentDirectory in class javax.swing.filechooser.FileSystemViewdirectory - The directory being queried.
IFSJavaFile.
public java.io.File[] getRoots()
getRoots in class javax.swing.filechooser.FileSystemViewpublic boolean isHiddenFile(java.io.File file)
isHiddenFile in class javax.swing.filechooser.FileSystemViewpublic boolean isRoot(java.io.File file)
isRoot in class javax.swing.filechooser.FileSystemViewfile - A File object representing a directory.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||