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

88 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="ResourceListPane and ResourceListDetailsPane" />
<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="vresourcelist" />
<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>ResourceListPane and ResourceListDetailsPane</title>
</head>
<body id="vresourcelist"><a name="vresourcelist"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1">ResourceListPane and ResourceListDetailsPane</h1>
<div><p></p>
<div class="section"><p>Use the <a href="javadoc/com/ibm/as400/vaccess/ResourceListPane.html#NAVBAR_TOP"> ResourceListPane</a> and <a href="javadoc/com/ibm/as400/vaccess/ResourceListDetailsPane.html#NAVBAR_TOP"> ResourceListDetailsPane</a> classes to present
a resource list in a graphical user interface (GUI).</p>
</div>
<div class="section"><ul><li>ResourceListPane displays the contents of the resource list in a graphical
javax.swing.JList. Every item displayed in the list represents a resource
object from the resource list.</li>
<li>ResourceListDetailsPane displays the contents of the resource list in
a graphical javax.swing.JTable. Every row in the table represents a resource
object from the resource list.</li>
</ul>
</div>
<div class="section"><p>The table columns for a ResourceListDetailsPane are specified
as an array of column attribute IDs. The table contains a column for each
element of the array and a row for each resource object.</p>
</div>
<div class="section"><p>Pop-up menus are enabled by default for both ResourceListPane
and ResourceListDetailsPane.</p>
</div>
<div class="section"><p>Most errors are reported as <a href="javadoc/com/ibm/as400/vaccess/ErrorEvent.html#NAVBAR_TOP"> com.ibm.as400.vaccess.ErrorEvents</a> rather
than thrown exceptions. Listen for ErrorEvents in order to diagnose and recover
from error conditions.</p>
</div>
<div class="section"><p><strong><span class="synph" id="vresourcelist__presentinggui"><a name="vresourcelist__presentinggui"><!-- --></a><span class="kwd"></span></span>Example: Displaying
a resource list in a GUI</strong></p>
</div>
<div class="section"><p>This example creates a ResourceList of all users on a system and
displays it in a GUI (details pane):</p>
</div>
<div class="section"><div class="p"><pre> // Create the resource list.
AS400 system = new AS400("MYSYSTEM", "MYUSERID", "MYPASSWORD");
RUserList userList = new RUserList(system);
// Create the ResourceListDetailsPane. In this example,
// there are two columns in the table. The first column
// contains the icons and names for each user. The
// second column contains the text description for each
// user.
Object[] columnAttributeIDs = new Object[] { null, RUser.TEXT_DESCRIPTION };
ResourceListDetailsPane detailsPane = new ResourceListDetailsPane();
detailsPane.setResourceList(userList);
detailsPane.setColumnAttributeIDs(columnAttributeIDs);
// Add the ResourceListDetailsPane to a JFrame and show it.
JFrame frame = new JFrame("My Window");
frame.getContentPane().add(detailsPane);
frame.pack();
frame.show();
// The ResourceListDetailsPane will appear empty until
// we load it. This gives us control of when the list
// of users is retrieved from the iSeries.
detailsPane.load();</pre>
</div>
</div>
</div>
</body>
</html>