1 6 package org.netbeans.test.subversion.operators; 7 8 import org.netbeans.jellytools.NbDialogOperator; 9 import org.netbeans.jemmy.operators.*; 10 11 16 public class ProxyConfigurationOperator extends NbDialogOperator { 17 18 21 public ProxyConfigurationOperator() { 22 super("Proxy Configuration"); 23 } 24 25 private JRadioButtonOperator _rbUseSystemProxySettings; 26 private JRadioButtonOperator _rbNoProxyDirectConnection; 27 private JRadioButtonOperator _rbHTTPProxy; 28 private JLabelOperator _lblProxyHost; 30 private JTextFieldOperator _txtProxyHost; 31 private JLabelOperator _lblPort; 32 private JTextFieldOperator _txtPort; 33 private JCheckBoxOperator _cbProxyServerRequiresLogin; 34 private JLabelOperator _lblName; 35 private JTextFieldOperator _txtName; 36 private JLabelOperator _lblPassword; 37 private JPasswordFieldOperator _txtPassword; 38 private JButtonOperator _btOK; 39 private JButtonOperator _btCancel; 40 private JButtonOperator _btHelp; 41 42 43 47 50 public JRadioButtonOperator rbUseSystemProxySettings() { 51 if (_rbUseSystemProxySettings==null) { 52 _rbUseSystemProxySettings = new JRadioButtonOperator(this, "Use NetBeans Proxy Settings"); 53 } 54 return _rbUseSystemProxySettings; 55 } 56 57 60 public JRadioButtonOperator rbNoProxyDirectConnection() { 61 if (_rbNoProxyDirectConnection==null) { 62 _rbNoProxyDirectConnection = new JRadioButtonOperator(this, "No Proxy (direct connection)"); 63 } 64 return _rbNoProxyDirectConnection; 65 } 66 67 70 public JRadioButtonOperator rbHTTPProxy() { 71 if (_rbHTTPProxy==null) { 72 _rbHTTPProxy = new JRadioButtonOperator(this, "HTTP Proxy"); 73 } 74 return _rbHTTPProxy; 75 } 76 77 80 public JLabelOperator lblProxyHost() { 81 if (_lblProxyHost==null) { 82 _lblProxyHost = new JLabelOperator(this, "Proxy Host:"); 83 } 84 return _lblProxyHost; 85 } 86 87 90 public JTextFieldOperator txtProxyHost() { 91 if (_txtProxyHost==null) { 92 _txtProxyHost = new JTextFieldOperator(this); 93 } 94 return _txtProxyHost; 95 } 96 97 100 public JLabelOperator lblPort() { 101 if (_lblPort==null) { 102 _lblPort = new JLabelOperator(this, "Port:"); 103 } 104 return _lblPort; 105 } 106 107 110 public JTextFieldOperator txtPort() { 111 if (_txtPort==null) { 112 _txtPort = new JTextFieldOperator(this, 1); 113 } 114 return _txtPort; 115 } 116 117 120 public JCheckBoxOperator cbProxyServerRequiresLogin() { 121 if (_cbProxyServerRequiresLogin==null) { 122 _cbProxyServerRequiresLogin = new JCheckBoxOperator(this, "Proxy Server Requires Login"); 123 } 124 return _cbProxyServerRequiresLogin; 125 } 126 127 130 public JLabelOperator lblName() { 131 if (_lblName==null) { 132 _lblName = new JLabelOperator(this, "Name:"); 133 } 134 return _lblName; 135 } 136 137 140 public JTextFieldOperator txtName() { 141 if (_txtName==null) { 142 _txtName = new JTextFieldOperator(this, 2); 143 } 144 return _txtName; 145 } 146 147 150 public JLabelOperator lblPassword() { 151 if (_lblPassword==null) { 152 _lblPassword = new JLabelOperator(this, "Password:"); 153 } 154 return _lblPassword; 155 } 156 157 160 public JPasswordFieldOperator txtPassword() { 161 if (_txtPassword==null) { 162 _txtPassword = new JPasswordFieldOperator(this); 163 } 164 return _txtPassword; 165 } 166 167 170 public JButtonOperator btOK() { 171 if (_btOK==null) { 172 _btOK = new JButtonOperator(this, "OK"); 173 } 174 return _btOK; 175 } 176 177 180 public JButtonOperator btCancel() { 181 if (_btCancel==null) { 182 _btCancel = new JButtonOperator(this, "Cancel"); 183 } 184 return _btCancel; 185 } 186 187 190 public JButtonOperator btHelp() { 191 if (_btHelp==null) { 192 _btHelp = new JButtonOperator(this, "Help"); 193 } 194 return _btHelp; 195 } 196 197 198 202 204 public void useSystemProxySettings() { 205 rbUseSystemProxySettings().push(); 206 } 207 208 210 public void noProxyDirectConnection() { 211 rbNoProxyDirectConnection().push(); 212 } 213 214 216 public void hTTPProxy() { 217 rbHTTPProxy().push(); 218 } 219 220 223 public String getProxyHost() { 224 return txtProxyHost().getText(); 225 } 226 227 230 public void setProxyHost(String text) { 231 txtProxyHost().setText(text); 232 } 233 234 237 public void typeProxyHost(String text) { 238 txtProxyHost().typeText(text); 239 } 240 241 244 public String getPort() { 245 return txtPort().getText(); 246 } 247 248 251 public void setPort(String text) { 252 txtPort().setText(text); 253 } 254 255 258 public void typePort(String text) { 259 txtPort().typeText(text); 260 } 261 262 265 public void checkProxyServerRequiresLogin(boolean state) { 266 if (cbProxyServerRequiresLogin().isSelected()!=state) { 267 cbProxyServerRequiresLogin().push(); 268 } 269 } 270 271 274 public String getName() { 275 return txtName().getText(); 276 } 277 278 281 public void setName(String text) { 282 txtName().setText(text); 283 } 284 285 288 public void typeName(String text) { 289 txtName().typeText(text); 290 } 291 292 295 public void setPassword(String text) { 296 txtPassword().setText(text); 297 } 298 299 302 public void typePassword(String text) { 303 txtPassword().typeText(text); 304 } 305 306 308 public void ok() { 309 btOK().push(); 310 } 311 312 314 public void cancel() { 315 btCancel().push(); 316 } 317 318 320 public void help() { 321 btHelp().push(); 322 } 323 324 325 329 332 public void verify() { 333 rbUseSystemProxySettings(); 334 rbNoProxyDirectConnection(); 335 rbHTTPProxy(); 336 lblProxyHost(); 337 txtProxyHost(); 338 lblPort(); 339 txtPort(); 340 cbProxyServerRequiresLogin(); 341 lblName(); 342 txtName(); 343 lblPassword(); 344 txtPassword(); 345 btOK(); 346 btCancel(); 347 btHelp(); 348 } 349 } 350 351 | Popular Tags |