|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectjavax.swing.filechooser.FileSystemView
com.ibm.as400.vaccess.IFSFileSystemView
IFSFileSystemView provides a gateway to the i5/OS 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)
Deprecated. Constructs an IFSFileSystemView object. |
|
| Method Summary | |
|---|---|
File |
createFileObject(File containingDir,
String name)
Deprecated. Returns a File object constructed in directory from the given filename. |
File |
createFileObject(String path)
Deprecated. Returns a File object constructed from the given path string. |
protected File |
createFileSystemRoot(File f)
Deprecated. |
File |
createNewFolder(File containingDir)
Deprecated. Creates a new folder with a default name. |
File |
getDefaultDirectory()
Deprecated. Returns the user's default starting directory for the file chooser. |
File[] |
getFiles(File directory,
boolean useFileHiding)
Deprecated. Gets the list of shown (that is, not hidden) files in the directory. |
File |
getHomeDirectory()
Deprecated. Returns the home directory. |
File |
getParentDirectory(File dir)
Deprecated. Returns the parent directory of dir. |
File[] |
getRoots()
Deprecated. Returns all root partitions on this system. |
String |
getSystemDisplayName(File f)
Deprecated. Returns the name of a file, directory, or folder as it would be displayed in a system file browser. |
Icon |
getSystemIcon(File f)
Deprecated. Always returns an icon representing an i5/OS system. |
String |
getSystemTypeDescription(File f)
Deprecated. Returns a type description for a file, directory, or folder as it would be displayed in a system file browser. |
boolean |
isComputerNode(File dir)
Deprecated. Always returns false. |
boolean |
isDrive(File dir)
Deprecated. Always returns false. |
boolean |
isFileSystemRoot(File f)
Deprecated. Returns true if f represents the root directory on the system ("/"), and false otherwise. |
boolean |
isFloppyDrive(File dir)
Deprecated. Always returns false. |
boolean |
isRoot(File file)
Deprecated. Determines if the given file is a root in the navigatable tree(s). |
| Methods inherited from class javax.swing.filechooser.FileSystemView |
|---|
getChild, getFileSystemView, isFileSystem, isHiddenFile, 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 system that contains the file.| Method Detail |
public File createFileObject(File containingDir,
String name)
containingDir - The directory in which to create the file.
name - The file name.
public File createFileObject(String path)
path - The file path name.
protected File createFileSystemRoot(File f)
public File createNewFolder(File containingDir)
throws IOException
containingDir - The parent directory in which to create the folder.
IOExceptionpublic File getDefaultDirectory()
File object representing the default
starting folder.
public File[] getFiles(File directory,
boolean useFileHiding)
directory - The directory to search.useFileHiding - This parameter is ignored.
public File getHomeDirectory()
public File getParentDirectory(File dir)
dir - The directory being queried.
public File[] getRoots()
public String getSystemDisplayName(File f)
f - A File object.
public Icon getSystemIcon(File f)
public String getSystemTypeDescription(File f)
f - A File object.
public boolean isComputerNode(File dir)
public boolean isDrive(File dir)
public boolean isFloppyDrive(File dir)
public boolean isFileSystemRoot(File f)
f - A File object representing a directory.
true if f is a root of a filesystempublic boolean isRoot(File file)
file - A File object representing a directory.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||