KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > test > subversion > operators > MergeTwoRepoOperator


1 /*
2  * MergeTwoRepoOperator.java
3  *
4  * Created on 16/05/06 17:27
5  */

6 package org.netbeans.test.subversion.operators;
7
8 import org.netbeans.jemmy.operators.*;
9 import org.netbeans.jemmy.util.NameComponentChooser;
10
11 /** Class implementing all necessary methods for handling "Merge AnagramGame to..." NbDialog.
12  *
13  * @author peter
14  * @version 1.0
15  */

16 public class MergeTwoRepoOperator extends JDialogOperator {
17
18     /**
19      * Creates new MergeTwoRepoOperator that can handle it.
20      */

21     public MergeTwoRepoOperator() {
22         super("Merge");
23     }
24
25     private JLabelOperator _lblSecondRepositoryFolder;
26     private JLabelOperator _lblStartingWithRevision;
27     private JLabelOperator _lblEndingWithRevision;
28     private JLabelOperator _lblFirstRepositoryFolder;
29     private JLabelOperator _lblEmptyMeansRepositoryHEAD;
30     private JComboBoxOperator _cboMergeFrom;
31     private JComboBoxOperator _cboRepository1;
32     private JTextFieldOperator _txtStartRevision;
33     private JButtonOperator _btSearch;
34     private JTextFieldOperator _txtEndRevision;
35     private JButtonOperator _btSearch2;
36     private JLabelOperator _lblEmptyMeansRepositoryHEAD2;
37     private JButtonOperator _btBrowse1;
38     private JButtonOperator _btBrowse2;
39     private JLabelOperator _lblMergeIntoLocalFolderChangesBetweenTwoRepositoryFolders;
40     private JLabelOperator _lblMergeFrom;
41     private JComboBoxOperator _cboRepository2;
42     private JLabelOperator _lblJLabel;
43     private JTextFieldOperator _txtRepositoryFolder1;
44     private JTextFieldOperator _txtCurrentFolder;
45     private JTextFieldOperator _txtRepositoryFolder2;
46     private JLabelOperator _lblPreview;
47     private JButtonOperator _btMerge;
48     private JButtonOperator _btCancel;
49     private JButtonOperator _btHelp;
50
51
52     //******************************
53
// Subcomponents definition part
54
//******************************
55

56     /** Tries to find "Second Repository Folder:" JLabel in this dialog.
57      * @return JLabelOperator
58      */

59     public JLabelOperator lblSecondRepositoryFolder() {
60         if (_lblSecondRepositoryFolder==null) {
61             _lblSecondRepositoryFolder = new JLabelOperator(this, "Second Repository Folder");
62         }
63         return _lblSecondRepositoryFolder;
64     }
65
66     /** Tries to find "Starting with Revision:" JLabel in this dialog.
67      * @return JLabelOperator
68      */

69     public JLabelOperator lblStartingWithRevision() {
70         if (_lblStartingWithRevision==null) {
71             _lblStartingWithRevision = new JLabelOperator(this, "Starting");
72         }
73         return _lblStartingWithRevision;
74     }
75
76     /** Tries to find "Ending with Revision:" JLabel in this dialog.
77      * @return JLabelOperator
78      */

79     public JLabelOperator lblEndingWithRevision() {
80         if (_lblEndingWithRevision==null) {
81             _lblEndingWithRevision = new JLabelOperator(this, "Ending");
82         }
83         return _lblEndingWithRevision;
84     }
85
86     /** Tries to find "First Repository Folder:" JLabel in this dialog.
87      * @return JLabelOperator
88      */

89     public JLabelOperator lblFirstRepositoryFolder() {
90         if (_lblFirstRepositoryFolder==null) {
91             _lblFirstRepositoryFolder = new JLabelOperator(this, "First Repository Folder");
92         }
93         return _lblFirstRepositoryFolder;
94     }
95
96     /** Tries to find "(empty means repository HEAD)" JLabel in this dialog.
97      * @return JLabelOperator
98      */

99     public JLabelOperator lblEmptyMeansRepositoryHEAD() {
100         if (_lblEmptyMeansRepositoryHEAD==null) {
101             _lblEmptyMeansRepositoryHEAD = new JLabelOperator(this, "(empty means repository HEAD)");
102         }
103         return _lblEmptyMeansRepositoryHEAD;
104     }
105
106     /** Tries to find null JComboBox in this dialog.
107      * @return JComboBoxOperator
108      */

109     public JComboBoxOperator cboMergeFrom() {
110         if (_cboMergeFrom==null) {
111             _cboMergeFrom = new JComboBoxOperator(this, 2);
112         }
113         return _cboMergeFrom;
114     }
115
116     /** Tries to find null JComboBox in this dialog.
117      * @return JComboBoxOperator
118      */

119     public JComboBoxOperator cboRepository1() {
120         if (_cboRepository1==null) {
121             _cboRepository1 = new JComboBoxOperator(this, 1);
122         }
123         return _cboRepository1;
124     }
125
126     /** Tries to find null JTextField in this dialog.
127      * @return JTextFieldOperator
128      */

129     public JTextFieldOperator txtStartRevision() {
130         if (_txtStartRevision==null) {
131             _txtStartRevision = new JTextFieldOperator(this, 2);
132         }
133         return _txtStartRevision;
134     }
135
136     /** Tries to find "Search..." JButton in this dialog.
137      * @return JButtonOperator
138      */

139     public JButtonOperator btSearch() {
140         if (_btSearch==null) {
141             _btSearch = new JButtonOperator(this, "Search...");
142         }
143         return _btSearch;
144     }
145
146     /** Tries to find null JTextField in this dialog.
147      * @return JTextFieldOperator
148      */

149     public JTextFieldOperator txtEndRevision() {
150         if (_txtEndRevision==null) {
151             _txtEndRevision = new JTextFieldOperator(this, 3);
152         }
153         return _txtEndRevision;
154     }
155
156     /** Tries to find "Search..." JButton in this dialog.
157      * @return JButtonOperator
158      */

159     public JButtonOperator btSearch2() {
160         if (_btSearch2==null) {
161             _btSearch2 = new JButtonOperator(this, "Search...", 1);
162         }
163         return _btSearch2;
164     }
165
166     /** Tries to find "(empty means repository HEAD)" JLabel in this dialog.
167      * @return JLabelOperator
168      */

169     public JLabelOperator lblEmptyMeansRepositoryHEAD2() {
170         if (_lblEmptyMeansRepositoryHEAD2==null) {
171             _lblEmptyMeansRepositoryHEAD2 = new JLabelOperator(this, "(empty means repository HEAD)", 1);
172         }
173         return _lblEmptyMeansRepositoryHEAD2;
174     }
175
176     /** Tries to find "Browse..." JButton in this dialog.
177      * @return JButtonOperator
178      */

179     public JButtonOperator btBrowseRepositoryFolder1() {
180         if (_btBrowse1==null) {
181             _btBrowse1 = new JButtonOperator(this, "Browse", 1);
182         }
183         return _btBrowse1;
184     }
185
186     /** Tries to find "Browse..." JButton in this dialog.
187      * @return JButtonOperator
188      */

189     public JButtonOperator btBrowseRepositoryFolder2() {
190         if (_btBrowse2==null) {
191             _btBrowse2 = new JButtonOperator(this, "Browse");
192         }
193         return _btBrowse2;
194     }
195
196     /** Tries to find "Merge into local folder changes between two repository folders." JLabel in this dialog.
197      * @return JLabelOperator
198      */

199     public JLabelOperator lblMergeIntoLocalFolderChangesBetweenTwoRepositoryFolders() {
200         if (_lblMergeIntoLocalFolderChangesBetweenTwoRepositoryFolders==null) {
201             _lblMergeIntoLocalFolderChangesBetweenTwoRepositoryFolders = new JLabelOperator(this, "Merge into local folder changes between two repository folders.");
202         }
203         return _lblMergeIntoLocalFolderChangesBetweenTwoRepositoryFolders;
204     }
205
206     /** Tries to find "Merge from:" JLabel in this dialog.
207      * @return JLabelOperator
208      */

209     public JLabelOperator lblMergeFrom() {
210         if (_lblMergeFrom==null) {
211             _lblMergeFrom = new JLabelOperator(this, "Merge from:");
212         }
213         return _lblMergeFrom;
214     }
215
216     /** Tries to find null JComboBox in this dialog.
217      * @return JComboBoxOperator
218      */

219     public JComboBoxOperator cboRepository2() {
220         if (_cboRepository2==null) {
221             _cboRepository2 = new JComboBoxOperator(this);
222         }
223         return _cboRepository2;
224     }
225
226     /** Tries to find null JLabel in this dialog.
227      * @return JLabelOperator
228      */

229     public JLabelOperator lblJLabel() {
230         if (_lblJLabel==null) {
231             _lblJLabel = new JLabelOperator(this, 8);
232         }
233         return _lblJLabel;
234     }
235
236     /** Tries to find null JTextField in this dialog.
237      * @return JTextFieldOperator
238      */

239     public JTextFieldOperator txtRepositoryFolder1() {
240         if (_txtRepositoryFolder1==null) {
241             _txtRepositoryFolder1 = new JTextFieldOperator(this, 4);
242         }
243         return _txtRepositoryFolder1;
244     }
245
246     /** Tries to find null JTextField in this dialog.
247      * @return JTextFieldOperator
248      */

249     public JTextFieldOperator txtCurrentFolder() {
250         if (_txtCurrentFolder==null) {
251             _txtCurrentFolder = new JTextFieldOperator(this, 5);
252         }
253         return _txtCurrentFolder;
254     }
255
256     /** Tries to find null JTextField in this dialog.
257      * @return JTextFieldOperator
258      */

259     public JTextFieldOperator txtRepositoryFolder2() {
260         if (_txtRepositoryFolder2==null) {
261             _txtRepositoryFolder2 = new JTextFieldOperator(this, 6);
262         }
263         return _txtRepositoryFolder2;
264     }
265
266     /** Tries to find "Preview:" JLabel in this dialog.
267      * @return JLabelOperator
268      */

269     public JLabelOperator lblPreview() {
270         if (_lblPreview==null) {
271             _lblPreview = new JLabelOperator(this, "Preview:");
272         }
273         return _lblPreview;
274     }
275
276     /** Tries to find "Merge" JButton in this dialog.
277      * @return JButtonOperator
278      */

279     public JButtonOperator btMerge() {
280         if (_btMerge==null) {
281             _btMerge = new JButtonOperator(this, "Merge");
282         }
283         return _btMerge;
284     }
285
286     /** Tries to find "Cancel" JButton in this dialog.
287      * @return JButtonOperator
288      */

289     public JButtonOperator btCancel() {
290         if (_btCancel==null) {
291             _btCancel = new JButtonOperator(this, "Cancel");
292         }
293         return _btCancel;
294     }
295
296     /** Tries to find "Help" JButton in this dialog.
297      * @return JButtonOperator
298      */

299     public JButtonOperator btHelp() {
300         if (_btHelp==null) {
301             _btHelp = new JButtonOperator(this, "Help");
302         }
303         return _btHelp;
304     }
305
306
307     //****************************************
308
// Low-level functionality definition part
309
//****************************************
310

311     /**
312      * returns selected item for cboMergeFrom
313      *
314      * @return String item
315      */

316     public String JavaDoc getSelectedMergeFrom() {
317         return cboMergeFrom().getSelectedItem().toString();
318     }
319
320     /**
321      * selects item for cboMergeFrom
322      *
323      * @param item String item
324      */

325     public void selectMergeFrom(String JavaDoc item) {
326         cboMergeFrom().selectItem(item);
327     }
328
329     /**
330      * types text for cboMergeFrom
331      *
332      * @param text String text
333      */

334     public void setMergeFrom(String JavaDoc text) {
335         cboMergeFrom().clearText();
336         cboMergeFrom().typeText(text);
337     }
338
339     /**
340      * returns selected item for cboRepository1
341      *
342      * @return String item
343      */

344     public String JavaDoc getSelectedRepositoryFolder1() {
345         return cboRepository1().getSelectedItem().toString();
346     }
347
348     public String JavaDoc getRepositoryFolder1() {
349         return cboRepository1().getEditor().getItem().toString();
350     }
351     
352     /**
353      * selects item for cboRepository1
354      *
355      * @param item String item
356      */

357     public void selectRepositoryFolder1(String JavaDoc item) {
358         cboRepository1().selectItem(item);
359     }
360
361     /**
362      * types text for cboRepository1
363      *
364      * @param text String text
365      */

366     public void setRepositoryFolder1(String JavaDoc text) {
367         cboRepository1().clearText();
368         cboRepository1().typeText(text);
369     }
370
371     /**
372      * gets text for txtStartRevision
373      *
374      * @return String text
375      */

376     public String JavaDoc getStartRevision() {
377         return txtStartRevision().getText();
378     }
379
380     /**
381      * sets text for txtStartRevision
382      *
383      * @param text String text
384      */

385     public void setStartRevision(String JavaDoc text) {
386         txtStartRevision().clearText();
387         txtStartRevision().typeText(text);
388     }
389
390     /** clicks on "Search..." JButton
391      */

392     public void search() {
393         btSearch().push();
394     }
395
396     /**
397      * gets text for txtEndRevision
398      *
399      * @return String text
400      */

401     public String JavaDoc getEndRevision() {
402         return txtEndRevision().getText();
403     }
404
405     /**
406      * sets text for txtEndRevision
407      *
408      * @param text String text
409      */

410     public void setEndRevision(String JavaDoc text) {
411         txtEndRevision().clearText();
412         txtEndRevision().typeText(text);
413     }
414
415     /** clicks on "Search..." JButton
416      */

417     public void search2() {
418         btSearch2().push();
419     }
420
421     /** clicks on "Browse..." JButton
422      */

423     public RepositoryBrowserOperator browseRepositoryFolder1() {
424         btBrowseRepositoryFolder1().pushNoBlock();
425         return new RepositoryBrowserOperator();
426     }
427
428     /** clicks on "Browse..." JButton
429      */

430     public RepositoryBrowserOperator browseRepositoryFolder2() {
431         btBrowseRepositoryFolder2().pushNoBlock();
432         return new RepositoryBrowserOperator();
433     }
434
435     /**
436      * returns selected item for cboRepository2
437      *
438      * @return String item
439      */

440     public String JavaDoc getSelectedRepositoryFolder2() {
441         return cboRepository2().getSelectedItem().toString();
442     }
443
444     public String JavaDoc getRepositoryFolder2() {
445         return cboRepository2().getEditor().getItem().toString();
446     }
447     
448     /**
449      * selects item for cboRepository2
450      *
451      * @param item String item
452      */

453     public void selectRepositoryFolder2(String JavaDoc item) {
454         cboRepository2().selectItem(item);
455     }
456     
457     /**
458      * types text for cboRepository1
459      *
460      * @param text String text
461      */

462     public void setRepositoryFolder2(String JavaDoc text) {
463         cboRepository2().clearText();
464         cboRepository2().typeText(text);
465     }
466
467     /**
468      * gets text for txtRepositoryFolder1
469      *
470      * @return String text
471      */

472     public String JavaDoc getTxtRepositoryFolder1() {
473         return txtRepositoryFolder1().getText();
474     }
475
476     /**
477      * gets text for txtCurrentFolder
478      *
479      * @return String text
480      */

481     public String JavaDoc getTxtCurrentFolder() {
482         return txtCurrentFolder().getText();
483     }
484
485     /**
486      * gets text for txtRepositoryFolder2
487      *
488      * @return String text
489      */

490     public String JavaDoc getTxtRepositoryFolder2() {
491         return txtRepositoryFolder2().getText();
492     }
493
494     /** clicks on "Merge" JButton
495      */

496     public void merge() {
497         btMerge().push();
498     }
499
500     /** clicks on "Cancel" JButton
501      */

502     public void cancel() {
503         btCancel().push();
504     }
505
506     /** clicks on "Help" JButton
507      */

508     public void help() {
509         btHelp().push();
510     }
511
512
513     //*****************************************
514
// High-level functionality definition part
515
//*****************************************
516

517     /**
518      * Performs verification of MergeTwoRepoOperator by accessing all its components.
519      */

520     public void verify() {
521         lblSecondRepositoryFolder();
522         lblStartingWithRevision();
523         lblEndingWithRevision();
524         lblFirstRepositoryFolder();
525         lblEmptyMeansRepositoryHEAD();
526         cboMergeFrom();
527         cboRepository1();
528         txtStartRevision();
529         btSearch();
530         txtEndRevision();
531         btSearch2();
532         lblEmptyMeansRepositoryHEAD2();
533         btBrowseRepositoryFolder1();
534         btBrowseRepositoryFolder2();
535         lblMergeIntoLocalFolderChangesBetweenTwoRepositoryFolders();
536         lblMergeFrom();
537         cboRepository2();
538         lblJLabel();
539         txtRepositoryFolder1();
540         txtCurrentFolder();
541         txtRepositoryFolder2();
542         lblPreview();
543         btMerge();
544         btCancel();
545         btHelp();
546     }
547 }
548
549
Popular Tags