KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > jellytools > modules > xml > catalog > OASISCatalogCustomizerDialogOperator


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  * CustomizerDialogDialogOperator.java
21  *
22  * Created on 11/13/03 4:23 PM
23  */

24 package org.netbeans.jellytools.modules.xml.catalog;
25
26 import org.netbeans.jemmy.operators.*;
27 import org.netbeans.jellytools.*;
28 import org.netbeans.jellytools.properties.PropertySheetOperator;
29
30 /** Class implementing all necessary methods for handling "Customizer Dialog" NbDialog.
31  *
32  * @author ms113234
33  * @version 1.0
34  */

35 public class OASISCatalogCustomizerDialogOperator extends NbDialogOperator {
36
37     /** Creates new CustomizerDialogDialogOperator that can handle it.
38      */

39     public OASISCatalogCustomizerDialogOperator() {
40         super("Customizer Dialog");
41     }
42
43     private JLabelOperator _lblCatalogURL;
44     private JTextFieldOperator _txtCatalogURL;
45     private JButtonOperator _btBrowse;
46     private JCheckBoxOperator _cbPreferPublicID;
47     private JTextAreaOperator _txtJTextArea;
48
49
50     //******************************
51
// Subcomponents definition part
52
//******************************
53

54     /** Tries to find "Catalog URL:" JLabel in this dialog.
55      * @return JLabelOperator
56      */

57     public JLabelOperator lblCatalogURL() {
58         if (_lblCatalogURL==null) {
59             _lblCatalogURL = new JLabelOperator(this, "Catalog URL:");
60         }
61         return _lblCatalogURL;
62     }
63
64     /** Tries to find null JTextField in this dialog.
65      * @return JTextFieldOperator
66      */

67     public JTextFieldOperator txtCatalogURL() {
68         if (_txtCatalogURL==null) {
69             _txtCatalogURL = new JTextFieldOperator(this);
70         }
71         return _txtCatalogURL;
72     }
73
74     /** Tries to find "Browse..." JButton in this dialog.
75      * @return JButtonOperator
76      */

77     public JButtonOperator btBrowse() {
78         if (_btBrowse==null) {
79             _btBrowse = new JButtonOperator(this, "Browse...");
80         }
81         return _btBrowse;
82     }
83
84     /** Tries to find "Prefer Public ID" JCheckBox in this dialog.
85      * @return JCheckBoxOperator
86      */

87     public JCheckBoxOperator cbPreferPublicID() {
88         if (_cbPreferPublicID==null) {
89             _cbPreferPublicID = new JCheckBoxOperator(this, "Prefer Public ID");
90         }
91         return _cbPreferPublicID;
92     }
93
94     /** Tries to find null JTextArea in this dialog.
95      * @return JTextAreaOperator
96      */

97     public JTextAreaOperator txtJTextArea() {
98         if (_txtJTextArea==null) {
99             _txtJTextArea = new JTextAreaOperator(this);
100         }
101         return _txtJTextArea;
102     }
103
104
105     //****************************************
106
// Low-level functionality definition part
107
//****************************************
108

109     /** gets text for txtCatalogURL
110      * @return String text
111      */

112     public String JavaDoc getCatalogURL() {
113         return txtCatalogURL().getText();
114     }
115
116     /** sets text for txtCatalogURL
117      * @param text String text
118      */

119     public void setCatalogURL(String JavaDoc text) {
120         txtCatalogURL().setText(text);
121     }
122
123     /** types text for txtCatalogURL
124      * @param text String text
125      */

126     public void typeCatalogURL(String JavaDoc text) {
127         txtCatalogURL().typeText(text);
128     }
129
130     /** clicks on "Browse..." JButton
131      */

132     public void browse() {
133         btBrowse().push();
134     }
135
136     /** checks or unchecks given JCheckBox
137      * @param state boolean requested state
138      */

139     public void checkPreferPublicID(boolean state) {
140         if (cbPreferPublicID().isSelected()!=state) {
141             cbPreferPublicID().push();
142         }
143     }
144
145     /** gets text for txtJTextArea
146      * @return String text
147      */

148     public String JavaDoc getJTextArea() {
149         return txtJTextArea().getText();
150     }
151
152     /** sets text for txtJTextArea
153      * @param text String text
154      */

155     public void setJTextArea(String JavaDoc text) {
156         txtJTextArea().setText(text);
157     }
158
159     /** types text for txtJTextArea
160      * @param text String text
161      */

162     public void typeJTextArea(String JavaDoc text) {
163         txtJTextArea().typeText(text);
164     }
165
166
167     //*****************************************
168
// High-level functionality definition part
169
//*****************************************
170

171     /** Performs verification of CustomizerDialogDialogOperator by accessing all its components.
172      */

173     public void verify() {
174         lblCatalogURL();
175         txtCatalogURL();
176         btBrowse();
177         cbPreferPublicID();
178         txtJTextArea();
179     }
180
181     /** Performs simple test of CustomizerDialogDialogOperator
182     * @param args the command line arguments
183     */

184     public static void main(String JavaDoc args[]) {
185         new OASISCatalogCustomizerDialogOperator().verify();
186         System.out.println("CustomizerDialogDialogOperator verification finished.");
187     }
188 }
189
190
Popular Tags