KickJava   Java API By Example, From Geeks To Geeks.

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


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.nodes.Node;
10 import org.netbeans.jemmy.operators.*;
11
12 /** Class implementing all necessary methods for handling "RepositoryBrowserOperator" NbDialog.
13  *
14  * @author peter
15  * @version 1.0
16  */

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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