1 19 20 package org.netbeans.test.jsf; 21 22 import javax.swing.JComboBox ; 23 import javax.swing.JTextField ; 24 import org.netbeans.jellytools.NbDialogOperator; 25 import org.netbeans.jemmy.operators.JButtonOperator; 26 import org.netbeans.jemmy.operators.JCheckBoxOperator; 27 import org.netbeans.jemmy.operators.JComboBoxOperator; 28 import org.netbeans.jemmy.operators.JLabelOperator; 29 import org.netbeans.jemmy.operators.JTextAreaOperator; 30 import org.netbeans.jemmy.operators.JTextFieldOperator; 31 32 33 37 public class AddNavigationCaseDialogOperator extends NbDialogOperator { 38 39 41 public AddNavigationCaseDialogOperator() { 42 super("Add Navigation Case"); 43 } 44 45 private JLabelOperator _lblFromView; 46 private JComboBoxOperator _cboFromView; 47 private JButtonOperator _btBrowse; 48 private JLabelOperator _lblFromAction; 49 private JTextFieldOperator _txtFromAction; 50 private JLabelOperator _lblFromOutcome; 51 private JTextFieldOperator _txtFromOutcome; 52 private JLabelOperator _lblToView; 53 private JButtonOperator _btBrowse2; 54 private JCheckBoxOperator _cbRedirect; 55 private JLabelOperator _lblRuleDescription; 56 private JTextAreaOperator _txtRuleDescription; 57 private JComboBoxOperator _cboToView; 58 private JButtonOperator _btAdd; 59 60 61 65 68 public JLabelOperator lblFromView() { 69 if (_lblFromView==null) { 70 _lblFromView = new JLabelOperator(this, "From View:"); 71 } 72 return _lblFromView; 73 } 74 75 78 public JComboBoxOperator cboFromView() { 79 if (_cboFromView==null) { 80 _cboFromView = new JComboBoxOperator((JComboBox )lblFromView().getLabelFor()); 81 } 82 return _cboFromView; 83 } 84 85 88 public JButtonOperator btBrowse() { 89 if (_btBrowse==null) { 90 _btBrowse = new JButtonOperator(this, "Browse..."); 91 } 92 return _btBrowse; 93 } 94 95 98 public JLabelOperator lblFromAction() { 99 if (_lblFromAction==null) { 100 _lblFromAction = new JLabelOperator(this, "From Action:"); 101 } 102 return _lblFromAction; 103 } 104 105 108 public JTextFieldOperator txtFromAction() { 109 if (_txtFromAction==null) { 110 _txtFromAction = new JTextFieldOperator((JTextField )lblFromAction().getLabelFor()); 111 } 112 return _txtFromAction; 113 } 114 115 118 public JLabelOperator lblFromOutcome() { 119 if (_lblFromOutcome==null) { 120 _lblFromOutcome = new JLabelOperator(this, "From Outcome:"); 121 } 122 return _lblFromOutcome; 123 } 124 125 126 129 public JTextFieldOperator txtFromOutcome() { 130 if (_txtFromOutcome==null) { 131 _txtFromOutcome = new JTextFieldOperator((JTextField )lblFromOutcome().getLabelFor()); 132 } 133 return _txtFromOutcome; 134 } 135 136 139 public JLabelOperator lblToView() { 140 if (_lblToView==null) { 141 _lblToView = new JLabelOperator(this, "To View:"); 142 } 143 return _lblToView; 144 } 145 146 149 public JButtonOperator btBrowse2() { 150 if (_btBrowse2==null) { 151 _btBrowse2 = new JButtonOperator(this, "Browse...", 1); 152 } 153 return _btBrowse2; 154 } 155 156 159 public JCheckBoxOperator cbRedirect() { 160 if (_cbRedirect==null) { 161 _cbRedirect = new JCheckBoxOperator(this, "Redirect"); 162 } 163 return _cbRedirect; 164 } 165 166 169 public JLabelOperator lblRuleDescription() { 170 if (_lblRuleDescription==null) { 171 _lblRuleDescription = new JLabelOperator(this, "Rule Description:"); 172 } 173 return _lblRuleDescription; 174 } 175 176 179 public JTextAreaOperator txtRuleDescription() { 180 if (_txtRuleDescription==null) { 181 _txtRuleDescription = new JTextAreaOperator(this); 182 } 183 return _txtRuleDescription; 184 } 185 186 189 public JComboBoxOperator cboToView() { 190 if (_cboToView==null) { 191 _cboToView = new JComboBoxOperator((JComboBox )lblToView().getLabelFor()); 192 } 193 return _cboToView; 194 } 195 196 199 public JButtonOperator btAdd() { 200 if (_btAdd==null) { 201 _btAdd = new JButtonOperator(this, "Add"); 202 } 203 return _btAdd; 204 } 205 206 public void add(){ 207 btAdd().push(); 208 } 209 210 214 217 public String getSelectedFromView() { 218 return cboFromView().getSelectedItem().toString(); 219 } 220 221 224 public void selectFromView(String item) { 225 cboFromView().selectItem(item); 226 } 227 228 231 public void typeFromView(String text) { 232 cboFromView().typeText(text); 233 } 234 235 237 public void browse() { 238 btBrowse().push(); 239 } 240 241 244 public String getFromAction() { 245 return txtFromAction().getText(); 246 } 247 248 251 public void setFromAction(String text) { 252 txtFromAction().setText(text); 253 } 254 255 258 public void typeFromAction(String text) { 259 txtFromAction().typeText(text); 260 } 261 262 265 public String getFromOutcome() { 266 return txtFromOutcome().getText(); 267 } 268 269 272 public void setFromOutcome(String text) { 273 txtFromOutcome().setText(text); 274 } 275 276 279 public void typeFromOutcome(String text) { 280 txtFromOutcome().typeText(text); 281 } 282 283 285 public void browse2() { 286 btBrowse2().push(); 287 } 288 289 292 public void checkRedirect(boolean state) { 293 if (cbRedirect().isSelected()!=state) { 294 cbRedirect().push(); 295 } 296 } 297 298 301 public String getRuleDescription() { 302 return txtRuleDescription().getText(); 303 } 304 305 308 public void setRuleDescription(String text) { 309 txtRuleDescription().setText(text); 310 } 311 312 315 public void typeRuleDescription(String text) { 316 txtRuleDescription().typeText(text); 317 } 318 319 322 public String getSelectedToView() { 323 return cboToView().getSelectedItem().toString(); 324 } 325 326 329 public void selectToView(String item) { 330 cboToView().selectItem(item); 331 } 332 333 336 public void typeToView(String text) { 337 cboToView().typeText(text); 338 } 339 340 341 345 347 public void verify() { 348 lblFromView(); 349 cboFromView(); 350 btBrowse(); 351 lblFromAction(); 352 txtFromAction(); 353 lblFromOutcome(); 354 txtFromOutcome(); 355 lblToView(); 356 btBrowse2(); 357 cbRedirect(); 358 lblRuleDescription(); 359 txtRuleDescription(); 360 cboToView(); 361 btAdd(); 362 btCancel(); 363 btHelp(); 364 } 365 } 366 367 | Popular Tags |