KickJava   Java API By Example, From Geeks To Geeks.

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


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

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

47     /** Tries to find "Repository Folder:" JLabel in this dialog.
48      * @return JLabelOperator
49      */

50     public JLabelOperator lblRepositoryFolder() {
51         if (_lblRepositoryFolder==null) {
52             _lblRepositoryFolder = new JLabelOperator(this, "Repository Folder");
53         }
54         return _lblRepositoryFolder;
55     }
56
57     /** Tries to find "Ending with Revision:" JLabel in this dialog.
58      * @return JLabelOperator
59      */

60     public JLabelOperator lblEndingWithRevision() {
61         if (_lblEndingWithRevision==null) {
62             _lblEndingWithRevision = new JLabelOperator(this, "Ending");
63         }
64         return _lblEndingWithRevision;
65     }
66
67     /** Tries to find "(empty means repository HEAD)" JLabel in this dialog.
68      * @return JLabelOperator
69      */

70     public JLabelOperator lblEmptyMeansRepositoryHEAD() {
71         if (_lblEmptyMeansRepositoryHEAD==null) {
72             _lblEmptyMeansRepositoryHEAD = new JLabelOperator(this, "(empty means repository HEAD)");
73         }
74         return _lblEmptyMeansRepositoryHEAD;
75     }
76
77
78     /** Tries to find "Merge into local folder changes from one repository folder since its origin." JLabel in this dialog.
79      * @return JLabelOperator
80      */

81     public JLabelOperator lblMergeIntoLocalFolderChangesFromOneRepositoryFolderSinceItsOrigin() {
82         if (_lblMergeIntoLocalFolderChangesFromOneRepositoryFolderSinceItsOrigin==null) {
83             _lblMergeIntoLocalFolderChangesFromOneRepositoryFolderSinceItsOrigin = new JLabelOperator(this, "Merge into local folder changes from one repository folder since its origin.");
84         }
85         return _lblMergeIntoLocalFolderChangesFromOneRepositoryFolderSinceItsOrigin;
86     }
87
88     /** Tries to find "Merge from:" JLabel in this dialog.
89      * @return JLabelOperator
90      */

91     public JLabelOperator lblMergeFrom() {
92         if (_lblMergeFrom==null) {
93             _lblMergeFrom = new JLabelOperator(this, "Merge from:");
94         }
95         return _lblMergeFrom;
96     }
97
98     /** Tries to find null JLabel in this dialog.
99      * @return JLabelOperator
100      */

101     public JLabelOperator lblJLabel() {
102         if (_lblJLabel==null) {
103             _lblJLabel = new JLabelOperator(this, 5);
104         }
105         return _lblJLabel;
106     }
107
108     /** Tries to find "Preview:" JLabel in this dialog.
109      * @return JLabelOperator
110      */

111     public JLabelOperator lblPreview() {
112         if (_lblPreview==null) {
113             _lblPreview = new JLabelOperator(this, "Preview:");
114         }
115         return _lblPreview;
116     }
117
118     /** Tries to find "Search..." JButton in this dialog.
119      * @return JButtonOperator
120      */

121     public JButtonOperator btSearch() {
122         if (_btSearch==null) {
123             _btSearch = new JButtonOperator(this, "Search...");
124         }
125         return _btSearch;
126     }
127     
128     /** Tries to find null JTextField in this dialog.
129      * @return JTextFieldOperator
130      */

131     public JTextFieldOperator txtEndRevision() {
132         if (_txtEndRevision==null) {
133             _txtEndRevision = new JTextFieldOperator(this);
134         }
135         return _txtEndRevision;
136     }
137     
138     /** Tries to find null JComboBox in this dialog.
139      * @return JComboBoxOperator
140      */

141     public JComboBoxOperator cboJComboBox() {
142         if (_cboMergeFrom==null) {
143             _cboMergeFrom = new JComboBoxOperator(this, 1);
144         }
145         return _cboMergeFrom;
146     }
147
148     /** Tries to find "Browse..." JButton in this dialog.
149      * @return JButtonOperator
150      */

151     public JButtonOperator btBrowse() {
152         if (_btBrowse==null) {
153             _btBrowse = new JButtonOperator(this, "Browse");
154         }
155         return _btBrowse;
156     }
157         
158     /** Tries to find null JComboBox in this dialog.
159      * @return JComboBoxOperator
160      */

161     public JComboBoxOperator cboRepository() {
162         if (_cboRepository==null) {
163             _cboRepository = new JComboBoxOperator(this);
164         }
165         return _cboRepository;
166     }
167     
168     /** Tries to find null JTextField in this dialog.
169      * @return JTextFieldOperator
170      */

