KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > i18n > jelly > InternationalizeOperator


1 /*
2  * InternationalizeTestFrameFrameOperator.java
3  *
4  * Created on 10/29/03 5:44 PM
5  */

6 package org.netbeans.i18n.jelly;
7
8 import org.netbeans.jemmy.operators.*;
9 import org.netbeans.jellytools.*;
10 import org.netbeans.jellytools.properties.PropertySheetOperator;
11
12 /** Class implementing all necessary methods for handling "Internationalize [TestFrame]" TopFrameTypeImpl.
13  *
14  * @author eh103527
15  * @version 1.0
16  */

17 public class InternationalizeOperator extends NbDialogOperator {
18     
19     /** Creates new InternationalizeTestFrameFrameOperator that can handle it.
20      */

21     public InternationalizeOperator() {
22         super(Bundle.getStringTrimmed("org.netbeans.modules.i18n.Bundle", "CTL_I18nDialogTitle"));
23     }
24     
25     private JLabelOperator _lblBundleName;
26     private JTextFieldOperator _txtBundleName;
27     private JButtonOperator _btBrowse;
28     private JButtonOperator _btNew;
29     private JLabelOperator _lblComment;
30     private JTextAreaOperator _txtComment;
31     private JButtonOperator _btMetalScrollButton;
32     private JButtonOperator _btMetalScrollButton2;
33     private JLabelOperator _lblKey;
34     private JLabelOperator _lblValue;
35     private JTextAreaOperator _txtValue;
36     private JButtonOperator _btMetalScrollButton3;
37     private JButtonOperator _btMetalScrollButton4;
38     private JComboBoxOperator _cboKey;
39     private JTextFieldOperator _txtReplaceString;
40     private JLabelOperator _lblReplaceString;
41     private JButtonOperator _btFormat;
42     private JButtonOperator _btArguments;
43     private JButtonOperator _btReplace;
44     private JButtonOperator _btSkip;
45     private JButtonOperator _btInfo;
46     private JButtonOperator _btClose;
47     private JButtonOperator _btHelp;
48     
49     
50     //******************************
51
// Subcomponents definition part
52
//******************************
53

54     /** Tries to find "Bundle Name:" JLabel in this dialog.
55      * @return JLabelOperator
56      */

57     public JLabelOperator lblBundleName() {
58         if (_lblBundleName==null) {
59             _lblBundleName = new JLabelOperator(this, Bundle.getStringTrimmed("org.netbeans.modules.i18n.Bundle", "LBL_BundleName"));
60         }
61         return _lblBundleName;
62     }
63     
64     /** Tries to find null JTextField in this dialog.
65      * @return JTextFieldOperator
66      */

67     public JTextFieldOperator txtBundleName() {
68         if (_txtBundleName==null) {
69             _txtBundleName = new JTextFieldOperator(this);
70         }
71         return _txtBundleName;
72     }
73     
74     /** Tries to find "Browse..." JButton in this dialog.
75      * @return JButtonOperator
76      */

77     public JButtonOperator btBrowse() {
78         if (_btBrowse==null) {
79             _btBrowse = new JButtonOperator(this, Bundle.getStringTrimmed("org.netbeans.modules.i18n.Bundle", "CTL_BrowseButton"));
80         }
81         return _btBrowse;
82     }
83     
84     /** Tries to find "New..." JButton in this dialog.
85      * @return JButtonOperator
86      */

87     public JButtonOperator btNew() {
88         if (_btNew==null) {
89             _btNew = new JButtonOperator(this, Bundle.getStringTrimmed("org.netbeans.modules.i18n.Bundle", "CTL_NewButton"));
90         }
91         return _btNew;
92     }
93     
94     /** Tries to find "Comment:" JLabel in this dialog.
95      * @return JLabelOperator
96      */

97     public JLabelOperator lblComment() {
98         if (_lblComment==null) {
99             _lblComment = new JLabelOperator(this, Bundle.getStringTrimmed("org.netbeans.modules.i18n.Bundle", "LBL_Comment"));
100         }
101         return _lblComment;
102     }
103     
104     /** Tries to find null JTextArea in this dialog.
105      * @return JTextAreaOperator
106      */

107     public JTextAreaOperator txtComment() {
108         if (_txtComment==null) {
109             _txtComment = new JTextAreaOperator(this);
110         }
111         return _txtComment;
112     }
113     
114     /** Tries to find null MetalScrollButton in this dialog.
115      * @return JButtonOperator
116      */

117     public JButtonOperator btMetalScrollButton() {
118         if (_btMetalScrollButton==null) {
119             _btMetalScrollButton = new JButtonOperator(this, 2);
120         }
121         return _btMetalScrollButton;
122     }
123     
124     /** Tries to find null MetalScrollButton in this dialog.
125      * @return JButtonOperator
126      */

127     public JButtonOperator btMetalScrollButton2() {
128         if (_btMetalScrollButton2==null) {
129             _btMetalScrollButton2 = new JButtonOperator(this, 3);
130         }
131         return _btMetalScrollButton2;
132     }
133     
134     /** Tries to find "Key:" JLabel in this dialog.
135      * @return JLabelOperator
136      */

137     public JLabelOperator lblKey() {
138         if (_lblKey==null) {
139             _lblKey = new JLabelOperator(this, Bundle.getStringTrimmed("org.netbeans.modules.i18n.Bundle", "LBL_Key"));
140         }
141         return _lblKey;
142     }
143     
144     /** Tries to find "Value:" JLabel in this dialog.
145      * @return JLabelOperator
146      */

147     public JLabelOperator lblValue() {
148         if (_lblValue==null) {
149             _lblValue = new JLabelOperator(this, Bundle.getStringTrimmed("org.netbeans.modules.i18n.Bundle", "LBL_Value"));
150         }
151         return _lblValue;
152     }
153     
154     /** Tries to find null JTextArea in this dialog.
155      * @return JTextAreaOperator
156      */

157     public JTextAreaOperator txtValue() {
158         if (_txtValue==null) {
159             _txtValue = new JTextAreaOperator(this, 1);
160         }
161         return _txtValue;
162     }
163     
164     /** Tries to find null MetalScrollButton in this dialog.
165      * @return JButtonOperator
166      */

167     public JButtonOperator btMetalScrollButton3() {
168         if (_btMetalScrollButton3==null) {
169             _btMetalScrollButton3 = new JButtonOperator(this, 4);
170         }
171         return _btMetalScrollButton3;
172     }
173     
174     /** Tries to find null MetalScrollButton in this dialog.
175      * @return JButtonOperator
176      */

177     public JButtonOperator btMetalScrollButton4() {
178         if (_btMetalScrollButton4==null) {
179             _btMetalScrollButton4 = new JButtonOperator(this, 5);
180         }
181         return _btMetalScrollButton4;
182     }
183     
184     /** Tries to find null JComboBox in this dialog.
185      * @return JComboBoxOperator
186      */

187     public JComboBoxOperator cboKey() {
188         if (_cboKey==null) {
189             _cboKey = new JComboBoxOperator(this);
190         }
191         return _cboKey;
192     }
193     
194     /** Tries to find null JTextField in this dialog.
195      * @return JTextFieldOperator
196      */

197     public JTextFieldOperator txtReplaceString() {
198         if (_txtReplaceString==null) {
199             _txtReplaceString = new JTextFieldOperator(this, 2);
200         }
201         return _txtReplaceString;
202     }
203     
204     /** Tries to find "Replace String:" JLabel in this dialog.
205      * @return JLabelOperator
206      */

207     public JLabelOperator lblReplaceString() {
208         if (_lblReplaceString==null) {
209             _lblReplaceString = new JLabelOperator(this, Bundle.getStringTrimmed("org.netbeans.modules.i18n.Bundle", "LBL_ReplaceFormat"));
210         }
211         return _lblReplaceString;
212     }
213     
214     /** Tries to find "Format..." JButton in this dialog.
215      * @return JButtonOperator
216      */

217     public JButtonOperator btFormat() {
218         if (_btFormat==null) {
219             _btFormat = new JButtonOperator(this, Bundle.getStringTrimmed("org.netbeans.modules.i18n.Bundle", "CTL_Format"));
220         }
221         return _btFormat;
222     }
223     
224     /** Tries to find "Arguments..." JButton in this dialog.
225      * @return JButtonOperator
226      */

227     public JButtonOperator btArguments() {
228         if (_btArguments==null) {
229             _btArguments = new JButtonOperator(this, Bundle.getStringTrimmed("org.netbeans.modules.i18n.Bundle", "LBL_Arguments"));
230         }
231         return _btArguments;
232     }
233     
234     /** Tries to find "Replace" JButton in this dialog.
235      * @return JButtonOperator
236      */

237     public JButtonOperator btReplace() {
238         if (_btReplace==null) {
239             _btReplace = new JButtonOperator(this, Bundle.getStringTrimmed("org.netbeans.modules.i18n.Bundle", "CTL_ReplaceButton"));
240         }
241         return _btReplace;
242     }
243     
244     /** Tries to find "Skip" JButton in this dialog.
245      * @return JButtonOperator
246      */

247     public JButtonOperator btSkip() {
248         if (_btSkip==null) {
249             _btSkip = new JButtonOperator(this, Bundle.getStringTrimmed("org.netbeans.modules.i18n.Bundle", "CTL_ReplaceButton"));
250         }
251         return _btSkip;
252     }
253     
254     /** Tries to find "Info" JButton in this dialog.
255      * @return JButtonOperator
256      */

257     public JButtonOperator btInfo() {
258         if (_btInfo==null) {
259             _btInfo = new JButtonOperator(this, Bundle.getStringTrimmed("org.netbeans.modules.i18n.Bundle", "CTL_InfoButton"));
260         }
261         return _btInfo;
262     }
263     
264     /** Tries to find "Close" JButton in this dialog.
265      * @return JButtonOperator
266      */

267     public JButtonOperator btClose() {
268         if (_btClose==null) {
269             _btClose = new JButtonOperator(this, Bundle.getStringTrimmed("org.netbeans.modules.i18n.Bundle", "CTL_CloseButton"));
270         }
271         return _btClose;
272     }
273     
274     /** Tries to find "Help" JButton in this dialog.
275      * @return JButtonOperator
276      */

277     public JButtonOperator btHelp() {
278         if (_btHelp==null) {
279             _btHelp = new JButtonOperator(this, Bundle.getStringTrimmed("org.netbeans.modules.i18n.Bundle", "CTL_HelpButton"));
280         }
281         return _btHelp;
282     }
283     
284     
285     //****************************************
286
// Low-level functionality definition part
287
//****************************************
288

289     /** gets text for txtBundleName
290      * @return String text
291      */

292     public String JavaDoc getBundleName() {
293         return txtBundleName().getText();
294     }
295     
296     /** sets text for txtBundleName
297      * @param text String text
298      */

299     public void setBundleName(String JavaDoc text) {
300         txtBundleName().setText(text);
301     }
302     
303     /** types text for txtBundleName
304      * @param text String text
305      */

306     public void typeBundleName(String JavaDoc text) {
307         txtBundleName().typeText(text);
308     }
309     
310     /** clicks on "Browse..." JButton
311      */

312     public void browse() {
313         btBrowse().push();
314     }
315     
316     /** clicks on "New..." JButton
317      */

318     public void clickNew() {
319         btNew().push();
320     }
321     
322     /** gets text for txtComment
323      * @return String text
324      */

325     public String JavaDoc getComment() {
326         return txtComment().getText();
327     }
328     
329     /** sets text for txtComment
330      * @param text String text
331      */

332     public void setComment(String JavaDoc text) {
333         txtComment().setText(text);
334     }
335     
336     /** types text for txtComment
337      * @param text String text
338      */

339     public void typeComment(String JavaDoc text) {
340         txtComment().typeText(text);
341     }
342     
343     /** clicks on null MetalScrollButton
344      */

345     public void metalScrollButton() {
346         btMetalScrollButton().push();
347     }
348     
349     /** clicks on null MetalScrollButton
350      */

351     public void metalScrollButton2() {
352         btMetalScrollButton2().push();
353     }
354     
355     /** gets text for txtValue
356      * @return String text
357      */

358     public String JavaDoc getValue() {
359         return txtValue().getText();
360     }
361     
362     /** sets text for txtValue
363      * @param text String text
364      */

365     public void setValue(String JavaDoc text) {
366         txtValue().setText(text);
367     }
368     
369     /** types text for txtValue
370      * @param text String text
371      */

372     public void typeValue(String JavaDoc text) {
373         txtValue().typeText(text);
374     }
375     
376     /** clicks on null MetalScrollButton
377      */

378     public void metalScrollButton3() {
379         btMetalScrollButton3().push();
380     }
381     
382     /** clicks on null MetalScrollButton
383      */

384     public void metalScrollButton4() {
385         btMetalScrollButton4().push();
386     }
387     
388     /** returns selected item for cboKey
389      * @return String item
390      */

391     public String JavaDoc getSelectedKey() {
392         return cboKey().getSelectedItem().toString();
393     }
394     
395     /** selects item for cboKey
396      * @param item String item
397      */

398     public void selectKey(String JavaDoc item) {
399         cboKey().selectItem(item);
400     }
401     
402     /** types text for cboKey
403      * @param text String text
404      */

405     public void typeKey(String JavaDoc text) {
406         cboKey().typeText(text);
407     }
408     
409     /** gets text for txtReplaceString
410      * @return String text
411      */

412     public String JavaDoc getReplaceString() {
413         return txtReplaceString().getText();
414     }
415     
416     /** sets text for txtReplaceString
417      * @param text String text
418      */

419     public void setReplaceString(String JavaDoc text) {
420         txtReplaceString().setText(text);
421     }
422     
423     /** types text for txtReplaceString
424      * @param text String text
425      */

426     public void typeReplaceString(String JavaDoc text) {
427         txtReplaceString().typeText(text);
428     }
429     
430     /** clicks on "Format..." JButton
431      */

432     public void format() {
433         btFormat().push();
434     }
435     
436     /** clicks on "Arguments..." JButton
437      */

438     public void arguments() {
439         btArguments().push();
440     }
441     
442     /** clicks on "Replace" JButton
443      */

444     public void replace() {
445         btReplace().push();
446     }
447     
448     /** clicks on "Skip" JButton
449      */

450     public void skip() {
451         btSkip().push();
452     }
453     
454     /** clicks on "Info" JButton
455      */

456     public void info() {
457         btInfo().push();
458     }
459     
460     /** clicks on "Close" JButton
461      */

462     public void close() {
463         btClose().push();
464     }
465     
466     /** clicks on "Help" JButton
467      */

468     public void help() {
469         btHelp().push();
470     }
471     
472     
473     //*****************************************
474
// High-level functionality definition part
475
//*****************************************
476

477     /** Performs verification of InternationalizeTestFrameFrameOperator by accessing all its components.
478      */

479     public void verify() {
480         lblBundleName();
481         txtBundleName();
482         btBrowse();
483         btNew();
484         lblComment();
485         txtComment();
486         btMetalScrollButton();
487         btMetalScrollButton2();
488         lblKey();
489         lblValue();
490         txtValue();
491         btMetalScrollButton3();
492         btMetalScrollButton4();
493         cboKey();
494         txtReplaceString();
495         lblReplaceString();
496         btFormat();
497         btArguments();
498         btReplace();
499         btSkip();
500         btInfo();
501         btClose();
502         btHelp();
503     }
504     
505     public void createNewBundle(String JavaDoc name) {
506         btNew().pushNoBlock();
507         NewBundleOperator nbo=new NewBundleOperator();
508         
509     }
510     
511     /** Performs simple test of InternationalizeTestFrameFrameOperator
512      * @param args the command line arguments
513      */

514     public static void main(String JavaDoc args[]) {
515         new InternationalizeOperator().verify();
516         System.out.println("InternationalizeOperator verification finished.");
517     }
518 }
519
520
Popular Tags