101 lines
6.2 KiB
HTML
101 lines
6.2 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="Example: Creating beans with a visual bean builder" />
|
||
|
<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="jbeanbld" />
|
||
|
<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>Example: Creating beans with a visual bean builder</title>
|
||
|
</head>
|
||
|
<body id="jbeanbld"><a name="jbeanbld"><!-- --></a>
|
||
|
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
|
||
|
<h1 class="topictitle1">Example: Creating beans with a visual bean builder</h1>
|
||
|
<div><p></p>
|
||
|
<div class="section"><p>This example uses the IBM<sup>®</sup> VisualAge<sup>®</sup> for Java™ Enterprise
|
||
|
Edition V2.0 Composition Editor, but other visual bean builders are similar.
|
||
|
This example creates an applet for a button that, when pressed, runs a command
|
||
|
on the iSeries™ server.</p>
|
||
|
</div>
|
||
|
<div class="section"><ul><li>Drag-and-drop a Button on the applet. (The Button can be found in the
|
||
|
bean builder on the left side of the Visual Composition tab in Figure 1.)</li>
|
||
|
<li>Drop a CommandCall bean and an AS400 bean outside the applet. (The beans
|
||
|
can be found in the bean builder on the left side of the Visual Composition
|
||
|
tab in Figure 1.)</li>
|
||
|
</ul>
|
||
|
<p><strong><span class="synph" id="jbeanbld__jbeanbldfig1"><a name="jbeanbld__jbeanbldfig1"><!-- --></a><span class="kwd"></span></span>Figure 1: VisualAge Visual
|
||
|
Composition Editor window - gui.BeanExample</strong></p>
|
||
|
<p><img src="rzahh000.gif" alt="VisualAge Visual Composition Editor window - gui.BeanExample" /></p>
|
||
|
<ul><li>Edit the bean properties. (To edit, select the bean and then right-click
|
||
|
to display a window, which has Properties as an option.) <ul><li>Change the label of the Button to <strong>Run command</strong>, as shown in Figure
|
||
|
2. <p><strong><span class="synph" id="jbeanbld__figfig2"><a name="jbeanbld__figfig2"><!-- --></a><span class="kwd"></span></span>Figure 2: Changing the label
|
||
|
of the button to Run command</strong></p>
|
||
|
<p><img src="rzahh001.gif" alt="VisualAge BeanExample Properties window - Changing the label of the button to Run Command" /></p>
|
||
|
</li>
|
||
|
<li>Change the system name of the AS400 bean to <strong> TestSys</strong></li>
|
||
|
<li>Change the user ID of the AS400 bean to <strong> TestUser</strong>, as shown in
|
||
|
Figure 3. <p><strong><span class="synph" id="jbeanbld__figfig3"><a name="jbeanbld__figfig3"><!-- --></a><span class="kwd"></span></span>Figure 3: Changing
|
||
|
the name of the user ID to TestUser</strong></p>
|
||
|
<p><img src="rzahh002.gif" alt="VisualAge BeanExample Properties window - Changing the name of the user ID to TestUser" /></p>
|
||
|
</li>
|
||
|
<li>Change the command of the CommandCall bean to <strong>SNDMSG MSG('Testing')
|
||
|
TOUSR('TESTUSER')</strong>, as shown in Figure 4. <p><strong><span class="synph" id="jbeanbld__figfig4"><a name="jbeanbld__figfig4"><!-- --></a><span class="kwd"></span></span>Figure
|
||
|
4: Changing the command of the CommandCall bean</strong></p>
|
||
|
<p><img src="rzahh003.gif" alt="VisualAge BeanExample Properties window - Changing the command of the CommandCall bean" /></p>
|
||
|
</li>
|
||
|
</ul>
|
||
|
</li>
|
||
|
</ul>
|
||
|
<ul><li>Connect the AS400 bean to the CommandCall bean. The method you use to
|
||
|
do this varies between bean builders. For this example, do the following:
|
||
|
<ul><li>Select the CommandCall bean and then click the right mouse button</li>
|
||
|
<li>Select <strong>Connect</strong></li>
|
||
|
<li>Select <strong>Connectable Features</strong></li>
|
||
|
<li>Select <strong>system</strong> from the list of features as shown in Figure 5.</li>
|
||
|
<li>Select the AS400 bean</li>
|
||
|
<li>Select <strong>this</strong> from the pop-up menu that appears over the AS400 bean
|
||
|
<p><strong><span class="synph" id="jbeanbld__figfig5"><a name="jbeanbld__figfig5"><!-- --></a><span class="kwd"></span></span>Figure 5: Connecting AS400 bean
|
||
|
to CommandCall bean</strong></p>
|
||
|
<p><img src="rzahh004.gif" alt="VisualAge Start connection from dialog - Connecting AS400 bean to CommandCall bean" /></p>
|
||
|
</li>
|
||
|
</ul>
|
||
|
</li>
|
||
|
</ul>
|
||
|
<ul><li>Connect the button to the CommandCall bean. <ul><li>Select the Button bean and then click the right mouse button</li>
|
||
|
<li>Select <strong>Connect</strong></li>
|
||
|
<li>Select <strong>actionPerformed</strong></li>
|
||
|
<li>Select the CommandCall bean</li>
|
||
|
<li>Select <strong>Connectable Features</strong> from the pop-up menu that appears</li>
|
||
|
<li>Select <strong>run()</strong> from the list of methods as shown in Figure 6. <p><strong><span class="synph" id="jbeanbld__figfig6"><a name="jbeanbld__figfig6"><!-- --></a><span class="kwd"></span></span>Figure 6: Connecting a method to a button</strong></p>
|
||
|
<p><img src="rzahh005.gif" alt="VisualAge End connection to dialog - Connecting a method to a button" /></p>
|
||
|
</li>
|
||
|
</ul>
|
||
|
</li>
|
||
|
</ul>
|
||
|
<p>When you are finished, the VisualAge Visual Composition Editor
|
||
|
window might look like Figure 7.</p>
|
||
|
<p><strong><span class="synph" id="jbeanbld__figdone"><a name="jbeanbld__figdone"><!-- --></a><span class="kwd"></span></span>Figure
|
||
|
7: VisualAge Visual
|
||
|
Composition Editor window - Finished bean example</strong></p>
|
||
|
<p><img src="rzahh006.gif" alt="VisualAge Composition Editor window - Finished bean example" /></p>
|
||
|
</div>
|
||
|
</div>
|
||
|
|
||
|
</body>
|
||
|
</html>
|