1 19 20 package org.netbeans.test.j2ee.addmethod; 21 22 import org.netbeans.jemmy.operators.*; 23 import org.netbeans.jemmy.util.NameComponentChooser; 24 25 30 public class AddCMPFieldDialog extends JDialogOperator { 31 32 35 public AddCMPFieldDialog() { 36 super(org.netbeans.jellytools.Bundle.getStringTrimmed("org.netbeans.modules.j2ee.ejbcore.ui.logicalview.ejb.action.Bundle", "LBL_AddCmpFieldAction")); 37 } 38 39 private JTextFieldOperator _txtName; 40 private JTextFieldOperator _txtDescription; 41 private JComboBoxOperator _comboType; 42 private JCheckBoxOperator _cbGetter; 43 private JCheckBoxOperator _cbSetter; 44 private JCheckBoxOperator _cbGetter2; 45 private JCheckBoxOperator _cbSetter2; 46 private JButtonOperator _btOK; 47 private JButtonOperator _btCancel; 48 49 50 54 57 public JTextFieldOperator txtName() { 58 if (_txtName==null) { 59 _txtName = new JTextFieldOperator(this); 60 } 61 return _txtName; 62 } 63 64 67 public JTextFieldOperator txtDescription() { 68 if (_txtDescription==null) { 69 _txtDescription = new JTextFieldOperator(this, 1); 70 } 71 return _txtDescription; 72 } 73 74 77 public JComboBoxOperator comboType() { 78 if (_comboType==null) { 79 _comboType = new JComboBoxOperator(this); 81 } 82 return _comboType; 83 } 84 85 88 public JCheckBoxOperator cbLocalGetter() { 89 if (_cbGetter==null) { 90 _cbGetter = new JCheckBoxOperator(this, "Getter"); 91 } 92 return _cbGetter; 93 } 94 95 98 public JCheckBoxOperator cbLocalSetter() { 99 if (_cbSetter==null) { 100 _cbSetter = new JCheckBoxOperator(this, "Setter"); 101 } 102 return _cbSetter; 103 } 104 105 108 public JCheckBoxOperator cbRemoteGetter() { 109 if (_cbGetter2==null) { 110 _cbGetter2 = new JCheckBoxOperator(this, "Getter", 1); 111 } 112 return _cbGetter2; 113 } 114 115 118 public JCheckBoxOperator cbRemoteSetter() { 119 if (_cbSetter2==null) { 120 _cbSetter2 = new JCheckBoxOperator(this, "Setter", 1); 121 } 122 return _cbSetter2; 123 } 124 125 128 public JButtonOperator btOK() { 129 if (_btOK==null) { 130 _btOK = new JButtonOperator(this, "OK"); 131 } 132 return _btOK; 133 } 134 135 138 public JButtonOperator btCancel() { 139 if (_btCancel==null) { 140 _btCancel = new JButtonOperator(this, "Cancel"); 141 } 142 return _btCancel; 143 } 144 145 146 150 153 public String getName() { 154 return txtName().getText(); 155 } 156 157 160 public void setName(String text) { 161 txtName().setText(text); 162 } 163 164 167 public void typeName(String text) { 168 txtName().typeText(text); 169 } 170 171 174 public String getDescription() { 175 return txtDescription().getText(); 176 } 177 178 181 public void setDescription(String text) { 182 txtDescription().setText(text); 183 } 184 185 188 public void typeDescription(String text) { 189 txtDescription().typeText(text); 190 } 191 192 195 public String getSelectedType() { 196 return comboType().getTextField().getText(); 197 } 198 199 202 public void setType(String item) { 203 comboType().selectItem(item); 204 } 205 206 209 public void typeType(String text) { 210 comboType().getTextField().typeText(text); 211 } 212 213 216 public void checkLocalGetter(boolean state) { 217 if (cbLocalGetter().isSelected()!=state) { 218 cbLocalGetter().push(); 219 } 220 } 221 222 225 public void checkLocalSetter(boolean state) { 226 if (cbLocalSetter().isSelected()!=state) { 227 cbLocalSetter().push(); 228 } 229 } 230 231 234 public void checkRemoteGetter(boolean state) { 235 if (cbRemoteGetter().isSelected()!=state) { 236 cbRemoteGetter().push(); 237 } 238 } 239 240 243 public void checkRemoteSetter(boolean state) { 244 if (cbRemoteSetter().isSelected()!=state) { 245 cbRemoteSetter().push(); 246 } 247 } 248 249 251 public void ok() { 252 btOK().push(); 253 } 254 255 257 public void cancel() { 258 btCancel().push(); 259 } 260 261 262 266 269 public void verify() { 270 txtName(); 271 txtDescription(); 272 comboType(); 273 cbLocalGetter(); 274 cbLocalSetter(); 275 cbRemoteGetter(); 276 cbRemoteSetter(); 277 btOK(); 278 btCancel(); 279 } 280 281 285 public static void main(String args[]) { 286 new AddCMPFieldDialog().verify(); 287 System.out.println("AddCMPField verification finished."); 288 } 289 } 290 291 | Popular Tags |