KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2  * MergeOneRepoOperator.java
3  *
4  * Created on 16/05/06 17:25
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 MergeOneRepoOperator extends JDialogOperator {
17
18     /**
19      * Creates new MergeOneRepoOperator that can handle it.
20      */

21     public MergeOneRepoOperator() {
22         super("Merge");
23     }
24
25     private JLabelOperator _lblEndingWithRevision;
26     private JLabelOperator _lblStartingWithRevision;
27     private JLabelOperator _lblFirstRepositoryFolder;
28     private JLabelOperator _lblEmptyMeansRepositoryHEAD;
29     private JLabelOperator _lblEmptyMeansRepositoryHEAD2;
30     private JTextFieldOperator _txtStartRevision;
31     private JButtonOperator _btSearch;
32     private JTextFieldOperator _txtEndRevision;
33     private JButtonOperator _btSearch2;
34     private JComboBoxOperator _cboMergeFrom;
35     private JButtonOperator _btBrowse;
36     private JLabelOperator _lblMergeIntoLocalFolderChangesFromOneRepositoryFolder;
37     private JLabelOperator _lblMergeFrom;
38     private JComboBoxOperator _cboRepository;
39     private JLabelOperator _lblJLabel;
40     private JTextFieldOperator _txtRepostiryFolder;
41     private JTextFieldOperator _txtCurrentFolder;
42     private JLabelOperator _lblPreview;
43     private JButtonOperator _btMerge;
44     private JButtonOperator _btCancel;
45     private JButtonOperator _btHelp;
46
47
48     //******************************
49
// Subcomponents definition part
50
//******************************
51

52     /** Tries to find "Ending with Revision:" JLabel in this dialog.
53      * @return JLabelOperator
54      */

55     public JLabelOperator lblEndingWithRevision() {
56         if (_lblEndingWithRevision==null) {
57             _lblEndingWithRevision = new JLabelOperator(this, "Ending");
58         }
59         return _lblEndingWithRevision;
60     }
61
62     /** Tries to find "Starting with Revision:" JLabel in this dialog.
63      * @return JLabelOperator
64      */

65     public JLabelOperator lblStartingWithRevision() {
66         if (_lblStartingWithRevision==null) {
67             _lblStartingWithRevision = new JLabelOperator(this, "Starting");
68         }
69         return _lblStartingWithRevision;
70     }
71
72     /** Tries to find "First Repository Folder:" JLabel in this dialog.
73      * @return JLabelOperator
74      */

75     public JLabelOperator lblFirstRepositoryFolder() {
76         if (_lblFirstRepositoryFolder==null) {
77             _lblFirstRepositoryFolder = new JLabelOperator(this, "Repository Folder");
78         }
79         return _lblFirstRepositoryFolder;
80     }
81
82     /** Tries to find "(empty means repository HEAD)" JLabel in this dialog.
83      * @return JLabelOperator
84      */

85     public JLabelOperator lblEmptyMeansRepositoryHEAD() {
86         if (_lblEmptyMeansRepositoryHEAD==null) {
87             _lblEmptyMeansRepositoryHEAD = new JLabelOperator(this, "(empty means repository HEAD)");
88         }
89         return _lblEmptyMeansRepositoryHEAD;
90     }
91
92     /** Tries to find "(empty means repository HEAD)" JLabel in this dialog.
93      * @return JLabelOperator
94      */

95     public JLabelOperator lblEmptyMeansRepositoryHEAD2() {
96         if (_lblEmptyMeansRepositoryHEAD2==null) {
97             _lblEmptyMeansRepositoryHEAD2 = new JLabelOperator(this, "(empty means repository HEAD)", 1);
98         }
99         return _lblEmptyMeansRepositoryHEAD2;
100     }
101
102     /** Tries to find null JTextField in this dialog.
103      * @return JTextFieldOperator
104      */

105     public JTextFieldOperator txtStartReivison() {
106         if (_txtStartRevision==null) {
107             _txtStartRevision = new JTextFieldOperator(this);
108         }
109         return _txtStartRevision;
110     }
111
112     /** Tries to find "Search..." JButton in this dialog.
113      * @return JButtonOperator
114      */

115     public JButtonOperator btSearch() {
116         if (_btSearch==null) {
117             _btSearch = new JButtonOperator(this, "Search...");
118         }
119         return _btSearch;
120     }
121
122     /** Tries to find null JTextField in this dialog.
123      * @return JTextFieldOperator
124      */

125     public JTextFieldOperator txtEndRevision() {
126         if (_txtEndRevision==null) {
127             _txtEndRevision = new JTextFieldOperator(this, 1);
128         }
129         return _txtEndRevision;
130     }
131
132     /** Tries to find "Search..." JButton in this dialog.
133      * @return JButtonOperator
134      */

135     public JButtonOperator btSearch2() {
136         if (_btSearch2==null) {
137             _btSearch2 = new JButtonOperator(this, "Search...", 1);
138         }
139         return _btSearch2;
140     }
141
142     /** Tries to find null JComboBox in this dialog.
143      * @return JComboBoxOperator
144      */

145     public JComboBoxOperator cboMergeFrom() {
146         if (_cboMergeFrom==null) {
147             _cboMergeFrom = new JComboBoxOperator(this, 1);
148         }
149         return _cboMergeFrom;
150     }
151
152     /** Tries to find "Browse..." JButton in this dialog.
153      * @return JButtonOperator
154      */

155     public JButtonOperator btBrowse() {
156         if (_btBrowse==null) {
157             _btBrowse = new JButtonOperator(this, "Browse");
158         }
159         return _btBrowse;
160     }
161
162     /** Tries to find "Merge into local folder changes from one repository folder." JLabel in this dialog.
163      * @return JLabelOperator
164      */

165     public JLabelOperator lblMergeIntoLocalFolderChangesFromOneRepositoryFolder() {
166         if (_lblMergeIntoLocalFolderChangesFromOneRepositoryFolder==null) {
167             _lblMergeIntoLocalFolderChangesFromOneRepositoryFolder = new JLabelOperator(this, "Merge into local folder changes from one repository folder.");
168         }
169         return _lblMergeIntoLocalFolderChangesFromOneRepositoryFolder;
170     }
171
172     /** Tries to find "Merge from:" JLabel in this dialog.
173      * @return JLabelOperator
174      */

175     public JLabelOperator lblMergeFrom() {
176         if (_lblMergeFrom==null) {
177             _lblMergeFrom = new JLabelOperator(this, "Merge from:");
178         }
179         return _lblMergeFrom;
180     }
181
182     /** Tries to find null JComboBox in this dialog.
183      * @return JComboBoxOperator
184      */

185     public JComboBoxOperator cboRepository() {
186         if (_cboRepository==null) {
187             _cboRepository = new JComboBoxOperator(this);
188         }
189         return _cboRepository;
190     }
191
192     /** Tries to find null JLabel in this dialog.
193      * @return JLabelOperator
194      */

195     public JLabelOperator lblJLabel() {
196         if (_lblJLabel==null) {
197             _lblJLabel = new JLabelOperator(this, 7);
198         }
199         return _lblJLabel;
200     }
201
202     /** Tries to find null JTextField in this dialog.
203      * @return JTextFieldOperator
204      */

205     public JTextFieldOperator txtRepostiryFolder() {
206         if (_txtRepostiryFolder==null) {
207             _txtRepostiryFolder = new JTextFieldOperator(this, 3);
208         }
209         return _txtRepostiryFolder;
210     }
211
212     /** Tries to find null JTextField in this dialog.
213      * @return JTextFieldOperator
214      */

215     public JTextFieldOperator txtCurrentFolder() {
216         if (_txtCurrentFolder==null) {
217             _txtCurrentFolder = new JTextFieldOperator(this, 4);
218         }
219         return _txtCurrentFolder;
220     }
221
222     /** Tries to find "Preview:" JLabel in this dialog.
223      * @return JLabelOperator
224      */

225     public JLabelOperator lblPreview() {
226         if (_lblPreview==null) {
227             _lblPreview = new JLabelOperator(this, "Preview:");
228         }
229         return _lblPreview;
230     }
231
232     /** Tries to find "Merge" JButton in this dialog.
233      * @return JButtonOperator
234      */

235     public JButtonOperator btMerge() {
236         if (_btMerge==null) {
237             _btMerge = new JButtonOperator(this, "Merge");
238         }
239         return _btMerge;
240     }
241
242     /** Tries to find "Cancel" JButton in this dialog.
243      * @return JButtonOperator
244      */

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

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

267     /**
268      * gets text for txtStartReivison
269      *
270      * @return String text
271      */

272     public String JavaDoc getStartRevision() {
273         return txtStartReivison().getText();
274     }
275
276     /**
277      * sets text for txtStartReivison
278      *
279      * @param text String text
280      */

281     public void setStartRevision(String JavaDoc text) {
282         txtStartReivison().clearText();
283         txtStartReivison().typeText(text);
284     }
285
286     /** clicks on "Search..." JButton
287      */

288     public void search() {
289         btSearch().push();
290     }
291
292     /**
293      * gets text for txtEndRevision
294      *
295      * @return String text
296      */

297     public String JavaDoc getEndRevision() {
298         return txtEndRevision().getText();
299     }
300
301     /**
302      * sets text for txtEndRevision
303      *
304      * @param text String text
305      */

306     public void setEndRevision(String JavaDoc text) {
307         txtEndRevision().clearText();
308         txtEndRevision().typeText(text);
309     }
310
311     /** clicks on "Search..." JButton
312      */

313     public void search2() {
314         btSearch2().push();
315     }
316
317     /**
318      * returns selected item for cboMergeFrom
319      *
320      * @return String item
321      */

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

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

340     public void setMergeFrom(String JavaDoc text) {
341         cboMergeFrom().clearText();
342         cboMergeFrom().typeText(text);
343     }
344
345     /** clicks on "Browse..." JButton
346      */

347     public RepositoryBrowserOperator browseRepository() {
348         btBrowse().pushNoBlock();
349         return new RepositoryBrowserOperator();
350     }
351
352     /**
353      * returns selected item for cboRepository
354      *
355      * @return String item
356      */

357     public String JavaDoc getSelectedRepository() {
358         return cboRepository().getSelectedItem().toString();
359     }
360
361     public String JavaDoc getRepositoryFolder() {
362         return cboRepository().getEditor().getItem().toString();
363     }
364     /**
365      * selects item for cboRepository
366      *
367      * @param item String item
368      */

369     public void selectRepositoryFolder(String JavaDoc item) {
370         cboRepository().selectItem(item);
371     }
372     
373     public void setRepositoryFolder(String JavaDoc text) {
374         cboRepository().clearText();
375         cboRepository().typeText(text);
376     }
377
378     /**
379      * gets text for txtRepostiryFolder
380      *
381      * @return String text
382      */

383     public String JavaDoc getTxtRepositoryFolder() {
384         return txtRepostiryFolder().getText();
385     }
386
387     /**
388      * gets text for txtCurrentFolder
389      *
390      * @return String text
391      */

392     public String JavaDoc getTxtCurrentFolder() {
393         return txtCurrentFolder().getText();
394     }
395
396     /** clicks on "Merge" JButton
397      */

398     public void merge() {
399         btMerge().push();
400     }
401
402     /** clicks on "Cancel" JButton
403      */

404     public void cancel() {
405         btCancel().push();
406     }
407
408     /** clicks on "Help" JButton
409      */

410     public void help() {
411         btHelp().push();
412     }
413
414
415     //*****************************************
416
// High-level functionality definition part
417
//*****************************************
418

419     /**
420      * Performs verification of MergeOneRepoOperator by accessing all its components.
421      */

422     public void verify() {
423         lblEndingWithRevision();
424         lblStartingWithRevision();
425         lblFirstRepositoryFolder();
426         lblEmptyMeansRepositoryHEAD();
427         lblEmptyMeansRepositoryHEAD2();
428         txtStartReivison();
429         btSearch();
430         txtEndRevision();
431         btSearch2();
432         cboMergeFrom();
433         btBrowse();
434         lblMergeIntoLocalFolderChangesFromOneRepositoryFolder();
435         lblMergeFrom();
436         cboRepository();
437         lblJLabel();
438         txtRepostiryFolder();
439         txtCurrentFolder();
440         lblPreview();
441         btMerge();
442         btCancel();
443         btHelp();
444     }
445 }
446
447
Popular Tags