1 19 20 package org.netbeans.test.jsf; 21 22 import javax.swing.JComboBox ; 23 import javax.swing.JTextField ; 24 import org.netbeans.jellytools.WizardOperator; 25 import org.netbeans.jemmy.operators.JComboBoxOperator; 26 import org.netbeans.jemmy.operators.JLabelOperator; 27 import org.netbeans.jemmy.operators.JTextAreaOperator; 28 import org.netbeans.jemmy.operators.JTextFieldOperator; 29 30 31 35 public class NewJSFBeanStepOperator extends WizardOperator { 36 37 39 public NewJSFBeanStepOperator() { 40 super("New JSF Managed Bean"); 41 checkPanel("Name and Location"); 42 } 43 44 private JLabelOperator _lblNameAndLocation; 45 private JLabelOperator _lblClassName; 46 private JTextFieldOperator _txtClassName; 47 private JLabelOperator _lblProject; 48 private JTextFieldOperator _txtProject; 49 private JLabelOperator _lblLocation; 50 private JComboBoxOperator _cboLocation; 51 private JLabelOperator _lblPackage; 52 private JComboBoxOperator _cboPackage; 53 private JLabelOperator _lblCreatedFile; 54 private JTextFieldOperator _txtCreatedFile; 55 private JLabelOperator _lblConfigurationFile; 56 private JComboBoxOperator _cboConfigurationFile; 57 private JLabelOperator _lblScope; 58 private JComboBoxOperator _cboScope; 59 private JLabelOperator _lblBeanDescription; 60 private JTextAreaOperator _txtBeanDescription; 61 62 63 64 68 71 public JLabelOperator lblNameAndLocation() { 72 if (_lblNameAndLocation==null) { 73 _lblNameAndLocation = new JLabelOperator(this, "Name and Location"); 74 } 75 return _lblNameAndLocation; 76 } 77 78 81 public JLabelOperator lblClassName() { 82 if (_lblClassName==null) { 83 _lblClassName = new JLabelOperator(this, "Class Name:"); 84 } 85 return _lblClassName; 86 } 87 88 91 public JTextFieldOperator txtClassName() { 92 if (_txtClassName==null) { 93 _txtClassName = new JTextFieldOperator((JTextField )lblClassName().getLabelFor()); 94 } 95 return _txtClassName; 96 } 97 98 101 public JLabelOperator lblProject() { 102 if (_lblProject==null) { 103 _lblProject = new JLabelOperator(this, "Project:"); 104 } 105 return _lblProject; 106 } 107 108 111 public JTextFieldOperator txtProject() { 112 if (_txtProject==null) { 113 _txtProject = new JTextFieldOperator((JTextField )lblProject().getLabelFor()); 114 } 115 return _txtProject; 116 } 117 118 121 public JLabelOperator lblLocation() { 122 if (_lblLocation==null) { 123 _lblLocation = new JLabelOperator(this, "Location:"); 124 } 125 return _lblLocation; 126 } 127 128 131 public JComboBoxOperator cboLocation() { 132 if (_cboLocation==null) { 133 _cboLocation = new JComboBoxOperator((JComboBox )lblLocation().getLabelFor()); 134 } 135 return _cboLocation; 136 } 137 138 141 public JLabelOperator lblPackage() { 142 if (_lblPackage==null) { 143 _lblPackage = new JLabelOperator(this, "Package:"); 144 } 145 return _lblPackage; 146 } 147 148 151 public JComboBoxOperator cboPackage() { 152 if (_cboPackage==null) { 153 _cboPackage = new JComboBoxOperator((JComboBox )lblPackage().getLabelFor()); 154 } 155 return _cboPackage; 156 } 157 158 161 public JLabelOperator lblCreatedFile() { 162 if (_lblCreatedFile==null) { 163 _lblCreatedFile = new JLabelOperator(this, "Created File:"); 164 } 165 return _lblCreatedFile; 166 } 167 168 171 public JTextFieldOperator txtCreatedFile() { 172 if (_txtCreatedFile==null) { 173 _txtCreatedFile = new JTextFieldOperator((JTextField )lblCreatedFile().getLabelFor()); 174 } 175 return _txtCreatedFile; 176 } 177 178 181 public JLabelOperator lblConfigurationFile() { 182 if (_lblConfigurationFile==null) { 183 _lblConfigurationFile = new JLabelOperator(this, "Configuration File:"); 184 } 185 return _lblConfigurationFile; 186 } 187 188 191 public JComboBoxOperator cboConfigurationFile() { 192 if (_cboConfigurationFile==null) { 193 _cboConfigurationFile = new JComboBoxOperator((JComboBox )lblConfigurationFile().getLabelFor()); 194 } 195 return _cboConfigurationFile; 196 } 197 198 201 public JLabelOperator lblScope() { 202 if (_lblScope==null) { 203 _lblScope = new JLabelOperator(this, "Scope:"); 204 } 205 return _lblScope; 206 } 207 208 211 public JComboBoxOperator cboScope() { 212 if (_cboScope==null) { 213 _cboScope = new JComboBoxOperator((JComboBox )lblScope().getLabelFor()); 214 } 215 return _cboScope; 216 } 217 218 221 public JLabelOperator lblBeanDescription() { 222 if (_lblBeanDescription==null) { 223 _lblBeanDescription = new JLabelOperator(this, "Bean Description:"); 224 } 225 return _lblBeanDescription; 226 } 227 228 231 public JTextAreaOperator txtBeanDescription() { 232 if (_txtBeanDescription==null) { 233 _txtBeanDescription = new JTextAreaOperator(this); 234 } 235 return _txtBeanDescription; 236 } 237 238 239 240 244 247 public String getClassName() { 248 return txtClassName().getText(); 249 } 250 251 254 public void setClassName(String text) { 255 txtClassName().setText(text); 256 } 257 258 261 public void typeClassName(String text) { 262 txtClassName().typeText(text); 263 } 264 265 268 public String getProject() { 269 return txtProject().getText(); 270 } 271 272 275 public void setProject(String text) { 276 txtProject().setText(text); 277 } 278 279 282 public void typeProject(String text) { 283 txtProject().typeText(text); 284 } 285 286 289 public String getSelectedLocation() { 290 return cboLocation().getSelectedItem().toString(); 291 } 292 293 296 public void selectLocation(String item) { 297 cboLocation().selectItem(item); 298 } 299 300 303 public String getSelectedPackage() { 304 return cboPackage().getSelectedItem().toString(); 305 } 306 307 310 public void selectPackage(String item) { 311 cboPackage().selectItem(item); 312 } 313 314 317 public void typePackage(String text) { 318 cboPackage().typeText(text); 319 } 320 321 324 public String getCreatedFile() { 325 return txtCreatedFile().getText(); 326 } 327 328 331 public void setCreatedFile(String text) { 332 txtCreatedFile().setText(text); 333 } 334 335 338 public void typeCreatedFile(String text) { 339 txtCreatedFile().typeText(text); 340 } 341 342 345 public String getSelectedConfigurationFile() { 346 return cboConfigurationFile().getSelectedItem().toString(); 347 } 348 349 352 public void selectConfigurationFile(String item) { 353 cboConfigurationFile().selectItem(item); 354 } 355 356 359 public String getSelectedScope() { 360 return cboScope().getSelectedItem().toString(); 361 } 362 363 366 public void selectScope(String item) { 367 cboScope().selectItem(item); 368 } 369 370 373 public String getBeanDescription() { 374 return txtBeanDescription().getText(); 375 } 376 377 380 public void setBeanDescription(String text) { 381 txtBeanDescription().setText(text); 382 } 383 384 387 public void typeBeanDescription(String text) { 388 txtBeanDescription().typeText(text); 389 } 390 391 395 397 public void verify() { 398 lblNameAndLocation(); 399 lblClassName(); 400 txtClassName(); 401 lblProject(); 402 txtProject(); 403 lblLocation(); 404 cboLocation(); 405 lblPackage(); 406 cboPackage(); 407 lblCreatedFile(); 408 txtCreatedFile(); 409 lblConfigurationFile(); 410 cboConfigurationFile(); 411 lblScope(); 412 cboScope(); 413 lblBeanDescription(); 414 txtBeanDescription(); 415 btBack(); 416 btNext(); 417 btFinish(); 418 btCancel(); 419 btHelp(); 420 } 421 422 } 423 424 | Popular Tags |