1 19 24 package org.netbeans.jellytools.modules.xml.saxwizard; 25 26 import org.netbeans.jellytools.WizardOperator; 27 import org.netbeans.jemmy.operators.*; 28 29 34 public class SAXDocumentHandlerWizardPage3 extends WizardOperator { 35 static final int ELEMENT_COLUMN = 0; 36 static final int METHOD_COLUMN = 1; 37 static final int RET_TYPE_COLUMN = 2; 38 39 public static final String NO_METHOD = "[none]"; 40 41 43 public SAXDocumentHandlerWizardPage3() { 44 super("SAX Document Handler Wizard"); 45 } 46 47 private JLabelOperator _lblSteps; 48 private JLabelOperator _lbl3Of4DataConvertorsOptional; 49 private JTextAreaOperator _txtJTextArea; 50 private JTableOperator _tabDataConvertors; 51 private JButtonOperator _btCancel; 52 private JButtonOperator _btHelp; 53 54 55 59 62 public JLabelOperator lblSteps() { 63 if (_lblSteps==null) { 64 _lblSteps = new JLabelOperator(this, "Steps"); 65 } 66 return _lblSteps; 67 } 68 69 72 public JLabelOperator lbl3Of4DataConvertorsOptional() { 73 if (_lbl3Of4DataConvertorsOptional==null) { 74 _lbl3Of4DataConvertorsOptional = new JLabelOperator(this, "3 of 4 - Data Convertors (Optional)"); 75 } 76 return _lbl3Of4DataConvertorsOptional; 77 } 78 79 82 public JTextAreaOperator txtJTextArea() { 83 if (_txtJTextArea==null) { 84 _txtJTextArea = new JTextAreaOperator(this); 85 } 86 return _txtJTextArea; 87 } 88 89 92 public JTableOperator tabDataConvertors() { 93 if (_tabDataConvertors==null) { 94 _tabDataConvertors = new JTableOperator(this); 95 } 96 return _tabDataConvertors; 97 } 98 99 102 public JButtonOperator btCancel() { 103 if (_btCancel==null) { 104 _btCancel = new JButtonOperator(this, "Cancel"); 105 } 106 return _btCancel; 107 } 108 109 112 public JButtonOperator btHelp() { 113 if (_btHelp==null) { 114 _btHelp = new JButtonOperator(this, "Help"); 115 } 116 return _btHelp; 117 } 118 119 121 124 public JTextFieldOperator txtElement(int row) { 125 tabDataConvertors().clickForEdit(row, ELEMENT_COLUMN); 126 return new JTextFieldOperator(tabDataConvertors()); 127 } 128 129 132 public JTextFieldOperator txtConvertorMethod(int row) { 133 tabDataConvertors().clickForEdit(row, METHOD_COLUMN); 134 return new JTextFieldOperator(tabDataConvertors()); 135 } 136 137 140 public JComboBoxOperator cboConvertorMethod(int row) { 141 tabDataConvertors().clickForEdit(row, METHOD_COLUMN); 142 return new JComboBoxOperator(tabDataConvertors()); 143 } 144 145 149 public JTextFieldOperator txtReturnType(int row) { 150 tabDataConvertors().clickForEdit(row, RET_TYPE_COLUMN); 151 return new JTextFieldOperator(tabDataConvertors()); 152 } 153 154 158 public JComboBoxOperator cboReturnType(int row) { 159 tabDataConvertors().clickForEdit(row, RET_TYPE_COLUMN); 160 return new JComboBoxOperator(tabDataConvertors()); 161 } 162 163 167 170 public String getJTextArea() { 171 return txtJTextArea().getText(); 172 } 173 174 177 public void setJTextArea(String text) { 178 txtJTextArea().setText(text); 179 } 180 181 184 public void typeJTextArea(String text) { 185 txtJTextArea().typeText(text); 186 } 187 188 190 public void cancel() { 191 btCancel().push(); 192 } 193 194 196 public void help() { 197 btHelp().push(); 198 } 199 200 202 205 public String getElement(int row) { 206 return txtElement(row).getText(); 207 } 208 209 212 public String getConvertorMethod(int row) { 213 return txtConvertorMethod(row).getText(); 214 } 215 216 219 public void setConvertorMethod(int row, String text) { 220 txtConvertorMethod(row).enterText(text); 221 } 222 223 226 public String getSelectedConvertorMethod(int row) { 227 return cboConvertorMethod(row).getSelectedItem().toString(); 228 } 229 230 233 public void selectConvertorMethod(int row, String item) { 234 cboConvertorMethod(row).selectItem(item); 235 } 236 237 240 public String getReturnType(int row) { 241 return txtReturnType(row).getText(); 242 } 243 244 247 public void setReturnType(int row, String text) { 248 txtReturnType(row).enterText(text); 249 } 250 251 254 public String getSelectedReturnType(int row) { 255 return cboReturnType(row).getSelectedItem().toString(); 256 } 257 258 261 public void selectReturnType(int row, String item) { 262 cboReturnType(row).selectItem(item); 263 } 264 265 269 272 public int findTabRow(String element) { 273 int rows = tabDataConvertors().getRowCount(); 274 for (int i = 0; i < rows; i++) { 275 String cellVal = tabDataConvertors().getCellEditor(i, ELEMENT_COLUMN).getCellEditorValue().toString(); 276 if (element.equals(cellVal)) return i; 277 } 278 return -1; 279 } 280 281 283 public void verify() { 284 lblSteps(); 285 lbl3Of4DataConvertorsOptional(); 286 txtJTextArea(); 287 tabDataConvertors(); 288 btCancel(); 289 btHelp(); 290 } 291 292 295 public static void main(String args[]) { 296 new SAXDocumentHandlerWizardPage3().verify(); 297 System.out.println("SAXDocumentHandlerWizardPage3 verification finished."); 298 } 299 } 300 301 | Popular Tags |