86 lines
4.5 KiB
HTML
86 lines
4.5 KiB
HTML
|
<?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="FileTreeElement class" />
|
||
|
<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="filetree" />
|
||
|
<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>FileTreeElement class</title>
|
||
|
</head>
|
||
|
<body id="filetree"><a name="filetree"><!-- --></a>
|
||
|
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
|
||
|
<h1 class="topictitle1">FileTreeElement class</h1>
|
||
|
<div><p></p>
|
||
|
<div class="section"><p>The <a href="javadoc/com/ibm/as400/util/html/FileTreeElement.html"> FileTreeElement</a> class represents the Integrated File
|
||
|
System within an HTMLTree view.</p>
|
||
|
<p>Many tree element attributes can be
|
||
|
retrieved or updating using methods that are provided in the HTMLTreeElement
|
||
|
class. <a href="javadoc/com/ibm/as400/util/html/FileTreeElement.html#GETSHARENAME()">You</a> can also get and set the name and path of NetServer™ shared
|
||
|
drives.</p>
|
||
|
<p>Some of the actions these methods enable you to perform are:</p>
|
||
|
<ul><li><a href="javadoc/com/ibm/as400/util/html/HTMLTreeElement.html#GETICONURL()">Get</a> or <a href="javadoc/com/ibm/as400/util/html/HTMLTreeElement.html#SETICONURL(COM.IBM.AS400.UTIL.HTML.HTMLHYPERLINK)">set</a> the URL for the expanded and collapsed icon (inherited
|
||
|
method)</li>
|
||
|
<li><a href="javadoc/com/ibm/as400/util/html/HTMLTreeElement.html#SETEXPANDED(BOOLEAN)">Set</a> whether the tree element will be expanded (inherited
|
||
|
method)</li>
|
||
|
<li><a href="javadoc/com/ibm/as400/util/html/FileTreeElement.html#GETSHARENAME()">Get</a> or <a href="javadoc/com/ibm/as400/util/html/FileTreeElement.html#SETSHARENAME(JAVA.LANG.STRING)">set</a> the name of the NetServer shared drive</li>
|
||
|
<li><a href="javadoc/com/ibm/as400/util/html/FileTreeElement.html#GETSHAREPATH()">Get</a> or <a href="javadoc/com/ibm/as400/util/html/FileTreeElement.html#SETSHAREPATH(JAVA.LANG.STRING)">set</a> the path of the NetServer shared drive</li>
|
||
|
</ul>
|
||
|
</div>
|
||
|
<div class="section"><h4 class="sectiontitle">Example: Using FileTreeElement</h4><p>The following example
|
||
|
creates a FileTreeElement object and displays the tag:</p>
|
||
|
<pre> // Create an HTMLTree.
|
||
|
HTMLTree tree = new HTMLTree();
|
||
|
|
||
|
// Create a URLParser object.
|
||
|
URLParser urlParser = new URLParser(httpServletRequest.getRequestURI());
|
||
|
|
||
|
// Create an AS400 object.
|
||
|
AS400 system = new AS400(mySystem, myUserId, myPassword);
|
||
|
|
||
|
// Create an IFSJavaFile object.
|
||
|
IFSJavaFile root = new IFSJavaFile(system, "/QIBM");
|
||
|
|
||
|
// Create a DirFilter object and get the directories.
|
||
|
DirFilter filter = new DirFilter();
|
||
|
File[] dirList = root.listFiles(filter);
|
||
|
|
||
|
for (int i=0; i < dirList.length; i++)
|
||
|
{
|
||
|
|
||
|
// Create a FileTreeElement.
|
||
|
FileTreeElement node = new FileTreeElement(dirList[i]);
|
||
|
|
||
|
// Set the Icon URL.
|
||
|
ServletHyperlink sl = new ServletHyperlink(urlParser.getURI());
|
||
|
sl.setHttpServletResponse(resp);
|
||
|
element.setIconUrl(sl);
|
||
|
|
||
|
// Add the FileTreeElement to the tree.
|
||
|
tree.addElement(element);
|
||
|
}
|
||
|
|
||
|
System.out.println(tree.getTag());</pre>
|
||
|
<p>The <a href="javadoc/com/ibm/as400/util/html/HTMLTreeElement.html#GETTAG()">getTag()</a>
|
||
|
method above gives the output of the example.</p>
|
||
|
</div>
|
||
|
</div>
|
||
|
|
||
|
</body>
|
||
|
</html>
|