KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > jellytools > modules > editor > CreateNewProfileDialog


1 /*
2  * CreateNewProfileDialog.java
3  *
4  * Created on 2/27/07 5:45 PM
5  */

6 package org.netbeans.jellytools.modules.editor;
7
8 import org.netbeans.jemmy.operators.*;
9 import org.netbeans.jemmy.util.NameComponentChooser;
10
11 /** Class implementing all necessary methods for handling "Create New Profile Dialog" NbPresenter.
12  *
13  * @author jp159440
14  * @version 1.0
15  */

16 public class CreateNewProfileDialog extends JDialogOperator {
17
18     /** Creates new CreateNewProfileDialog that can handle it.
19      */

20     public CreateNewProfileDialog() {
21         super("Create New Profile Dialog");
22     }
23
24     private JLabelOperator _lblProfileName;
25     private JTextFieldOperator _txtProfileName;
26     private JButtonOperator _btOK;
27     private JButtonOperator _btCancel;
28
29
30     //******************************
31
// Subcomponents definition part
32
//******************************
33

34     /** Tries to find "Profile Name:" JLabel in this dialog.
35      * @return JLabelOperator
36      */

37     public JLabelOperator lblProfileName() {
38         if (_lblProfileName==null) {
39             _lblProfileName = new JLabelOperator(this, "Profile Name:");
40         }
41         return _lblProfileName;
42     }
43
44     /** Tries to find null JTextField in this dialog.
45      * @return JTextFieldOperator
46      */

47     public JTextFieldOperator txtProfileName() {
48         if (_txtProfileName==null) {
49             _txtProfileName = new JTextFieldOperator(this);
50         }
51         return _txtProfileName;
52     }
53
54     /** Tries to find "OK" JButton in this dialog.
55      * @return JButtonOperator
56      */

57     public JButtonOperator btOK() {
58         if (_btOK==null) {
59             _btOK = new JButtonOperator(this, "OK");
60         }
61         return _btOK;
62     }
63
64     /** Tries to find "Cancel" JButton in this dialog.
65      * @return JButtonOperator
66      */

67     public JButtonOperator btCancel() {
68         if (_btCancel==null) {
69             _btCancel = new JButtonOperator(this, "Cancel");
70         }
71         return _btCancel;
72     }
73
74
75     //****************************************
76
// Low-level functionality definition part
77
//****************************************
78

79     /** gets text for txtProfileName
80      * @return String text
81      */

82     public String JavaDoc getProfileName() {
83         return txtProfileName().getText();
84     }
85
86     /** sets text for txtProfileName
87      * @param text String text
88      */

89     public void setProfileName(String JavaDoc text) {
90         txtProfileName().setText(text);
91     }
92
93     /** types text for txtProfileName
94      * @param text String text
95      */

96     public void typeProfileName(String JavaDoc text) {
97         txtProfileName().typeText(text);
98     }
99
100     /** clicks on "OK" JButton
101      */

102     public void ok() {
103         btOK().push();
104     }
105
106     /** clicks on "Cancel" JButton
107      */

108     public void cancel() {
109         btCancel().push();
110     }
111
112
113     //*****************************************
114
// High-level functionality definition part
115
//*****************************************
116

117     /** Performs verification of CreateNewProfileDialog by accessing all its components.
118      */

119     public void verify() {
120         lblProfileName();
121         txtProfileName();
122         btOK();
123         btCancel();
124     }
125
126     /** Performs simple test of CreateNewProfileDialog
127     * @param args the command line arguments
128     */

129     public static void main(String JavaDoc args[]) {
130         new CreateNewProfileDialog().verify();
131         System.out.println("CreateNewProfileDialog verification finished.");
132     }
133 }
134
135
Popular Tags