KickJava   Java API By Example, From Geeks To Geeks.

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


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

6 package org.netbeans.test.subversion.operators;
7
8 import org.netbeans.jellytools.NbDialogOperator;
9 import org.netbeans.jellytools.TreeTableOperator;
10 import org.netbeans.jellytools.nodes.Node;
11 import org.netbeans.jemmy.operators.*;
12
13 /** Class implementing all necessary methods for handling "Repository browser - file:///tmp/repo" NbDialog.
14  *
15  * @author peter
16  * @version 1.0
17  */

18 public class RepositoryBrowserImpOperator extends NbDialogOperator {
19
20     /**
21      * Creates new RepositoryBrowserImpOperator that can handle it.
22      */

23     public RepositoryBrowserImpOperator() {
24         super("Browse Repository");
25     }
26
27     private TreeTableOperator _tree;
28     private JLabelOperator _lblSpecifyFolderToCheckout;
29     private JButtonOperator _btStop;
30     private JButtonOperator _btNewFolder;
31     private JButtonOperator _btOK;
32     private JButtonOperator _btCancel;
33     private JButtonOperator _btHelp;
34
35
36     //******************************
37
// Subcomponents definition part
38
//******************************
39

40     /** Tries to find null TreeView$ExplorerTree in this dialog.
41      * @return JTreeOperator
42      */

43     public TreeTableOperator tree() {
44         if (_tree==null) {
45             _tree = new TreeTableOperator(this);
46         }
47         return _tree;
48     }
49
50     /** Tries to find "Specify Folder to checkout:" JLabel in this dialog.
51      * @return JLabelOperator
52      */

53     public JLabelOperator lblSpecifyFolderToCheckout() {
54         if (_lblSpecifyFolderToCheckout==null) {
55             _lblSpecifyFolderToCheckout = new JLabelOperator(this);
56         }
57         return _lblSpecifyFolderToCheckout;
58     }
59     
60     /** Tries to find "Stop" JButton in this dialog.
61      * @return JButtonOperator
62      */

63     public JButtonOperator btStop() {
64         if (_btStop==null) {
65             _btStop = new JButtonOperator(this, "Stop");
66         }
67         return _btStop;
68     }
69     
70     /** Tries to find "New folder" JButton in this dialog.
71      * @return JButtonOperator
72      */

73     public JButtonOperator btNewFolder() {
74         if (_btNewFolder==null) {
75             _btNewFolder = new JButtonOperator(this, "New folder");
76         }
77         return _btNewFolder;
78     }
79
80     /** Tries to find "OK" JButton in this dialog.
81      * @return JButtonOperator
82      */

83     public JButtonOperator btOK() {
84         if (_btOK==null) {
85             _btOK = new JButtonOperator(this, "OK");
86         }
87         return _btOK;
88     }
89
90     /** Tries to find "Cancel" JButton in this dialog.
91      * @return JButtonOperator
92      */

93     public JButtonOperator btCancel() {
94         if (_btCancel==null) {
95             _btCancel = new JButtonOperator(this, "Cancel");
96         }
97         return _btCancel;
98     }
99
100     /** Tries to find "Help" JButton in this dialog.
101      * @return JButtonOperator
102      */

103     public JButtonOperator btHelp() {
104         if (_btHelp==null) {
105             _btHelp = new JButtonOperator(this, "Help");
106         }
107         return _btHelp;
108     }
109
110
111     //****************************************
112
// Low-level functionality definition part
113
//****************************************
114

115     /** Selects a folder denoted by path.
116      * @param path path to folder without root (e.g. "folder|subfolder")
117      */

118     public void selectFolder(String JavaDoc path) {
119         new Node(tree().tree(), path).select();
120     }
121     
122     /** clicks on "New folder" JButton
123      */

124     public CreateNewFolderOperator createNewFolder() {
125         btNewFolder().pushNoBlock();
126         return new CreateNewFolderOperator();
127     }
128
129     /** clicks on "OK" JButton
130      */

131     public void ok() {
132         btOK().push();
133     }
134
135     /** clicks on "Cancel" JButton
136      */

137     public void cancel() {
138         btCancel().push();
139     }
140
141     /** clicks on "Help" JButton
142      */

143     public void help() {
144         btHelp().push();
145     }
146
147
148     //*****************************************
149
// High-level functionality definition part
150
//*****************************************
151

152     /**
153      * Performs verification of RepositoryBrowserImpOperator by accessing all its components.
154      */

155     public void verify() {
156         tree();
157         lblSpecifyFolderToCheckout();
158         btNewFolder();
159         btOK();
160         btCancel();
161         btHelp();
162     }
163 }
164
165
Popular Tags