171     public JTextFieldOperator txtRepostiryFolder() {
172         if (_txtRepostiryFolder==null) {
173             _txtRepostiryFolder = new JTextFieldOperator(this, 2);
174         }
175         return _txtRepostiryFolder;
176     }
177
178     /** Tries to find null JTextField in this dialog.
179      * @return JTextFieldOperator
180      */

181     public JTextFieldOperator txtCurrentFolder() {
182         if (_txtCurrentFolder==null) {
183             _txtCurrentFolder = new JTextFieldOperator(this, 3);
184         }
185         return _txtCurrentFolder;
186     }
187     
188     /** Tries to find "Merge" JButton in this dialog.
189      * @return JButtonOperator
190      */

191     public JButtonOperator btMerge() {
192         if (_btMerge==null) {
193             _btMerge = new JButtonOperator(this, "Merge");
194         }
195         return _btMerge;
196     }
197
198     /** Tries to find "Cancel" JButton in this dialog.
199      * @return JButtonOperator
200      */

201     public JButtonOperator btCancel() {
202         if (_btCancel==null) {
203             _btCancel = new JButtonOperator(this, "Cancel");
204         }
205         return _btCancel;
206     }
207
208     /** Tries to find "Help" JButton in this dialog.
209      * @return JButtonOperator
210      */

211     public JButtonOperator btHelp() {
212         if (_btHelp==null) {
213             _btHelp = new JButtonOperator(this, "Help");
214         }
215         return _btHelp;
216     }
217     
218     /**
219      * gets text for txtEndRevision
220      *
221      * @return String text
222      */

223     public String JavaDoc getEndRevision() {
224         return txtEndRevision().getText();
225     }
226
227     /**
228      * sets text for txtEndRevision
229      *
230      * @param text String text
231      */

232     public void setEndRevision(String JavaDoc text) {
233         txtEndRevision().clearText();
234         txtEndRevision().typeText(text);
235     }
236     
237     /** selects item for cboJComboBox
238      * @param item String item
239      */

240     public void selectMergeFrom(String JavaDoc item) {
241         cboJComboBox().selectItem(item);
242     }
243
244     /** types text for cboJComboBox
245      * @param text String text
246      */

247     public void setMergeFrom(String JavaDoc text) {
248         cboJComboBox().clearText();
249         cboJComboBox().typeText(text);
250     }
251
252     /** clicks on "Browse..." JButton
253      */

254     public RepositoryBrowserOperator browseRepositoryFolder() {
255         btBrowse().pushNoBlock();
256         return new RepositoryBrowserOperator();
257     }
258
259     /**
260      * returns selected item for cboRepository
261      *
262      * @return String item
263      */

264     public String JavaDoc getSelectedRepository() {
265         return cboRepository().getSelectedItem().toString();
266     }
267     
268     public String JavaDoc getRepositoryFolder() {
269         return cboRepository().getEditor().getItem().toString();
270     }
271
272     /**
273      * selects item for cboRepository
274      *
275      * @param item String item
276      */

277     public void selectRepository(String JavaDoc item) {
278         cboRepository().selectItem(item);
279     }
280     
281     public void setRepository(String JavaDoc text) {
282         cboRepository().clearText();
283         cboRepository().typeText(text);
284     }
285
286     /**
287      * gets text for txtRepostiryFolder
288      *
289      * @return String text
290      */

291     public String JavaDoc getTxtRepositoryFolder() {
292         return txtRepostiryFolder().getText();
293     }
294
295     /**
296      * gets text for txtCurrentFolder
297      *
298      * @return String text
299      */

300     public String JavaDoc getTxtCurrentFolder() {
301         return txtCurrentFolder().getText();
302     }
303     
304     /** clicks on "Merge" JButton
305      */

306     public void merge() {
307         btMerge().push();
308     }
309
310     /** clicks on "Cancel" JButton
311      */

312     public void cancel() {
313         btCancel().push();
314     }
315
316     /** clicks on "Help" JButton
317      */

318     public void help() {
319         btHelp().push();
320     }
321     
322     //*****************************************
323
// High-level functionality definition part
324
//*****************************************
325

326     /**
327      * Performs verification of MergeOriginOperator by accessing all its components.
328      */

329     public void verify() {
330         lblRepositoryFolder();
331         lblEndingWithRevision();
332         lblEmptyMeansRepositoryHEAD();
333         lblMergeIntoLocalFolderChangesFromOneRepositoryFolderSinceItsOrigin();
334         lblMergeFrom();
335         lblJLabel();
336         lblPreview();
337         btSearch();
338         txtEndRevision();
339         cboJComboBox();
340         btBrowse();
341         cboRepository();
342     }
343 }
344
345
Popular Tags