KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > jellytools > modules > xml > SelectXSLTScriptDialog


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 package org.netbeans.jellytools.modules.xml;
20
21 import org.netbeans.jemmy.operators.*;
22
23 /** Class implementing all necessary methods for handling "Select XSLT Script" FileSelector.
24  *
25  * @author ms113234
26  * @version 1.0
27  */

28 public class SelectXSLTScriptDialog extends JDialogOperator {
29
30     /** Creates new SelectXSLTScriptDialog that can handle it.
31      * @throws TimeoutExpiredException when FileSelector not found
32      */

33     public SelectXSLTScriptDialog() {
34         super( "Select XSLT Script" );
35     }
36
37     private JTreeOperator _treeTreeView;
38     private JLabelOperator _lblSelect;
39     private JButtonOperator _btOK;
40     private JButtonOperator _btCancel;
41     private JComboBoxOperator _cboSelect;
42     public static final String JavaDoc ITEM_HOMEMS113234NETBEANS34BETASAMPLEDIR = "/home/ms113234/.netbeans/3.4beta/sampledir";
43     
44     
45     //******************************
46
// Subcomponents definition part
47
//******************************
48

49     /** Tries to find null TreeView$ExplorerTree in this dialog.
50      * @throws TimeoutExpiredException when component not found
51      * @return JTreeOperator
52      */

53     public JTreeOperator treeTreeView() {
54         if (_treeTreeView==null) {
55             _treeTreeView = new JTreeOperator(this, 0);
56         }
57         return _treeTreeView;
58     }
59     
60     /** Tries to find "Select:" JLabel in this dialog.
61      * @throws TimeoutExpiredException when component not found
62      * @return JLabelOperator
63      */

64     public JLabelOperator lblSelect() {
65         if (_lblSelect==null) {
66             _lblSelect = new JLabelOperator( this, "Select:", 0 );
67         }
68         return _lblSelect;
69     }
70     
71     /** Tries to find "OK" ButtonBarButton in this dialog.
72      * @throws TimeoutExpiredException when component not found
73      * @return JButtonOperator
74      */

75     public JButtonOperator btOK() {
76         if (_btOK==null) {
77             _btOK = new JButtonOperator( this, "OK", 0 );
78         }
79         return _btOK;
80     }
81     
82     /** Tries to find "Cancel" ButtonBarButton in this dialog.
83      * @throws TimeoutExpiredException when component not found
84      * @return JButtonOperator
85      */

86     public JButtonOperator btCancel() {
87         if (_btCancel==null) {
88             _btCancel = new JButtonOperator( this, "Cancel", 0 );
89         }
90         return _btCancel;
91     }
92     
93     /** Tries to find null JComboBox in this dialog.
94      * @throws TimeoutExpiredException when component not found
95      * @return JComboBoxOperator
96      */

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

109     /** clicks on "OK" ButtonBarButton
110      * @throws TimeoutExpiredException when ButtonBarButton not found
111      */

112     public void oK() {
113         btOK().push();
114     }
115     
116     /** clicks on "Cancel" ButtonBarButton
117      * @throws TimeoutExpiredException when ButtonBarButton not found
118      */

119     public void cancel() {
120         btCancel().push();
121     }
122     
123     /** tries to find cboSelect and select item
124      * @param item String item
125      */

126     public void setSelect( String JavaDoc item ) {
127         cboSelect().selectItem(item, true, true);
128     }
129     
130     
131     //*****************************************
132
// High-level functionality definition part
133
//*****************************************
134

135     /** Performs verification of SelectXSLTScriptDialog by accessing all its components.
136      * @throws TimeoutExpiredException when any component not found
137      */

138     public void verify() {
139         treeTreeView();
140         lblSelect();
141         btOK();
142         btCancel();
143         cboSelect();
144     }
145     
146     /** Performs simple test of SelectXSLTScriptDialog
147      * @param args the command line arguments
148      */

149     public static void main(String JavaDoc args[]) {
150         new SelectXSLTScriptDialog().verify();
151         System.out.println("SelectXSLTScriptDialog verification finished.");
152     }
153 }
154
Popular Tags