KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2  * RepositoryBrowserOperator.java
3  *
4  * Created on 19/04/06 13:26
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 "RepositoryBrowserOperator" NbDialog.
14  *
15  * @author peter
16  * @version 1.0
17  */

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

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

37     /** Tries to find null TreeView$ExplorerTree in this dialog.
38      * @return JTreeOperator
39      */

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

50     public JLabelOperator lblSpecifyFolderToCheckout() {
51         if (_lblSpecifyFolderToCheckout==null) {
52             _lblSpecifyFolderToCheckout = new JLabelOperator(this);
53         }
54         return _lblSpecifyFolderToCheckout;
55     }
56     
57     //****************************************
58
// Low-level functionality definition part
59
//****************************************
60

61     /** Selects a folder denoted by path.
62      * @param path path to folder without root (e.g. "folder|subfolder")
63      */

64     public void selectFolder(String JavaDoc path) {
65         new Node(tree().tree(), path).select();
66     }
67     
68     /** Tries to find "OK" JButton in this dialog.
69      * @return JButtonOperator
70      */

71     public JButtonOperator btOK() {
72         if (_btOK==null) {
73             _btOK = new JButtonOperator(this, "OK");
74         }
75         return _btOK;
76     }
77
78     /** Tries to find "Cancel" JButton in this dialog.
79      * @return JButtonOperator
80      */

81     public JButtonOperator btCancel() {
82         if (_btCancel==null) {
83             _btCancel = new JButtonOperator(this, "Cancel");
84         }
85         return _btCancel;
86     }
87
88     /** Tries to find "Help" JButton in this dialog.
89      * @return JButtonOperator
90      */

91     public JButtonOperator btHelp() {
92         if (_btHelp==null) {
93             _btHelp = new JButtonOperator(this, "Help");
94         }
95         return _btHelp;
96     }
97
98
99     //****************************************
100
// Low-level functionality definition part
101
//****************************************
102

103     /** clicks on "OK" JButton
104      */

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

111     public void cancel() {
112         btCancel().push();
113     }
114
115     /** clicks on "Help" JButton
116      */

117     public void help() {
118         btHelp().push();
119     }
120
121
122     //*****************************************
123
// High-level functionality definition part
124
//*****************************************
125

126     /** Performs verification of RepositoryBrowserOperator by accessing all its components.
127      */

128     public void verify() {
129         tree();
130         lblSpecifyFolderToCheckout();
131         btOK();
132         btCancel();
133         btHelp();
134     }
135 }
136
137
Popular Tags