KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2  * SearchRevisions.java
3  *
4  * Created on 7/3/06 9:46 AM
5  */

6 package org.netbeans.test.subversion.operators;
7
8 import org.netbeans.jellytools.NbDialogOperator;
9 import org.netbeans.jemmy.operators.*;
10
11 /** Class implementing all necessary methods for handling "Search Revisions" NbDialog.
12  *
13  * @author pvcs
14  * @version 1.0
15  */

16 public class SearchRevisionsOperator extends NbDialogOperator {
17
18     /** Creates new SearchRevisions that can handle it.
19      */

20     public SearchRevisionsOperator() {
21         super("Search Revisions");
22     }
23
24     private JListOperator _lstJList;
25     private JButtonOperator _btMetalScrollButton;
26     private JButtonOperator _btMetalScrollButton2;
27     private JLabelOperator _lblListLogEntriesFrom;
28     private JTextFieldOperator _txtFrom;
29     private JLabelOperator _lblYYYYMMDDEmptyMeansAll;
30     private JButtonOperator _btList;
31     private JButtonOperator _btOK;
32     private JButtonOperator _btCancel;
33     private JButtonOperator _btHelp;
34
35
36     //******************************
37
// Subcomponents definition part
38
//******************************
39

40     /** Tries to find null JList in this dialog.
41      * @return JListOperator
42      */

43     public JListOperator lstJList() {
44         if (_lstJList==null) {
45             _lstJList = new JListOperator(this);
46         }
47         return _lstJList;
48     }
49
50     /** Tries to find null MetalScrollButton in this dialog.
51      * @return JButtonOperator
52      */

53     public JButtonOperator btMetalScrollButton() {
54         if (_btMetalScrollButton==null) {
55             _btMetalScrollButton = new JButtonOperator(this);
56         }
57         return _btMetalScrollButton;
58     }
59
60     /** Tries to find null MetalScrollButton in this dialog.
61      * @return JButtonOperator
62      */

63     public JButtonOperator btMetalScrollButton2() {
64         if (_btMetalScrollButton2==null) {
65             _btMetalScrollButton2 = new JButtonOperator(this, 1);
66         }
67         return _btMetalScrollButton2;
68     }
69
70     /** Tries to find "List log entries from: " JLabel in this dialog.
71      * @return JLabelOperator
72      */

73     public JLabelOperator lblListLogEntriesFrom() {
74         if (_lblListLogEntriesFrom==null) {
75             _lblListLogEntriesFrom = new JLabelOperator(this, "List log entries from:");
76         }
77         return _lblListLogEntriesFrom;
78     }
79
80     /** Tries to find null JTextField in this dialog.
81      * @return JTextFieldOperator
82      */

83     public JTextFieldOperator txtFrom() {
84         if (_txtFrom==null) {
85             _txtFrom = new JTextFieldOperator(this);
86         }
87         return _txtFrom;
88     }
89
90     /** Tries to find "(YYYY-MM-DD - empty means all)" JLabel in this dialog.
91      * @return JLabelOperator
92      */

93     public JLabelOperator lblYYYYMMDDEmptyMeansAll() {
94         if (_lblYYYYMMDDEmptyMeansAll==null) {
95             _lblYYYYMMDDEmptyMeansAll = new JLabelOperator(this, "(YYYY-MM-DD - empty means all)");
96         }
97         return _lblYYYYMMDDEmptyMeansAll;
98     }
99
100     /** Tries to find "List" JButton in this dialog.
101      * @return JButtonOperator
102      */

103     public JButtonOperator btList() {
104         if (_btList==null) {
105             _btList = new JButtonOperator(this, "List");
106         }
107         return _btList;
108     }
109
110     /** Tries to find "OK" JButton in this dialog.
111      * @return JButtonOperator
112      */

113     public JButtonOperator btOK() {
114         if (_btOK==null) {
115             _btOK = new JButtonOperator(this, "OK");
116         }
117         return _btOK;
118     }
119
120     /** Tries to find "Cancel" JButton in this dialog.
121      * @return JButtonOperator
122      */

123     public JButtonOperator btCancel() {
124         if (_btCancel==null) {
125             _btCancel = new JButtonOperator(this, "Cancel");
126         }
127         return _btCancel;
128     }
129
130     /** Tries to find "Help" JButton in this dialog.
131      * @return JButtonOperator
132      */

133     public JButtonOperator btHelp() {
134         if (_btHelp==null) {
135             _btHelp = new JButtonOperator(this, "Help");
136         }
137         return _btHelp;
138     }
139
140
141     //****************************************
142
// Low-level functionality definition part
143
//****************************************
144

145     public void selectListItem(int index) {
146         lstJList().setSelectedIndex(index);
147     }
148     
149     public void selectListItem(Object JavaDoc item) {
150         lstJList().setSelectedValue(item, true);
151     }
152     
153     public Object JavaDoc getSelectItem() {
154         return lstJList().getSelectedValue();
155     }
156     
157     /** clicks on null MetalScrollButton
158      */

159     public void metalScrollButton() {
160         btMetalScrollButton().push();
161     }
162
163     /** clicks on null MetalScrollButton
164      */

165     public void metalScrollButton2() {
166         btMetalScrollButton2().push();
167     }
168
169     /** gets text for txtJTextField
170      * @return String text
171      */

172     public String JavaDoc getFrom() {
173         return txtFrom().getText();
174     }
175
176     /** sets text for txtJTextField
177      * @param text String text
178      */

179     public void setFrom(String JavaDoc text) {
180         txtFrom().setText(text);
181     }
182
183     /** clicks on "List" JButton
184      */

185     public void list() {
186         btList().push();
187     }
188
189     /** clicks on "OK" JButton
190      */

191     public void ok() {
192         btOK().push();
193     }
194
195     /** clicks on "Cancel" JButton
196      */

197     public void cancel() {
198         btCancel().push();
199     }
200
201     /** clicks on "Help" JButton
202      */

203     public void help() {
204         btHelp().push();
205     }
206
207
208     //*****************************************
209
// High-level functionality definition part
210
//*****************************************
211

212     /** Performs verification of SearchRevisions by accessing all its components.
213      */

214     public void verify() {
215         lstJList();
216         btMetalScrollButton();
217         btMetalScrollButton2();
218         lblListLogEntriesFrom();
219         txtFrom();
220         lblYYYYMMDDEmptyMeansAll();
221         btList();
222         btOK();
223         btCancel();
224         btHelp();
225     }
226 }
227
228
Popular Tags