KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > qa > form > BorderCustomEditorOperator


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 package org.netbeans.qa.form;
21
22 import javax.swing.JDialog JavaDoc;
23 import org.netbeans.jemmy.operators.*;
24
25 /**
26  * Class implementing all necessary methods for handling "Border Custom Editor" NbDialog.
27  * Most parts of code are generated by jelly tools.
28  *
29  * @author Jiri Vagner
30  */

31 public class BorderCustomEditorOperator extends JDialogOperator {
32
33     /**
34      * Creates new instance using dialog name
35      */

36     public BorderCustomEditorOperator(String JavaDoc title) {
37         super(title);
38     }
39
40     /**
41      * Creates new instance using existing JDialog operator
42      */

43     public BorderCustomEditorOperator(JDialogOperator wrapper) {
44         super((JDialog JavaDoc)wrapper.getSource());
45     }
46
47     public static final String JavaDoc ITEM_BORDEREDITOR = "Border Editor"; // NOI18N
48
public static final String JavaDoc ITEM_FORMCONNECTION = "Form Connection"; // NOI18N
49
public static final String JavaDoc ITEM_NOBORDER = "(No Border)"; // NOI18N
50
public static final String JavaDoc ITEM_BEVELBORDER = "BevelBorder"; // NOI18N
51
public static final String JavaDoc ITEM_COMPOUNDBORDER = "CompoundBorder"; // NOI18N
52
public static final String JavaDoc ITEM_EMPTYBORDER = "EmptyBorder"; // NOI18N
53
public static final String JavaDoc ITEM_ETCHEDBORDER = "EtchedBorder"; // NOI18N
54
public static final String JavaDoc ITEM_LINEBORDER = "LineBorder"; // NOI18N
55
public static final String JavaDoc ITEM_MATTEBORDER = "MatteBorder"; // NOI18N
56
public static final String JavaDoc ITEM_SOFTBEVELBORDER = "SoftBevelBorder"; // NOI18N
57
public static final String JavaDoc ITEM_TITLEDBORDER = "TitledBorder"; // NOI18N
58
public static final String JavaDoc ITEM_UNKNOWNBORDERBORDERUIRESOURCE$COMPOUNDBORDERUIRESOURCE =
59             "Unknown Border (BorderUIResource$CompoundBorderUIResource)"; // NOI18N
60

61     private JComboBoxOperator _cboSelectMode;
62     private JLabelOperator _lblSelectMode;
63     private JSplitPaneOperator _sppJSplitPane;
64     private JLabelOperator _lblAvailableBorders;
65     private JListOperator _lstAvailableBorders;
66     private JSplitPaneOperator _sppJSplitPane2;
67     private JTextAreaOperator _txtDescription;
68     private JLabelOperator _lblUnknownBorderBorderUIResource$CompoundBorderUIResource;
69     private JButtonOperator _btJButton;
70     private JButtonOperator _btAdvanced;
71     private JButtonOperator _btOK;
72     private JButtonOperator _btCancel;
73
74     //******************************
75
// Subcomponents definition part
76
//******************************
77

78     /** Tries to find null JComboBox in this dialog.
79      * @return JComboBoxOperator
80      */

81     public JComboBoxOperator cboSelectMode() {
82         if (_cboSelectMode==null) {
83             _cboSelectMode = new JComboBoxOperator(this);
84         }
85         return _cboSelectMode;
86     }
87
88     /** Tries to find "Select Mode:" JLabel in this dialog.
89      * @return JLabelOperator
90      */

91     public JLabelOperator lblSelectMode() {
92         if (_lblSelectMode==null) {
93             _lblSelectMode = new JLabelOperator(this, "Select Mode:"); // NOI18N
94
}
95         return _lblSelectMode;
96     }
97
98     /** Tries to find null JSplitPane in this dialog.
99      * @return JSplitPaneOperator
100      */

101     public JSplitPaneOperator sppJSplitPane() {
102         if (_sppJSplitPane==null) {
103             _sppJSplitPane = new JSplitPaneOperator(this);
104         }
105         return _sppJSplitPane;
106     }
107
108     /** Tries to find "Available Borders" JLabel in this dialog.
109      * @return JLabelOperator
110      */

111     public JLabelOperator lblAvailableBorders() {
112         if (_lblAvailableBorders==null) {
113             _lblAvailableBorders = new JLabelOperator(sppJSplitPane(), "Available Borders"); // NOI18N
114
}
115         return _lblAvailableBorders;
116     }
117
118     /** Tries to find null ListView$NbList in this dialog.
119      * @return JListOperator
120      */

121     public JListOperator lstAvailableBorders() {
122         if (_lstAvailableBorders==null) {
123             _lstAvailableBorders = new JListOperator(sppJSplitPane());
124         }
125         return _lstAvailableBorders;
126     }
127
128     /** Tries to find null JSplitPane in this dialog.
129      * @return JSplitPaneOperator
130      */

131     public JSplitPaneOperator sppJSplitPane2() {
132         if (_sppJSplitPane2==null) {
133             _sppJSplitPane2 = new JSplitPaneOperator(sppJSplitPane());
134         }
135         return _sppJSplitPane2;
136     }
137
138     /** Tries to find null JTextArea in this dialog.
139      * @return JTextAreaOperator
140      */

141     public JTextAreaOperator txtDescription() {
142         if (_txtDescription==null) {
143             _txtDescription = new JTextAreaOperator(sppJSplitPane2());
144         }
145         return _txtDescription;
146     }
147
148     /** Tries to find "Unknown Border (BorderUIResource$CompoundBorderUIResource)" JLabel in this dialog.
149      * @return JLabelOperator
150      */

151     public JLabelOperator lblUnknownBorderBorderUIResource$CompoundBorderUIResource() {
152         if (_lblUnknownBorderBorderUIResource$CompoundBorderUIResource==null) {
153             _lblUnknownBorderBorderUIResource$CompoundBorderUIResource = new JLabelOperator(sppJSplitPane2(),
154                     "Unknown Border (BorderUIResource$CompoundBorderUIResource)"); // NOI18N
155
}
156         return _lblUnknownBorderBorderUIResource$CompoundBorderUIResource;
157     }
158
159     /** Tries to find null JButton in this dialog.
160      * @return JButtonOperator
161      */

162     public JButtonOperator btJButton() {
163         if (_btJButton==null) {
164             _btJButton = new JButtonOperator(sppJSplitPane2());
165         }
166         return _btJButton;
167     }
168
169     /** Tries to find "Advanced..." JButton in this dialog.
170      * @return JButtonOperator
171      */

172     public JButtonOperator btAdvanced() {
173         if (_btAdvanced==null) {
174             _btAdvanced = new JButtonOperator(this, "Advanced..."); // NOI18N
175
}
176         return _btAdvanced;
177     }
178
179     /** Tries to find "OK" JButton in this dialog.
180      * @return JButtonOperator
181      */

182     public JButtonOperator btOK() {
183         if (_btOK==null) {
184             _btOK = new JButtonOperator(this, "OK"); // NOI18N
185
}
186         return _btOK;
187     }
188
189     /** Tries to find "Cancel" JButton in this dialog.
190      * @return JButtonOperator
191      */

192     public JButtonOperator btCancel() {
193         if (_btCancel==null) {
194             _btCancel = new JButtonOperator(this, "Cancel"); // NOI18N
195
}
196         return _btCancel;
197     }
198
199
200     //****************************************
201
// Low-level functionality definition part
202
//****************************************
203

204     /** returns selected item for cboSelectMode
205      * @return String item
206      */

207     public String JavaDoc getSelectedSelectMode() {
208         return cboSelectMode().getSelectedItem().toString();
209     }
210
211     /** selects item for cboSelectMode
212      * @param item String item
213      */

214     public void selectSelectMode(String JavaDoc item) {
215         cboSelectMode().selectItem(item);
216     }
217
218     /** gets text for txtDescription
219      * @return String text
220      */

221     public String JavaDoc getDescription() {
222         return txtDescription().getText();
223     }
224
225     /** sets text for txtDescription
226      * @param text String text
227      */

228     public void setDescription(String JavaDoc text) {
229         txtDescription().setText(text);
230     }
231
232     /** types text for txtDescription
233      * @param text String text
234      */

235     public void typeDescription(String JavaDoc text) {
236         txtDescription().typeText(text);
237     }
238
239     /** clicks on null JButton
240      */

241     public void jButton() {
242         btJButton().push();
243     }
244
245     /** clicks on "Advanced..." JButton
246      */

247     public void advanced() {
248         btAdvanced().push();
249     }
250
251     /** clicks on "OK" JButton
252      */

253     public void ok() {
254         btOK().push();
255     }
256
257     /** clicks on "Cancel" JButton
258      */

259     public void cancel() {
260         btCancel().push();
261     }
262
263     //*****************************************
264
// High-level functionality definition part
265
//*****************************************
266

267     /** Performs verification of MyBorderCustomEditorOperator by accessing all its components.
268      */

269     public void verify() {
270         cboSelectMode();
271         lblSelectMode();
272         sppJSplitPane();
273         lblAvailableBorders();
274         lstAvailableBorders();
275         sppJSplitPane2();
276         txtDescription();
277         lblUnknownBorderBorderUIResource$CompoundBorderUIResource();
278         btJButton();
279         btAdvanced();
280         btOK();
281         btCancel();
282     }
283
284 }
285
286
Popular Tags