<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html lang="en-us" xml:lang="en-us"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="security" content="public" /> <meta name="Robots" content="index,follow" /> <meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' /> <meta name="DC.Type" content="reference" /> <meta name="DC.Title" content="Directories in AS400Panes" /> <meta name="abstract" content="" /> <meta name="description" content="" /> <meta name="copyright" content="(C) Copyright IBM Corporation 2006" /> <meta name="DC.Rights.Owner" content="(C) Copyright IBM Corporation 2006" /> <meta name="DC.Format" content="XHTML" /> <meta name="DC.Identifier" content="vifsdir" /> <meta name="DC.Language" content="en-us" /> <!-- All rights reserved. Licensed Materials Property of IBM --> <!-- US Government Users Restricted Rights --> <!-- Use, duplication or disclosure restricted by --> <!-- GSA ADP Schedule Contract with IBM Corp. --> <link rel="stylesheet" type="text/css" href="./ibmdita.css" /> <link rel="stylesheet" type="text/css" href="./ic.css" /> <title>Directories in AS400Panes</title> </head> <body id="vifsdir"><a name="vifsdir"><!-- --></a> <!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script> <h1 class="topictitle1">Directories in AS400Panes</h1> <div><p></p> <div class="section"><p><a href="vpanes.htm#vpanes">AS400Panes</a> are GUI components that present and allow manipulation of one or more server resources. A <a href="javadoc/com/ibm/as400/vaccess/VIFSDirectory.html#NAVBAR_TOP"> VIFSDirectory</a> object is a resource that represents a directory in the integrated file system for use in AS400Panes. AS400Pane 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.</p> </div> <div class="section"><p>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 AS400Pane as the root, using the constructor or setRoot() method of the AS400Pane.</p> </div> <div class="section"><p>VIFSDirectory has some other useful properties for defining the set of directories and files that are presented in AS400Panes. 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 <a href="javadoc/com/ibm/as400/access/IFSFileFilter.html#NAVBAR_TOP"> IFSFileFilter</a> object.</p> </div> <div class="section"><p>When AS400Pane 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 server to gather the contents of the directory.</p> </div> <div class="section"><p>At run-time, a user can perform actions on any directory or file by right-clicking it to display the context menu. The directory context menu can include the following items:</p> </div> <div class="section"><ul><li><strong>Create file</strong> - creates a file in the directory. This will give the file a default name</li> <li><strong>Create directory</strong> - creates a subdirectory with a default name</li> <li><strong>Rename</strong> - renames a directory</li> <li><strong>Delete</strong> - deletes a directory</li> <li><strong>Properties</strong> - displays properties such as the location, number of files and subdirectories, and modification date</li> </ul> </div> <div class="section"><p>The file context menu can include the following items:</p> </div> <div class="section"><ul><li><strong>Edit</strong> - edits a text file in a different window</li> <li><strong>View</strong> - views a text file in a different window</li> <li><strong>Rename</strong> - renames a file</li> <li><strong>Delete</strong> - deletes a file</li> <li><strong>Properties</strong> - displays properties such as the location, size, modification date, and attributes</li> </ul> </div> <div class="section"><p>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.</p> </div> <div class="section"><p>The following example creates a VIFSDirectory and presents it in an AS400ExplorerPane:</p> </div> <div class="section"><div class="p"><pre> // 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);</pre> <strong>Example</strong></div> </div> <div class="section"><p>Present an integrated file system directory hierarchy using an AS400TreePane with a <a href="vifsdirectoryexample.htm#vifsdirectoryexample"> VIFSDirectory</a> object.</p> </div> <div class="section"><p>Figure 1 shows the VIFSDirectory graphical user interface component:</p> </div> <div class="section"><p><strong>Figure 1: VIFSDirectory GUI component</strong></p> </div> <div class="section"><p><img src="rzahh088.gif" alt="VIFSDirectory GUI component" /></p> </div> </div> </body> </html>