KickJava   Java API By Example, From Geeks To Geeks.

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


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 org.netbeans.jemmy.operators.*;
23
24 /**
25  * Class implementing all necessary methods for handling "Palette Manager" NbDialog.
26  * Most parts of code are generated by jelly tools.*
27  *
28  * @author Jiri Vagner
29  */

30 public class PaletteManagerOperator extends JDialogOperator {
31
32     /** Creates new PaletteManager that can handle it.
33      */

34     public PaletteManagerOperator() {
35         super("Palette Manager"); // NOI18N
36
}
37
38     private JLabelOperator _lblPaletteContent;
39     private JTreeOperator _treePaletteContentsTree;
40     private JLabelOperator _lblJLabel;
41     private JButtonOperator _btMoveUp;
42     private JButtonOperator _btMoveDown;
43     private JButtonOperator _btRemove;
44     private JButtonOperator _btNewCategory;
45     private JButtonOperator _btAddFromJAR;
46     private JButtonOperator _btAddFromLibrary;
47     private JButtonOperator _btAddFromProject;
48     private JButtonOperator _btResetPalette;
49     private JButtonOperator _btClose;
50
51
52     //******************************
53
// Subcomponents definition part
54
//******************************
55

56     /** Tries to find "Palette Content:" JLabel in this dialog.
57      * @return JLabelOperator
58      */

59     public JLabelOperator lblPaletteContent() {
60         if (_lblPaletteContent==null) {
61             _lblPaletteContent = new JLabelOperator(this, "Palette Content:"); // NOI18N
62
}
63         return _lblPaletteContent;
64     }
65
66     /** Tries to find null TreeView$ExplorerTree in this dialog.
67      * @return JTreeOperator
68      */

69     public JTreeOperator treePaletteContentsTree() {
70         if (_treePaletteContentsTree==null) {
71             _treePaletteContentsTree = new JTreeOperator(this);
72         }
73         return _treePaletteContentsTree;
74     }
75
76     /** Tries to find " " JLabel in this dialog.
77      * @return JLabelOperator
78      */

79     public JLabelOperator lblJLabel() {
80         if (_lblJLabel==null) {
81             _lblJLabel = new JLabelOperator(this, " ", 1); // NOI18N
82
}
83         return _lblJLabel;
84     }
85
86     /** Tries to find "Move Up" JButton in this dialog.
87      * @return JButtonOperator
88      */

89     public JButtonOperator btMoveUp() {
90         if (_btMoveUp==null) {
91             _btMoveUp = new JButtonOperator(this, "Move Up"); // NOI18N
92
}
93         return _btMoveUp;
94     }
95
96     /** Tries to find "Move Down" JButton in this dialog.
97      * @return JButtonOperator
98      */

99     public JButtonOperator btMoveDown() {
100         if (_btMoveDown==null) {
101             _btMoveDown = new JButtonOperator(this, "Move Down"); // NOI18N
102
}
103         return _btMoveDown;
104     }
105
106     /** Tries to find "Remove..." JButton in this dialog.
107      * @return JButtonOperator
108      */

109     public JButtonOperator btRemove() {
110         if (_btRemove==null) {
111             _btRemove = new JButtonOperator(this, "Remove..."); // NOI18N
112
}
113         return _btRemove;
114     }
115
116     /** Tries to find "New Category..." JButton in this dialog.
117      * @return JButtonOperator
118      */

119     public JButtonOperator btNewCategory() {
120         if (_btNewCategory==null) {
121             _btNewCategory = new JButtonOperator(this, "New Category..."); // NOI18N
122
}
123         return _btNewCategory;
124     }
125
126     /** Tries to find "Add from JAR..." JButton in this dialog.
127      * @return JButtonOperator
128      */

129     public JButtonOperator btAddFromJAR() {
130         if (_btAddFromJAR==null) {
131             _btAddFromJAR = new JButtonOperator(this, "Add from JAR..."); // NOI18N
132
}
133         return _btAddFromJAR;
134     }
135
136     /** Tries to find "Add from Library..." JButton in this dialog.
137      * @return JButtonOperator
138      */

139     public JButtonOperator btAddFromLibrary() {
140         if (_btAddFromLibrary==null) {
141             _btAddFromLibrary = new JButtonOperator(this, "Add from Library..."); // NOI18N
142
}
143         return _btAddFromLibrary;
144     }
145
146     /** Tries to find "Add from Project..." JButton in this dialog.
147      * @return JButtonOperator
148      */

149     public JButtonOperator btAddFromProject() {
150         if (_btAddFromProject==null) {
151             _btAddFromProject = new JButtonOperator(this, "Add from Project..."); // NOI18N
152
}
153         return _btAddFromProject;
154     }
155
156     /** Tries to find "Reset Palette" JButton in this dialog.
157      * @return JButtonOperator
158      */

159     public JButtonOperator btResetPalette() {
160         if (_btResetPalette==null) {
161             _btResetPalette = new JButtonOperator(this, "Reset Palette"); // NOI18N
162
}
163         return _btResetPalette;
164     }
165
166     /** Tries to find "Close" JButton in this dialog.
167      * @return JButtonOperator
168      */

169     public JButtonOperator btClose() {
170         if (_btClose==null) {
171             _btClose = new JButtonOperator(this, "Close"); // NOI18N
172
}
173         return _btClose;
174     }
175
176
177     //****************************************
178
// Low-level functionality definition part
179
//****************************************
180

181     /** clicks on "Move Up" JButton
182      */

183     public void moveUp() {
184         btMoveUp().push();
185     }
186
187     /** clicks on "Move Down" JButton
188      */

189     public void moveDown() {
190         btMoveDown().push();
191     }
192
193     /** clicks on "Remove..." JButton
194      */

195     public void remove() {
196         btRemove().push();
197     }
198
199     /** clicks on "New Category..." JButton
200      */

201     public void newCategory() {
202         btNewCategory().push();
203     }
204
205     /** clicks on "Add from JAR..." JButton
206      */

207     public void addFromJAR() {
208         btAddFromJAR().push();
209     }
210
211     /** clicks on "Add from Library..." JButton
212      */

213     public void addFromLibrary() {
214         btAddFromLibrary().push();
215     }
216
217     /** clicks on "Add from Project..." JButton
218      */

219     public void addFromProject() {
220         btAddFromProject().push();
221     }
222
223     /** clicks on "Reset Palette" JButton
224      */

225     public void resetPalette() {
226         btResetPalette().push();
227     }
228
229     /** clicks on "Close" JButton
230      */

231     public void close() {
232         btClose().push();
233     }
234
235
236     //*****************************************
237
// High-level functionality definition part
238
//*****************************************
239

240     /** Performs verification of PaletteManager by accessing all its components.
241      */

242     public void verify() {
243         lblPaletteContent();
244         treePaletteContentsTree();
245         lblJLabel();
246         btMoveUp();
247         btMoveDown();
248         btRemove();
249         btNewCategory();
250         btAddFromJAR();
251         btAddFromLibrary();
252         btAddFromProject();
253         btResetPalette();
254         btClose();
255     }
256 }
257
258
Popular Tags