KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > i18n > jelly > NewBundleOperator


1 /*
2  * NewBundle.java
3  *
4  * Created on 11/27/03 3:00 PM
5  */

6 package org.netbeans.i18n.jelly;
7
8 import org.netbeans.jellytools.Bundle;
9 import org.netbeans.jemmy.operators.*;
10 import org.netbeans.jemmy.util.NameComponentChooser;
11
12 /** Class implementing all necessary methods for handling "New Bundle" FileSelector.
13  *
14  * @author eh103527
15  * @version 1.0
16  */

17 public class NewBundleOperator extends JDialogOperator {
18     
19     /** Creates new NewBundle that can handle it.
20      */

21     public NewBundleOperator() {
22         super(Bundle.getStringTrimmed("org.netbeans.modules.i18n.Bundle", "CTL_Template_Dialog_Title"));
23     }
24     
25     private JLabelOperator _lblFilesystem;
26     private JComboBoxOperator _cboFilesystem;
27     private JTreeOperator _treeTreeView;
28     private JLabelOperator _lblObjectName;
29     private JTextFieldOperator _txtObjectName;
30     private JButtonOperator _btOK;
31     private JButtonOperator _btCancel;
32     
33     
34     //******************************
35
// Subcomponents definition part
36
//******************************
37

38     /** Tries to find " Filesystem:" JLabel in this dialog.
39      * @return JLabelOperator
40      */

41     public JLabelOperator lblFilesystem() {
42         if (_lblFilesystem==null) {
43             _lblFilesystem = new JLabelOperator(this, Bundle.getStringTrimmed("org.netbeans.modules.i18n.Bundle", "CTL_Template_Dialog_RootTitle"));
44         }
45         return _lblFilesystem;
46     }
47     
48     /** Tries to find null JComboBox in this dialog.
49      * @return JComboBoxOperator
50      */

51     public JComboBoxOperator cboFilesystem() {
52         if (_cboFilesystem==null) {
53             _cboFilesystem = new JComboBoxOperator(this);
54         }
55         return _cboFilesystem;
56     }
57     
58     /** Tries to find null TreeView$ExplorerTree in this dialog.
59      * @return JTreeOperator
60      */

61     public JTreeOperator treeTreeView() {
62         if (_treeTreeView==null) {
63             _treeTreeView = new JTreeOperator(this);
64         }
65         return _treeTreeView;
66     }
67     
68     /** Tries to find "Object Name" JLabel in this dialog.
69      * @return JLabelOperator
70      */

71     public JLabelOperator lblObjectName() {
72         if (_lblObjectName==null) {
73             _lblObjectName = new JLabelOperator(this, Bundle.getStringTrimmed("org.netbeans.modules.i18n.Bundle", "LBL_TemplateName"));
74         }
75         return _lblObjectName;
76     }
77     
78     /** Tries to find null JTextField in this dialog.
79      * @return JTextFieldOperator
80      */

81     public JTextFieldOperator txtObjectName() {
82         if (_txtObjectName==null) {
83             _txtObjectName = new JTextFieldOperator(this);
84         }
85         return _txtObjectName;
86     }
87     
88     /** Tries to find "OK" ButtonBarButton in this dialog.
89      * @return JButtonOperator
90      */

91     public JButtonOperator btOK() {
92         if (_btOK==null) {
93             _btOK = new JButtonOperator(this, Bundle.getStringTrimmed("org.netbeans.modules.i18n.Bundle", "CTL_OKButton"));
94         }
95         return _btOK;
96     }
97     
98     /** Tries to find "Cancel" ButtonBarButton in this dialog.
99      * @return JButtonOperator
100      */

101     public JButtonOperator btCancel() {
102         if (_btCancel==null) {
103             _btCancel = new JButtonOperator(this, Bundle.getStringTrimmed("org.netbeans.modules.i18n.Bundle", "CTL_CancelButton"));
104         }
105         return _btCancel;
106     }
107     
108     
109     //****************************************
110
// Low-level functionality definition part
111
//****************************************
112

113     /** returns selected item for cboFilesystem
114      * @return String item
115      */

116     public String JavaDoc getSelectedFilesystem() {
117         return cboFilesystem().getSelectedItem().toString();
118     }
119     
120     /** selects item for cboFilesystem
121      * @param item String item
122      */

123     public void selectFilesystem(String JavaDoc item) {
124         cboFilesystem().selectItem(item);
125     }
126     
127     /** gets text for txtObjectName
128      * @return String text
129      */

130     public String JavaDoc getObjectName() {
131         return txtObjectName().getText();
132     }
133     
134     /** sets text for txtObjectName
135      * @param text String text
136      */

137     public void setObjectName(String JavaDoc text) {
138         txtObjectName().setText(text);
139     }
140     
141     /** types text for txtObjectName
142      * @param text String text
143      */

144     public void typeObjectName(String JavaDoc text) {
145         txtObjectName().typeText(text);
146     }
147     
148     /** clicks on "OK" ButtonBarButton
149      */

150     public void ok() {
151         btOK().pushNoBlock();
152     }
153     
154     /** clicks on "Cancel" ButtonBarButton
155      */

156     public void cancel() {
157         btCancel().push();
158     }
159     
160     
161     //*****************************************
162
// High-level functionality definition part
163
//*****************************************
164

165     /** Performs verification of NewBundle by accessing all its components.
166      */

167     public void verify() {
168         lblFilesystem();
169         cboFilesystem();
170         treeTreeView();
171         lblObjectName();
172         txtObjectName();
173         btOK();
174         btCancel();
175     }
176     
177     public void createDefault() {
178         
179     }
180     
181     /** Performs simple test of NewBundle
182      * @param args the command line arguments
183      */

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