KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > test > subversion > operators > CreateNewFolderOperator


1 /*
2  * CreateNewFolderOperator.java
3  *
4  * Created on 11/05/06 10:38
5  */

6 package org.netbeans.test.subversion.operators;
7
8 import org.netbeans.jellytools.NbDialogOperator;
9 import org.netbeans.jemmy.operators.*;
10
11 /** Class implementing all necessary methods for handling "Create a new folder" NbPresenter.
12  *
13  * @author peter
14  * @version 1.0
15  */

16 public class CreateNewFolderOperator extends NbDialogOperator {
17
18     /**
19      * Creates new CreateNewFolderOperator that can handle it.
20      */

21     public CreateNewFolderOperator() {
22         super("Specify a new folder");
23     }
24
25     private JLabelOperator _lblFolderName;
26     private JTextFieldOperator _txtFolderName;
27     private JButtonOperator _btOK;
28     private JButtonOperator _btCancel;
29
30
31     //******************************
32
// Subcomponents definition part
33
//******************************
34

35     /** Tries to find "Folder name:" JLabel in this dialog.
36      * @return JLabelOperator
37      */

38     public JLabelOperator lblFolderName() {
39         if (_lblFolderName==null) {
40             _lblFolderName = new JLabelOperator(this, "Folder name:");
41         }
42         return _lblFolderName;
43     }
44
45     /** Tries to find null JTextField in this dialog.
46      * @return JTextFieldOperator
47      */

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

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

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

80     /** gets text for txtFolderName
81      * @return String text
82      */

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

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

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

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

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

118     /**
119      * Performs verification of CreateNewFolderOperator by accessing all its components.
120      */

121     public void verify() {
122         lblFolderName();
123         txtFolderName();
124         btOK();
125         btCancel();
126     }
127 }
128
129
Popular Tags