AS/400 panes are graphical user interface components that present and allow manipulation of one or more AS/400 resources. A VIFSDirectory object is a resource that represents a directory in the integrated file system for use in AS/400 panes. AS/400 panes and VIFSDirectory objects can be used together to present many views of the integrated file system, and to allow the user to navigate, manipulate, and select directories and files.
To use a VIFSDirectory, set both the system and path properties. You set these properties using a constructor or through the setSystem() and setPath() methods. You then plug the VIFSDirectory object into the AS/400 pane as the root, using the pane's constructor or setRoot() method.
VIFSDirectory has some other useful properties for defining the set of directories and files that are presented in AS/400 panes. Use setInclude() to specify whether directories, files, or both appear. Use setPattern() to set a filter on the items that are shown by specifying a pattern that the file name must match. You can use wildcard characters, such as "*" and "?", in the patterns. Similarly, use setFilter() to set a filter with an IFSFileFilter object.
When AS/400 pane objects and VIFSDirectory objects are created, they are initialized to a default state. The subdirectories and the files that make up the contents of the root directory have not been loaded. To load the contents, the caller must explicitly call the load() method on either object to initiate communication to the AS/400 system to gather the contents of the directory.
At run-time, a user can perform actions on any directory or file through the pop-up menu.
The following actions are available for directories:
Users can only read or write directories and files to which they are authorized. In addition, the caller can prevent the user from performing actions by using the setAllowActions() method on the pane.
The following example creates a VIFSDirectory and presents it in an AS400ExplorerPane:
// Create the VIFSDirectory object. // Assume that "system" in an AS400 // object created and initialized // elsewhere. VIFSDirectory root = new VIFSDirectory (system, "/DirectoryA/DirectoryB"); // Create and load an AS400ExplorerPane object. AS400ExplorerPane explorerPane = new AS400ExplorerPane (root); explorerPane.load (); // Add the explorer pane to a frame. // Assume that "frame" is a JFrame // created elsewhere. frame.getContentPane ().add (explorerPane);
Present an integrated file system directory hierarchy using an AS400TreePane with a VIFSDirectory object.
The following image shows the VIFSDirectory graphical user interface component:
VIFSDirectory GUI component |
![]() |