1 19 20 package org.netbeans.test.jsf; 21 22 import org.netbeans.jellytools.NbDialogOperator; 23 import org.netbeans.jemmy.operators.JButtonOperator; 24 import org.netbeans.jemmy.operators.JLabelOperator; 25 import org.netbeans.jemmy.operators.JTextAreaOperator; 26 import org.netbeans.jemmy.operators.JTextFieldOperator; 27 28 29 33 public class AddNavigationRuleDialogOperator extends NbDialogOperator { 34 35 37 public AddNavigationRuleDialogOperator() { 38 super("Add Navigation Rule"); 39 } 40 41 private JLabelOperator _lblRuleFromView; 42 private JTextFieldOperator _txtRuleFromView; 43 private JButtonOperator _btBrowse; 44 private JLabelOperator _lblRuleDescription; 45 private JTextAreaOperator _txtRuleDescription; 46 private JButtonOperator _btAdd; 47 48 49 53 56 public JLabelOperator lblRuleFromView() { 57 if (_lblRuleFromView==null) { 58 _lblRuleFromView = new JLabelOperator(this, "Rule from View:"); 59 } 60 return _lblRuleFromView; 61 } 62 63 66 public JTextFieldOperator txtRuleFromView() { 67 if (_txtRuleFromView==null) { 68 _txtRuleFromView = new JTextFieldOperator(this); 69 } 70 return _txtRuleFromView; 71 } 72 73 76 public JButtonOperator btBrowse() { 77 if (_btBrowse==null) { 78 _btBrowse = new JButtonOperator(this, "Browse..."); 79 } 80 return _btBrowse; 81 } 82 83 86 public JLabelOperator lblRuleDescription() { 87 if (_lblRuleDescription==null) { 88 _lblRuleDescription = new JLabelOperator(this, "Rule Description:"); 89 } 90 return _lblRuleDescription; 91 } 92 93 96 public JTextAreaOperator txtRuleDescription() { 97 if (_txtRuleDescription==null) { 98 _txtRuleDescription = new JTextAreaOperator(this); 99 } 100 return _txtRuleDescription; 101 } 102 103 106 public JButtonOperator btAdd() { 107 if (_btAdd==null) { 108 _btAdd = new JButtonOperator(this, "Add"); 109 } 110 return _btAdd; 111 } 112 113 117 120 public String getRuleFromView() { 121 return txtRuleFromView().getText(); 122 } 123 124 127 public void setRuleFromView(String text) { 128 txtRuleFromView().setText(text); 129 } 130 131 134 public void typeRuleFromView(String text) { 135 txtRuleFromView().typeText(text); 136 } 137 138 140 public void browse() { 141 btBrowse().push(); 142 } 143 144 147 public String getRuleDescription() { 148 return txtRuleDescription().getText(); 149 } 150 151 154 public void setRuleDescription(String text) { 155 txtRuleDescription().setText(text); 156 } 157 158 161 public void typeRuleDescription(String text) { 162 txtRuleDescription().typeText(text); 163 } 164 165 167 public void add() { 168 btAdd().push(); 169 } 170 171 175 177 public void verify() { 178 lblRuleFromView(); 179 txtRuleFromView(); 180 btBrowse(); 181 lblRuleDescription(); 182 txtRuleDescription(); 183 btAdd(); 184 btCancel(); 185 btHelp(); 186 } 187 } 188 189 | Popular Tags |