KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > qa > form > NewBeanFormOperator


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.qa.form;
21
22 import org.netbeans.jemmy.operators.*;
23
24 /** Class implementing all necessary methods for handling "New Bean Form" NbDialog.
25  * Most parts of code are generated by jelly tools.
26  *
27  * @author Jiri Vagner
28  */

29 public class NewBeanFormOperator extends JDialogOperator {
30
31     /** Creates new NewBeanForm that can handle it.
32      */

33     public NewBeanFormOperator() {
34         super("New Bean Form"); // NOI18N
35
}
36
37     private JLabelOperator _lblSteps;
38     private JListOperator _lstSteps;
39     private JLabelOperator _lblNameAndLocation;
40     private JLabelOperator _lblClassName;
41     private JTextFieldOperator _txtClassName;
42     private JLabelOperator _lblProject;
43     private JTextFieldOperator _txtProject;
44     private JLabelOperator _lblLocation;
45     private JComboBoxOperator _cboLocation;
46     private JLabelOperator _lblPackage;
47     private JComboBoxOperator _cboPackage;
48     private JLabelOperator _lblCreatedFile;
49     private JTextFieldOperator _txtCreatedFile;
50     private JLabelOperator _lblWizardDescriptor$FixedHeightLabel;
51     private JButtonOperator _btBack;
52     private JButtonOperator _btNext;
53     private JButtonOperator _btFinish;
54     private JButtonOperator _btCancel;
55     private JButtonOperator _btHelp;
56
57     public static final String JavaDoc ITEM_3 = "3."; // NOI18N
58
public static final String JavaDoc ITEM_SOURCES = "sources"; // NOI18N
59
public static final String JavaDoc ITEM_COMPATIBILITY = "compatibility"; // NOI18N
60
public static final String JavaDoc ITEM_DATA = "data"; // NOI18N
61
public static final String JavaDoc ITEM_FORMUTILITIES = "formUtilities"; // NOI18N
62
public static final String JavaDoc ITEM_PALETTE = "palette"; // NOI18N
63
public static final String JavaDoc ITEM_UNDOREDO = "undoredo"; // NOI18N
64

65
66     //******************************
67
// Subcomponents definition part
68
//******************************
69

70     /** Tries to find "Steps" JLabel in this dialog.
71      * @return JLabelOperator
72      */

73     public JLabelOperator lblSteps() {
74         if (_lblSteps==null) {
75             _lblSteps = new JLabelOperator(this, "Steps"); // NOI18N
76
}
77         return _lblSteps;
78     }
79
80     /** Tries to find null JList in this dialog.
81      * @return JListOperator
82      */

83     public JListOperator lstSteps() {
84         if (_lstSteps==null) {
85             _lstSteps = new JListOperator(this);
86         }
87         return _lstSteps;
88     }
89
90     /** Tries to find "Name and Location" JLabel in this dialog.
91      * @return JLabelOperator
92      */

93     public JLabelOperator lblNameAndLocation() {
94         if (_lblNameAndLocation==null) {
95             _lblNameAndLocation = new JLabelOperator(this, "Name and Location"); // NOI18N
96
}
97         return _lblNameAndLocation;
98     }
99
100     /** Tries to find "Class Name:" JLabel in this dialog.
101      * @return JLabelOperator
102      */

103     public JLabelOperator lblClassName() {
104         if (_lblClassName==null) {
105             _lblClassName = new JLabelOperator(this, "Class Name:"); // NOI18N
106
}
107         return _lblClassName;
108     }
109
110     /** Tries to find null JTextField in this dialog.
111      * @return JTextFieldOperator
112      */

113     public JTextFieldOperator txtClassName() {
114         if (_txtClassName==null) {
115             _txtClassName = new JTextFieldOperator(this);
116         }
117         return _txtClassName;
118     }
119
120     /** Tries to find "Project:" JLabel in this dialog.
121      * @return JLabelOperator
122      */

123     public JLabelOperator lblProject() {
124         if (_lblProject==null) {
125             _lblProject = new JLabelOperator(this, "Project:"); // NOI18N
126
}
127         return _lblProject;
128     }
129
130     /** Tries to find null JTextField in this dialog.
131      * @return JTextFieldOperator
132      */

133     public JTextFieldOperator txtProject() {
134         if (_txtProject==null) {
135             _txtProject = new JTextFieldOperator(this, 1);
136         }
137         return _txtProject;
138     }
139
140     /** Tries to find "Location:" JLabel in this dialog.
141      * @return JLabelOperator
142      */

143     public JLabelOperator lblLocation() {
144         if (_lblLocation==null) {
145             _lblLocation = new JLabelOperator(this, "Location:"); // NOI18N
146
}
147         return _lblLocation;
148     }
149
150     /** Tries to find null JComboBox in this dialog.
151      * @return JComboBoxOperator
152      */

153     public JComboBoxOperator cboLocation() {
154         if (_cboLocation==null) {
155             _cboLocation = new JComboBoxOperator(this);
156         }
157         return _cboLocation;
158     }
159
160     /** Tries to find "Package:" JLabel in this dialog.
161      * @return JLabelOperator
162      */

163     public JLabelOperator lblPackage() {
164         if (_lblPackage==null) {
165             _lblPackage = new JLabelOperator(this, "Package:"); // NOI18N
166
}
167         return _lblPackage;
168     }
169
170     /** Tries to find null JComboBox in this dialog.
171      * @return JComboBoxOperator
172      */

173     public JComboBoxOperator cboPackage() {
174         if (_cboPackage==null) {
175             _cboPackage = new JComboBoxOperator(this, 1);
176         }
177         return _cboPackage;
178     }
179
180     /** Tries to find "Created File:" JLabel in this dialog.
181      * @return JLabelOperator
182      */

183     public JLabelOperator lblCreatedFile() {
184         if (_lblCreatedFile==null) {
185             _lblCreatedFile = new JLabelOperator(this, "Created File:"); // NOI18N
186
}
187         return _lblCreatedFile;
188     }
189
190     /** Tries to find null JTextField in this dialog.
191      * @return JTextFieldOperator
192      */

193     public JTextFieldOperator txtCreatedFile() {
194         if (_txtCreatedFile==null) {
195             _txtCreatedFile = new JTextFieldOperator(this, 3);
196         }
197         return _txtCreatedFile;
198     }
199
200     /** Tries to find " " WizardDescriptor$FixedHeightLabel in this dialog.
201      * @return JLabelOperator
202      */

203     public JLabelOperator lblWizardDescriptor$FixedHeightLabel() {
204         if (_lblWizardDescriptor$FixedHeightLabel==null) {
205             _lblWizardDescriptor$FixedHeightLabel = new JLabelOperator(this, " ", 3); // NOI18N
206
}
207         return _lblWizardDescriptor$FixedHeightLabel;
208     }
209
210     /** Tries to find "< Back" JButton in this dialog.
211      * @return JButtonOperator
212      */

213     public JButtonOperator btBack() {
214         if (_btBack==null) {
215             _btBack = new JButtonOperator(this, "< Back"); // NOI18N
216
}
217         return _btBack;
218     }
219
220     /** Tries to find "Next >" JButton in this dialog.
221      * @return JButtonOperator
222      */

223     public JButtonOperator btNext() {
224         if (_btNext==null) {
225             _btNext = new JButtonOperator(this, "Next >"); // NOI18N
226
}
227         return _btNext;
228     }
229
230     /** Tries to find "Finish" JButton in this dialog.
231      * @return JButtonOperator
232      */

233     public JButtonOperator btFinish() {
234         if (_btFinish==null) {
235             _btFinish = new JButtonOperator(this, "Finish"); // NOI18N
236
}
237         return _btFinish;
238     }
239
240     /** Tries to find "Cancel" JButton in this dialog.
241      * @return JButtonOperator
242      */

243     public JButtonOperator btCancel() {
244         if (_btCancel==null) {
245             _btCancel = new JButtonOperator(this, "Cancel"); // NOI18N
246
}
247         return _btCancel;
248     }
249
250     /** Tries to find "Help" JButton in this dialog.
251      * @return JButtonOperator
252      */

253     public JButtonOperator btHelp() {
254         if (_btHelp==null) {
255             _btHelp = new JButtonOperator(this, "Help"); // NOI18N
256
}
257         return _btHelp;
258     }
259
260
261     //****************************************
262
// Low-level functionality definition part
263
//****************************************
264

265     /** gets text for txtClassName
266      * @return String text
267      */

268     public String JavaDoc getClassName() {
269         return txtClassName().getText();
270     }
271
272     /** sets text for txtClassName
273      * @param text String text
274      */

275     public void setClassName(String JavaDoc text) {
276         txtClassName().setText(text);
277     }
278
279     /** types text for txtClassName
280      * @param text String text
281      */

282     public void typeClassName(String JavaDoc text) {
283         txtClassName().typeText(text);
284     }
285
286     /** gets text for txtProject
287      * @return String text
288      */

289     public String JavaDoc getProject() {
290         return txtProject().getText();
291     }
292
293     /** sets text for txtProject
294      * @param text String text
295      */

296     public void setProject(String JavaDoc text) {
297         txtProject().setText(text);
298     }
299
300     /** types text for txtProject
301      * @param text String text
302      */

303     public void typeProject(String JavaDoc text) {
304         txtProject().typeText(text);
305     }
306
307     /** returns selected item for cboLocation
308      * @return String item
309      */

310     public String JavaDoc getSelectedLocation() {
311         return cboLocation().getSelectedItem().toString();
312     }
313
314     /** selects item for cboLocation
315      * @param item String item
316      */

317     public void selectLocation(String JavaDoc item) {
318         cboLocation().selectItem(item);
319     }
320
321     /** returns selected item for cboPackage
322      * @return String item
323      */

324     public String JavaDoc getSelectedPackage() {
325         return cboPackage().getSelectedItem().toString();
326     }
327
328     /** selects item for cboPackage
329      * @param item String item
330      */

331     public void selectPackage(String JavaDoc item) {
332         cboPackage().selectItem(item);
333     }
334
335     /** types text for cboPackage
336      * @param text String text
337      */

338     public void typePackage(String JavaDoc text) {
339         cboPackage().typeText(text);
340     }
341
342     /** gets text for txtCreatedFile
343      * @return String text
344      */

345     public String JavaDoc getCreatedFile() {
346         return txtCreatedFile().getText();
347     }
348
349     /** sets text for txtCreatedFile
350      * @param text String text
351      */

352     public void setCreatedFile(String JavaDoc text) {
353         txtCreatedFile().setText(text);
354     }
355
356     /** types text for txtCreatedFile
357      * @param text String text
358      */

359     public void typeCreatedFile(String JavaDoc text) {
360         txtCreatedFile().typeText(text);
361     }
362
363     /** clicks on "< Back" JButton
364      */

365     public void back() {
366         btBack().push();
367     }
368
369     /** clicks on "Next >" JButton
370      */

371     public void next() {
372         btNext().push();
373     }
374
375     /** clicks on "Finish" JButton
376      */

377     public void finish() {
378         btFinish().push();
379     }
380
381     /** clicks on "Cancel" JButton
382      */

383     public void cancel() {
384         btCancel().push();
385     }
386
387     /** clicks on "Help" JButton
388      */

389     public void help() {
390         btHelp().push();
391     }
392 }
393
394
Popular Tags