ibm-information-center/dist/eclipse/plugins/i5OS.ic.rzahh_5.4.0.1/ifsfd.htm

79 lines
4.3 KiB
HTML
Raw Normal View History

2024-04-02 14:02:31 +00:00
<?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="IFSFileDialog" />
<meta name="abstract" content="The IFSFileDialog class allows you to traverse the file system and select a file." />
<meta name="description" content="The IFSFileDialog class allows you to traverse the file system and select a file." />
<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="ifsfd" />
<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>IFSFileDialog</title>
</head>
<body id="ifsfd"><a name="ifsfd"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1">IFSFileDialog</h1>
<div><p>The IFSFileDialog class allows you to traverse the file system
and select a file. </p>
<div class="section"><p><a href="javadoc/com/ibm/as400/vaccess/IFSFileDialog.html#NAVBAR_TOP"> IFSFileDialog</a> </p>
<p>This class uses the IFSFile class
to traverse the list of directories and files in the integrated file system
on the iSeries™ server.
Methods on the class allow a Java™ program to set the text on the push
buttons of the dialog and to set filters. Note that an <a href="vifsfdlg.htm#vifsfdlg">IFSFileDialog</a> class
based on Swing 1.1 is also available.</p>
<p>You can set filters through the <a href="javadoc/com/ibm/as400/vaccess/FileFilter.html#NAVBAR_TOP"> FileFilter</a> class. If the user selects a file in the
dialog, the <a href="javadoc/com/ibm/as400/vaccess/IFSFileDialog.html#GETFILENAME()"> getFileName()</a> method can be used to get the name of
the file that was selected. The <a href="javadoc/com/ibm/as400/vaccess/IFSFileDialog.html#GETABSOLUTEPATH()"> getAbsolutePath()</a> method can be used to get the path
and name of the file that was selected.</p>
</div>
<div class="section"><h4 class="sectiontitle">Example: Using IFSFileDialog</h4><p>The following example
shows how to set up a dialog with two filters and to set the text on the push
buttons of the dialog.</p>
<pre> // Create an AS400 object.
AS400 sys = new AS400("mySystem.myCompany.com");
// Create a dialog object setting
// the text of the dialog's title
// bar and the server to traverse.
IFSFileDialog dialog = new IFSFileDialog(this, "Title Bar Text", sys);
// Create a list of filters then set
// the filters in the dialog. The
// first filter will be used when
// the dialog is first displayed.
FileFilter[] filterList = {new FileFilter("All files (*.*)", "*.*"),
new FileFilter("HTML files (*.HTML", "*.HTM")};
dialog.setFileFilter(filterList, 0);
// Set the text on the buttons of
// the dialog.
dialog.setOkButtonText("Open");
dialog.setCancelButtonText("Cancel");
// Show the dialog. If the user
// selected a file by pressing the
// Open button, get the file the
// user selected and display it.
if (dialog.showDialog() == IFSFileDialog.OK)
System.out.println(dialog.getAbsolutePath());</pre>
</div>
</div>
</body>
</html>