KickJava   Java API By Example, From Geeks To Geeks.

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


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  * CheckoutWizardOperator.java
21  *
22  * Created on 19/04/06 13:24
23  */

24 package org.netbeans.test.subversion.operators;
25
26 import org.netbeans.jellytools.WizardOperator;
27 import org.netbeans.jemmy.operators.*;
28
29 /**
30  * Class implementing all necessary methods for handling "CheckoutWizardOperator" NbDialog.
31  *
32  *
33  * @author peter
34  * @version 1.0
35  */

36 public class RepositoryStepOperator extends WizardOperator {
37
38     public static final String JavaDoc ITEM_FILE = "file:///";
39     public static final String JavaDoc ITEM_HTTP = "http://";
40     public static final String JavaDoc ITEM_HTTPS = "https://";
41     public static final String JavaDoc ITEM_SVN = "svn://";
42     public static final String JavaDoc ITEM_SVNSSH = "svn+ssh://";
43     
44     /**
45      * Creates new CheckoutWizardOperator that can handle it.
46      */

47     public RepositoryStepOperator() {
48         super(""); //NO I18N
49
stepsWaitSelectedValue("Repository");
50     }
51
52     private JLabelOperator _lblSteps;
53     private JListOperator _lstSteps;
54     private JLabelOperator _lblRepository;
55     private JButtonOperator _btProxyConfiguration;
56     private JLabelOperator _lblUseExternal;
57     private JLabelOperator _lblTunnelCommand;
58     private JTextFieldOperator _txtTunnelCommand;
59     private JLabelOperator _lblPassword;
60     private JLabelOperator _lblUser;
61     private JLabelOperator _lblRepositoryURL;
62     private JTextFieldOperator _txtUser;
63     private JPasswordFieldOperator _txtPassword;
64     private JLabelOperator _lblLeaveBlankForAnonymousAccess;
65     private JComboBoxOperator _cboRepositoryURL;
66     private JLabelOperator _lblSpecifySubversionRepositoryLocation;
67     private JLabelOperator _lblWizardDescriptor$FixedHeightLabel;
68     private JButtonOperator _btStop;
69     private JButtonOperator _btBack;
70     private JButtonOperator _btNext;
71     private JButtonOperator _btFinish;
72     private JButtonOperator _btCancel;
73     private JButtonOperator _btHelp;
74     private JLabelOperator _lblWarning;
75     
76     
77     //******************************
78
// Subcomponents definition part
79
//******************************
80

81     /** Tries to find "Steps" JLabel in this dialog.
82      * @return JLabelOperator
83      */

84     public JLabelOperator lblSteps() {
85         if (_lblSteps==null) {
86             _lblSteps = new JLabelOperator(this, "Steps");
87         }
88         return _lblSteps;
89     }
90
91     /** Tries to find null JList in this dialog.
92      * @return JListOperator
93      */

94     public JListOperator lstSteps() {
95         if (_lstSteps==null) {
96             _lstSteps = new JListOperator(this);
97         }
98         return _lstSteps;
99     }
100
101     /** Tries to find "Repository" JLabel in this dialog.
102      * @return JLabelOperator
103      */

104     public JLabelOperator lblRepository() {
105         if (_lblRepository==null) {
106             _lblRepository = new JLabelOperator(this, "Repository");
107         }
108         return _lblRepository;
109     }
110
111     /** Tries to find "Proxy Configuration..." JButton in this dialog.
112      * @return JButtonOperator
113      */

114     public JButtonOperator btProxyConfiguration() {
115         if (_btProxyConfiguration==null) {
116             _btProxyConfiguration = new JButtonOperator(this, "Proxy Configuration...");
117         }
118         return _btProxyConfiguration;
119     }
120     
121     /** Tries to find "Use External Tunnel" JLabel in this dialog.
122      * @return JLabelOperator
123      */

124     public JLabelOperator lblUseExternal() {
125         if (_lblUseExternal==null) {
126             _lblUseExternal = new JLabelOperator(this, "Use External");
127         }
128         return _lblUseExternal;
129     }
130     
131     /** Tries to find "Tunnel Command" JLabel in this dialog.
132      * @return JLabelOperator
133      */

134     public JLabelOperator lblTunnelCommand() {
135         if (_lblTunnelCommand==null) {
136             _lblTunnelCommand = new JLabelOperator(this, "Tunnel Command");
137         }
138         return _lblTunnelCommand;
139     }
140
141     /** Tries to find "Password:" JLabel in this dialog.
142      * @return JLabelOperator
143      */

144     public JLabelOperator lblPassword() {
145         if (_lblPassword==null) {
146             _lblPassword = new JLabelOperator(this, "Password:");
147         }
148         return _lblPassword;
149     }
150
151     /** Tries to find "User:" JLabel in this dialog.
152      * @return JLabelOperator
153      */

154     public JLabelOperator lblUser() {
155         if (_lblUser==null) {
156             _lblUser = new JLabelOperator(this, "User:");
157         }
158         return _lblUser;
159     }
160
161     /** Tries to find "Repository URL:" JLabel in this dialog.
162      * @return JLabelOperator
163      */

164     public JLabelOperator lblRepositoryURL() {
165         if (_lblRepositoryURL==null) {
166             _lblRepositoryURL = new JLabelOperator(this, "Repository URL:");
167         }
168         return _lblRepositoryURL;
169     }
170
171     /** Tries to find "Tunnel Command" JTextField in this dialog.
172      * @return JTextFieldOperator
173      */

174     public JTextFieldOperator txtTunnelCommand() {
175         if (_txtTunnelCommand == null)
176             _txtTunnelCommand = new JTextFieldOperator(this, 1);
177         return _txtTunnelCommand;
178     }
179     
180     /** Tries to find null JTextField in this dialog.
181      * @return JTextFieldOperator
182      */

183     public JTextFieldOperator txtUser() {
184         if (_txtUser == null)
185             _txtUser = new JTextFieldOperator(this);
186         return _txtUser;
187     }
188
189     /** Tries to find null JPasswordField in this dialog.
190      * @return JPasswordFieldOperator
191      */

192     public JPasswordFieldOperator txtPassword() {
193         if (_txtPassword == null)
194             _txtPassword = new JPasswordFieldOperator(this);
195         return _txtPassword;
196     }
197
198     /** Tries to find "(leave blank for anonymous access)" JLabel in this dialog.
199      * @return JLabelOperator
200      */

201     public JLabelOperator lblLeaveBlankForAnonymousAccess() {
202         if (_lblLeaveBlankForAnonymousAccess==null) {
203             _lblLeaveBlankForAnonymousAccess = new JLabelOperator(this, "(leave blank for anonymous access)");
204         }
205         return _lblLeaveBlankForAnonymousAccess;
206     }
207
208     /** Tries to find null JComboBox in this dialog.
209      * @return JComboBoxOperator
210      */

211     public JComboBoxOperator cboRepositoryURL() {
212         if (_cboRepositoryURL==null) {
213             _cboRepositoryURL = new JComboBoxOperator(this);
214         }
215         return _cboRepositoryURL;
216     }
217
218     /** Tries to find "Specify Subversion repository location:" JLabel in this dialog.
219      * @return JLabelOperator
220      */

221     public JLabelOperator lblSpecifySubversionRepositoryLocation() {
222         if (_lblSpecifySubversionRepositoryLocation==null) {
223             _lblSpecifySubversionRepositoryLocation = new JLabelOperator(this, "Specify Subversion repository location:");
224         }
225         return _lblSpecifySubversionRepositoryLocation;
226     }
227
228     /** Tries to find null WizardDescriptor$FixedHeightLabel in this dialog.
229      * @return JLabelOperator
230      */

231     public JLabelOperator lblWizardDescriptor$FixedHeightLabel() {
232         if (_lblWizardDescriptor$FixedHeightLabel==null) {
233             _lblWizardDescriptor$FixedHeightLabel = new JLabelOperator(this, 7);
234         }
235         return _lblWizardDescriptor$FixedHeightLabel;
236     }
237     
238     public JLabelOperator lblWarning() {
239         if (_lblWarning == null) {
240             _lblWarning = new JLabelOperator(this, 5);
241         }
242         return _lblWarning;
243     }
244
245     /** Tries to find "Stop" JButton in this dialog.
246      * @return JButtonOperator
247      */

248     public JButtonOperator btStop() {
249         if (_btStop==null) {
250             _btStop = new JButtonOperator(this, "Stop");
251         }
252         return _btStop;
253     }
254     
255     /** Tries to find "< Back" JButton in this dialog.
256      * @return JButtonOperator
257      */

258     public JButtonOperator btBack() {
259         if (_btBack==null) {
260             _btBack = new JButtonOperator(this, "< Back");
261         }
262         return _btBack;
263     }
264
265     /** Tries to find "Next >" JButton in this dialog.
266      * @return JButtonOperator
267      */

268     public JButtonOperator btNext() {
269         if (_btNext==null) {
270             _btNext = new JButtonOperator(this, "Next >");
271         }
272         return _btNext;
273     }
274
275     /** Tries to find "Finish" JButton in this dialog.
276      * @return JButtonOperator
277      */

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

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

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

314     /** clicks on "Proxy Configuration..." JButton
315      */

316     public void proxyConfiguration() {
317         btProxyConfiguration().pushNoBlock();
318     }
319
320     /** gets text for txtUser
321      * @return String text
322      */

323     public String JavaDoc getUser() {
324         return txtUser().getText();
325     }
326
327     /** sets text for txtUser
328      * @param text String text
329      */

330     public void setUser(String JavaDoc text) {
331         txtUser().setText(text);
332     }
333
334     /** types text for txtUser
335      * @param text String text
336      */

337     public void typeUser(String JavaDoc text) {
338         txtUser().typeText(text);
339     }
340
341     /** sets text for txtPassword
342      * @param text String text
343      */

344     public void setPassword(String JavaDoc text) {
345         txtPassword().setText(text);
346     }
347
348     /** types text for txtPassword
349      * @param text String text
350      */

351     public void typePassword(String JavaDoc text) {
352         txtPassword().typeText(text);
353     }
354
355     /** returns selected item for cboRepositoryURL
356      * @return String item
357      */

358     public String JavaDoc getSelectedRepositoryURL() {
359         return cboRepositoryURL().getSelectedItem().toString();
360     }
361
362     /** selects item for cboRepositoryURL
363      * @param item String item
364      */

365     public void selectRepositoryURL(String JavaDoc item) {
366         cboRepositoryURL().selectItem(item);
367     }
368     
369     public void setRepositoryURL(String JavaDoc url) {
370         cboRepositoryURL().clearText();
371         cboRepositoryURL().typeText(url);
372     }
373
374     /** types text for cboRepositoryURL
375      * @param text String text
376      */

377     public void typeRepositoryURL(String JavaDoc text) {
378         cboRepositoryURL().typeText(text);
379     }
380
381     /** clicks on "< Back" JButton
382      */

383     public void back() {
384         btBack().push();
385     }
386
387     /** clicks on "Next >" JButton
388      */

389     public void next() {
390         btNext().push();
391     }
392
393     /** clicks on "Finish" JButton
394      */

395     public void finish() {
396         btFinish().push();
397     }
398
399     /** clicks on "Cancel" JButton
400      */

401     public void cancel() {
402         btCancel().push();
403     }
404
405     /** clicks on "Help" JButton
406      */

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

416     /**
417      * Performs verification of CheckoutWizardOperator by accessing all its components.
418      */

419     public void verify() {
420         lblSteps();
421         lstSteps();
422         lblRepository();
423         btProxyConfiguration();
424         lblPassword();
425         lblUser();
426         lblRepositoryURL();
427         txtUser();
428         txtPassword();
429         lblLeaveBlankForAnonymousAccess();
430         cboRepositoryURL();
431         lblSpecifySubversionRepositoryLocation();
432         lblWizardDescriptor$FixedHeightLabel();
433         btBack();
434         btNext();
435         btFinish();
436         btCancel();
437         btHelp();
438     }
439 }
440
441
Popular Tags