KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > jellytools > modules > xml > saxwizard > ConfirmChangesDialog


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  * ConfirmChanges.java
21  *
22  * Created on 9/3/02 8:12 PM
23  */

24 package org.netbeans.jellytools.modules.xml.saxwizard;
25
26 import org.netbeans.jemmy.operators.*;
27
28 /** Class implementing all necessary methods for handling "Confirm Changes" NbDialog.
29  *
30  * @author ms113234
31  * @version 1.0
32  */

33 public class ConfirmChangesDialog extends JDialogOperator {
34
35     /** Creates new ConfirmChanges that can handle it.
36      */

37     public ConfirmChangesDialog() {
38         super("Confirm Changes");
39     }
40
41     private JTextAreaOperator _txtJTextArea;
42     private JLabelOperator _lblChangesList;
43     private JListOperator _lstChangesList;
44     public static final String JavaDoc ITEM_ADDMETHODPUBLICABSTRACTVOIDCHARACTERSCHARINTINTTHROWSSAXEXCEPTIONFROMORGXMLSAXDOCUMENTHANDLER = "Add method public abstract void characters(char[], int, int) throws SAXException [from org.xml.sax.DocumentHandler]";
45     public static final String JavaDoc ITEM_ADDMETHODPUBLICABSTRACTVOIDENDDOCUMENTTHROWSSAXEXCEPTIONFROMORGXMLSAXDOCUMENTHANDLER = "Add method public abstract void endDocument() throws SAXException [from org.xml.sax.DocumentHandler]";
46     public static final String JavaDoc ITEM_ADDMETHODPUBLICABSTRACTVOIDENDELEMENTSTRINGTHROWSSAXEXCEPTIONFROMORGXMLSAXDOCUMENTHANDLER = "Add method public abstract void endElement(String) throws SAXException [from org.xml.sax.DocumentHandler]";
47     public static final String JavaDoc ITEM_ADDMETHODPUBLICABSTRACTVOIDIGNORABLEWHITESPACECHARINTINTTHROWSSAXEXCEPTIONFROMORGXMLSAXDOCUMENTHANDLER = "Add method public abstract void ignorableWhitespace(char[], int, int) throws SAXException [from org.xml.sax.DocumentHandler]";
48     public static final String JavaDoc ITEM_ADDMETHODPUBLICABSTRACTVOIDPROCESSINGINSTRUCTIONSTRINGSTRINGTHROWSSAXEXCEPTIONFROMORGXMLSAXDOCUMENTHANDLER = "Add method public abstract void processingInstruction(String, String) throws SAXException [from org.xml.sax.DocumentHandler]";
49     public static final String JavaDoc ITEM_ADDMETHODPUBLICABSTRACTVOIDSETDOCUMENTLOCATORLOCATORFROMORGXMLSAXDOCUMENTHANDLER = "Add method public abstract void setDocumentLocator(Locator) [from org.xml.sax.DocumentHandler]";
50     public static final String JavaDoc ITEM_ADDMETHODPUBLICABSTRACTVOIDSTARTDOCUMENTTHROWSSAXEXCEPTIONFROMORGXMLSAXDOCUMENTHANDLER = "Add method public abstract void startDocument() throws SAXException [from org.xml.sax.DocumentHandler]";
51     public static final String JavaDoc ITEM_ADDMETHODPUBLICABSTRACTVOIDSTARTELEMENTSTRINGATTRIBUTELISTTHROWSSAXEXCEPTIONFROMORGXMLSAXDOCUMENTHANDLER = "Add method public abstract void startElement(String, AttributeList) throws SAXException [from org.xml.sax.DocumentHandler]";
52     private JRadioButtonOperator _rbDoNotSynchronizeThisObjectNowToDoSoExplicitlyUseToolsSynchronize;
53     private JRadioButtonOperator _rbConfirmAllChangesDuringSynchronization;
54     private JRadioButtonOperator _rbPerformSynchronizationWithoutConfirmation;
55     private JButtonOperator _btProcess;
56     private JButtonOperator _btProcessAll;
57     private JButtonOperator _btHelp;
58     private JButtonOperator _btClose;
59
60
61     //******************************
62
// Subcomponents definition part
63
//******************************
64

65     /** Tries to find null JTextArea in this dialog.
66      * @return JTextAreaOperator
67      */

68     public JTextAreaOperator txtJTextArea() {
69         if (_txtJTextArea==null) {
70             _txtJTextArea = new JTextAreaOperator(this);
71         }
72         return _txtJTextArea;
73     }
74
75     /** Tries to find "Changes List" JLabel in this dialog.
76      * @return JLabelOperator
77      */

78     public JLabelOperator lblChangesList() {
79         if (_lblChangesList==null) {
80             _lblChangesList = new JLabelOperator(this, "Changes List");
81         }
82         return _lblChangesList;
83     }
84
85     /** Tries to find null JList in this dialog.
86      * @return JListOperator
87      */

88     public JListOperator lstChangesList() {
89         if (_lstChangesList==null) {
90             _lstChangesList = new JListOperator(this);
91         }
92         return _lstChangesList;
93     }
94
95     /** Tries to find "Do not synchronize this object now (to do so explicitly, use Tools | Synchronize)" JRadioButton in this dialog.
96      * @return JRadioButtonOperator
97      */

98     public JRadioButtonOperator rbDoNotSynchronizeThisObjectNowToDoSoExplicitlyUseToolsSynchronize() {
99         if (_rbDoNotSynchronizeThisObjectNowToDoSoExplicitlyUseToolsSynchronize==null) {
100             _rbDoNotSynchronizeThisObjectNowToDoSoExplicitlyUseToolsSynchronize = new JRadioButtonOperator(this, "Do not synchronize this object now (to do so explicitly, use Tools | Synchronize)");
101         }
102         return _rbDoNotSynchronizeThisObjectNowToDoSoExplicitlyUseToolsSynchronize;
103     }
104
105     /** Tries to find "Confirm all changes during synchronization" JRadioButton in this dialog.
106      * @return JRadioButtonOperator
107      */

108     public JRadioButtonOperator rbConfirmAllChangesDuringSynchronization() {
109         if (_rbConfirmAllChangesDuringSynchronization==null) {
110             _rbConfirmAllChangesDuringSynchronization = new JRadioButtonOperator(this, "Confirm all changes during synchronization");
111         }
112         return _rbConfirmAllChangesDuringSynchronization;
113     }
114
115     /** Tries to find "Perform synchronization without confirmation" JRadioButton in this dialog.
116      * @return JRadioButtonOperator
117      */

118     public JRadioButtonOperator rbPerformSynchronizationWithoutConfirmation() {
119         if (_rbPerformSynchronizationWithoutConfirmation==null) {
120             _rbPerformSynchronizationWithoutConfirmation = new JRadioButtonOperator(this, "Perform synchronization without confirmation");
121         }
122         return _rbPerformSynchronizationWithoutConfirmation;
123     }
124
125     /** Tries to find "Process" JButton in this dialog.
126      * @return JButtonOperator
127      */

128     public JButtonOperator btProcess() {
129         if (_btProcess==null) {
130             _btProcess = new JButtonOperator(this, "Process");
131         }
132         return _btProcess;
133     }
134
135     /** Tries to find "Process All" JButton in this dialog.
136      * @return JButtonOperator
137      */

138     public JButtonOperator btProcessAll() {
139         if (_btProcessAll==null) {
140             _btProcessAll = new JButtonOperator(this, "Process All");
141         }
142         return _btProcessAll;
143     }
144
145     /** Tries to find "Help" JButton in this dialog.
146      * @return JButtonOperator
147      */

148     public JButtonOperator btHelp() {
149         if (_btHelp==null) {
150             _btHelp = new JButtonOperator(this, "Help");
151         }
152         return _btHelp;
153     }
154
155     /** Tries to find "Close" JButton in this dialog.
156      * @return JButtonOperator
157      */

158     public JButtonOperator btClose() {
159         if (_btClose==null) {
160             _btClose = new JButtonOperator(this, "Close");
161         }
162         return _btClose;
163     }
164
165
166     //****************************************
167
// Low-level functionality definition part
168
//****************************************
169

170     /** gets text for txtJTextArea
171      * @return String text
172      */

173     public String JavaDoc getJTextArea() {
174         return txtJTextArea().getText();
175     }
176
177     /** sets text for txtJTextArea
178      * @param text String text
179      */

180     public void setJTextArea(String JavaDoc text) {
181         txtJTextArea().setText(text);
182     }
183
184     /** types text for txtJTextArea
185      * @param text String text
186      */

187     public void typeJTextArea(String JavaDoc text) {
188         txtJTextArea().typeText(text);
189     }
190
191     /** clicks on "Do not synchronize this object now (to do so explicitly, use Tools | Synchronize)" JRadioButton
192      */

193     public void doNotSynchronizeThisObjectNowToDoSoExplicitlyUseToolsSynchronize() {
194         rbDoNotSynchronizeThisObjectNowToDoSoExplicitlyUseToolsSynchronize().push();
195     }
196
197     /** clicks on "Confirm all changes during synchronization" JRadioButton
198      */

199     public void confirmAllChangesDuringSynchronization() {
200         rbConfirmAllChangesDuringSynchronization().push();
201     }
202
203     /** clicks on "Perform synchronization without confirmation" JRadioButton
204      */

205     public void performSynchronizationWithoutConfirmation() {
206         rbPerformSynchronizationWithoutConfirmation().push();
207     }
208
209     /** clicks on "Process" JButton
210      */

211     public void process() {
212         btProcess().push();
213     }
214
215     /** clicks on "Process All" JButton
216      */

217     public void processAll() {
218         btProcessAll().push();
219     }
220
221     /** clicks on "Help" JButton
222      */

223     public void help() {
224         btHelp().push();
225     }
226
227     /** clicks on "Close" JButton
228      */

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

238     /** Performs verification of ConfirmChanges by accessing all its components.
239      */

240     public void verify() {
241         txtJTextArea();
242         lblChangesList();
243         lstChangesList();
244         rbDoNotSynchronizeThisObjectNowToDoSoExplicitlyUseToolsSynchronize();
245         rbConfirmAllChangesDuringSynchronization();
246         rbPerformSynchronizationWithoutConfirmation();
247         btProcess();
248         btProcessAll();
249         btHelp();
250         btClose();
251     }
252
253     /** Performs simple test of ConfirmChanges
254     * @param args the command line arguments
255     */

256     public static void main(String JavaDoc args[]) {
257         new ConfirmChangesDialog().verify();
258         System.out.println("ConfirmChanges verification finished.");
259     }
260 }
261
262
Popular Tags