KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > test > j2ee > addmethod > CallEnterpriseBeanDialog


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19
20 package org.netbeans.test.j2ee.addmethod;
21
22 import org.netbeans.jellytools.Bundle;
23 import org.netbeans.jemmy.operators.*;
24 import org.netbeans.jemmy.util.NameComponentChooser;
25
26 /** Class implementing all necessary methods for handling "Call Enterprise Bean" NbPresenter.
27  *
28  * @author lm97939
29  * @version 1.0
30  */

31 public class CallEnterpriseBeanDialog extends JDialogOperator {
32
33     /**
34      * Creates new CallEnterpriseBeanDialog that can handle it.
35      */

36     public CallEnterpriseBeanDialog() {
37         super(Bundle.getStringTrimmed("org.netbeans.modules.j2ee.ejbcore.ui.logicalview.entres.Bundle", "LBL_CallEjbAction"));
38     }
39
40     private JCheckBoxOperator _cbConvertCheckedExceptionsToRuntimeException;
41     private JRadioButtonOperator _rbGenerateInlineLookupCode;
42     private JRadioButtonOperator _rbExistingClass;
43     private JTextFieldOperator _txtExistingClass;
44     private JTreeOperator _tree;
45     private JTextFieldOperator _txtReferenceName;
46     private JRadioButtonOperator _rbLocal;
47     private JRadioButtonOperator _rbRemote;
48     private JButtonOperator _btOK;
49     private JButtonOperator _btCancel;
50
51
52     //******************************
53
// Subcomponents definition part
54
//******************************
55

56     /** Tries to find "Convert Checked Exceptions to RuntimeException" JCheckBox in this dialog.
57      * @return JCheckBoxOperator
58      */

59     public JCheckBoxOperator cbConvertCheckedExceptionsToRuntimeException() {
60         if (_cbConvertCheckedExceptionsToRuntimeException==null) {
61             _cbConvertCheckedExceptionsToRuntimeException = new JCheckBoxOperator(this, Bundle.getStringTrimmed("org.netbeans.modules.j2ee.ejbcore.ui.logicalview.entres.Bundle", "LBL_ConvertToRuntime"));
62         }
63         return _cbConvertCheckedExceptionsToRuntimeException;
64     }
65
66     /** Tries to find "Generate Inline Lookup Code" JRadioButton in this dialog.
67      * @return JRadioButtonOperator
68      */

69     public JRadioButtonOperator rbGenerateInlineLookupCode() {
70         if (_rbGenerateInlineLookupCode==null) {
71             _rbGenerateInlineLookupCode = new JRadioButtonOperator(this, "Generate Inline Lookup Code");
72         }
73         return _rbGenerateInlineLookupCode;
74     }
75
76     /** Tries to find "Existing Class" JRadioButton in this dialog.
77      * @return JRadioButtonOperator
78      */

79     public JRadioButtonOperator rbExistingClass() {
80         if (_rbExistingClass==null) {
81             _rbExistingClass = new JRadioButtonOperator(this, "Existing Class");
82         }
83         return _rbExistingClass;
84     }
85
86     /** Tries to find null JTextField in this dialog.
87      * @return JTextFieldOperator
88      */

89     public JTextFieldOperator txtExistingClass() {
90         if (_txtExistingClass==null) {
91             _txtExistingClass = new JTextFieldOperator(this);
92         }
93         return _txtExistingClass;
94     }
95
96     /** Tries to find null TreeView$ExplorerTree in this dialog.
97      * @return JTreeOperator
98      */

99     public JTreeOperator tree() {
100         if (_tree==null) {
101             _tree = new JTreeOperator(this);
102         }
103         return _tree;
104     }
105
106     /** Tries to find null JTextField in this dialog.
107      * @return JTextFieldOperator
108      */

109     public JTextFieldOperator txtReferenceName() {
110         if (_txtReferenceName==null) {
111             _txtReferenceName = new JTextFieldOperator(this, 2);
112         }
113         return _txtReferenceName;
114     }
115
116     /** Tries to find "Local" JRadioButton in this dialog.
117      * @return JRadioButtonOperator
118      */

119     public JRadioButtonOperator rbLocal() {
120         if (_rbLocal==null) {
121             _rbLocal = new JRadioButtonOperator(this, "Local");
122         }
123         return _rbLocal;
124     }
125
126     /** Tries to find "Remote" JRadioButton in this dialog.
127      * @return JRadioButtonOperator
128      */

129     public JRadioButtonOperator rbRemote() {
130         if (_rbRemote==null) {
131             _rbRemote = new JRadioButtonOperator(this, "Remote");
132         }
133         return _rbRemote;
134     }
135
136     /** Tries to find "OK" JButton in this dialog.
137      * @return JButtonOperator
138      */

139     public JButtonOperator btOK() {
140         if (_btOK==null) {
141             _btOK = new JButtonOperator(this, "OK");
142         }
143         return _btOK;
144     }
145
146     /** Tries to find "Cancel" JButton in this dialog.
147      * @return JButtonOperator
148      */

149     public JButtonOperator btCancel() {
150         if (_btCancel==null) {
151             _btCancel = new JButtonOperator(this, "Cancel");
152         }
153         return _btCancel;
154     }
155
156
157     //****************************************
158
// Low-level functionality definition part
159
//****************************************
160

161     /** checks or unchecks given JCheckBox
162      * @param state boolean requested state
163      */

164     public void checkConvertCheckedExceptionsToRuntimeException(boolean state) {
165         if (cbConvertCheckedExceptionsToRuntimeException().isSelected()!=state) {
166             cbConvertCheckedExceptionsToRuntimeException().push();
167         }
168     }
169
170     /** clicks on "Generate Inline Lookup Code" JRadioButton
171      */

172     public void generateInlineLookupCode() {
173         rbGenerateInlineLookupCode().push();
174     }
175
176     /** clicks on "Existing Class" JRadioButton
177      */

178     public void existingClass() {
179         rbExistingClass().push();
180     }
181
182     /** gets text for txtExistingClass
183      * @return String text
184      */

185     public String JavaDoc getExistingClass() {
186         return txtExistingClass().getText();
187     }
188
189     /** sets text for txtExistingClass
190      * @param text String text
191      */

192     public void setExistingClass(String JavaDoc text) {
193         txtExistingClass().setText(text);
194     }
195
196     /** types text for txtExistingClass
197      * @param text String text
198      */

199     public void typeExistingClass(String JavaDoc text) {
200         txtExistingClass().typeText(text);
201     }
202
203     /** gets text for txtReferenceName
204      * @return String text
205      */

206     public String JavaDoc getReferenceName() {
207         return txtReferenceName().getText();
208     }
209
210     /** sets text for txtReferenceName
211      * @param text String text
212      */

213     public void setReferenceName(String JavaDoc text) {
214         txtReferenceName().setText(text);
215     }
216
217     /** types text for txtReferenceName
218      * @param text String text
219      */

220     public void typeReferenceName(String JavaDoc text) {
221         txtReferenceName().typeText(text);
222     }
223     
224     /** clears text for txtReferenceName
225      */

226     public void clearReferenceName() {
227         txtReferenceName().clearText();
228     }
229
230     /** clicks on "Local" JRadioButton
231      */

232     public void local() {
233         rbLocal().push();
234     }
235
236     /** clicks on "Remote" JRadioButton
237      */

238     public void remote() {
239         rbRemote().push();
240     }
241
242     /** clicks on "OK" JButton
243      */

244     public void ok() {
245         btOK().push();
246     }
247
248     /** clicks on "Cancel" JButton
249      */

250     public void cancel() {
251         btCancel().push();
252     }
253
254
255     //*****************************************
256
// High-level functionality definition part
257
//*****************************************
258

259     /**
260      * Performs verification of CallEnterpriseBeanDialog by accessing all its components.
261      */

262     public void verify() {
263         cbConvertCheckedExceptionsToRuntimeException();
264         rbGenerateInlineLookupCode();
265         rbExistingClass();
266         txtExistingClass();
267         tree();
268         txtReferenceName();
269         rbLocal();
270         rbRemote();
271         btOK();
272         btCancel();
273     }
274
275     /**
276      * Performs simple test of CallEnterpriseBeanDialog
277      * @param args the command line arguments
278      */

279     public static void main(String JavaDoc args[]) {
280         new CallEnterpriseBeanDialog().verify();
281         System.out.println("CallEnterpriseBean verification finished.");
282     }
283 }
284
285
Popular Tags