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 SAXDocumentHandlerWizardPage1 extends WizardOperator { 35 36 38 public SAXDocumentHandlerWizardPage1() { 39 super("SAX Document Handler Wizard"); 40 } 41 42 private JLabelOperator _lblSteps; 43 private JLabelOperator _lbl1Of4APIVersions; 44 private JTextAreaOperator _txtJTextArea; 45 private JLabelOperator _lblJAXPVersion; 46 private JComboBoxOperator _cboJAXPVersion; 47 public static final String ITEM_JAXP10 = "JAXP 1.0"; 48 public static final String ITEM_JAXP11 = "JAXP 1.1"; 49 private JLabelOperator _lblSAXParserVersion; 50 private JComboBoxOperator _cboSAXParserVersion; 51 public static final String ITEM_SAX10 = "SAX 1.0"; 52 public static final String ITEM_SAX20 = "SAX 2.0"; 53 private JCheckBoxOperator _cbPropagateSAXEventsToGeneratedHandler; 54 private JButtonOperator _btCancel; 55 private JButtonOperator _btHelp; 56 57 58 62 65 public JLabelOperator lblSteps() { 66 if (_lblSteps==null) { 67 _lblSteps = new JLabelOperator(this, "Steps"); 68 } 69 return _lblSteps; 70 } 71 72 75 public JLabelOperator lbl1Of4APIVersions() { 76 if (_lbl1Of4APIVersions==null) { 77 _lbl1Of4APIVersions = new JLabelOperator(this, "1 of 4 - API Versions"); 78 } 79 return _lbl1Of4APIVersions; 80 } 81 82 85 public JTextAreaOperator txtJTextArea() { 86 if (_txtJTextArea==null) { 87 _txtJTextArea = new JTextAreaOperator(this); 88 } 89 return _txtJTextArea; 90 } 91 92 95 public JLabelOperator lblJAXPVersion() { 96 if (_lblJAXPVersion==null) { 97 _lblJAXPVersion = new JLabelOperator(this, "JAXP Version:"); 98 } 99 return _lblJAXPVersion; 100 } 101 102 105 public JComboBoxOperator cboJAXPVersion() { 106 if (_cboJAXPVersion==null) { 107 _cboJAXPVersion = new JComboBoxOperator(this); 108 } 109 return _cboJAXPVersion; 110 } 111 112 115 public JLabelOperator lblSAXParserVersion() { 116 if (_lblSAXParserVersion==null) { 117 _lblSAXParserVersion = new JLabelOperator(this, "SAX Parser Version:"); 118 } 119 return _lblSAXParserVersion; 120 } 121 122 125 public JComboBoxOperator cboSAXParserVersion() { 126 if (_cboSAXParserVersion==null) { 127 _cboSAXParserVersion = new JComboBoxOperator(this, 1); 128 } 129 return _cboSAXParserVersion; 130 } 131 132 135 public JCheckBoxOperator cbPropagateSAXEventsToGeneratedHandler() { 136 if (_cbPropagateSAXEventsToGeneratedHandler==null) { 137 _cbPropagateSAXEventsToGeneratedHandler = new JCheckBoxOperator(this, " Propagate SAX Events to Generated Handler"); 138 } 139 return _cbPropagateSAXEventsToGeneratedHandler; 140 } 141 142 145 public JButtonOperator btCancel() { 146 if (_btCancel==null) { 147 _btCancel = new JButtonOperator(this, "Cancel"); 148 } 149 return _btCancel; 150 } 151 152 155 public JButtonOperator btHelp() { 156 if (_btHelp==null) { 157 _btHelp = new JButtonOperator(this, "Help"); 158 } 159 return _btHelp; 160 } 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 191 public String getSelectedJAXPVersion() { 192 return cboJAXPVersion().getSelectedItem().toString(); 193 } 194 195 198 public void selectJAXPVersion(String item) { 199 cboJAXPVersion().selectItem(item); 200 } 201 202 205 public void typeJAXPVersion(String text) { 206 cboJAXPVersion().typeText(text); 207 } 208 209 212 public String getSelectedSAXParserVersion() { 213 return cboSAXParserVersion().getSelectedItem().toString(); 214 } 215 216 219 public void selectSAXParserVersion(String item) { 220 cboSAXParserVersion().selectItem(item); 221 } 222 223 226 public void typeSAXParserVersion(String text) { 227 cboSAXParserVersion().typeText(text); 228 } 229 230 233 public void checkPropagateSAXEventsToGeneratedHandler(boolean state) { 234 if (cbPropagateSAXEventsToGeneratedHandler().isSelected()!=state) { 235 cbPropagateSAXEventsToGeneratedHandler().push(); 236 } 237 } 238 239 241 public void cancel() { 242 btCancel().push(); 243 } 244 245 247 public void help() { 248 btHelp().push(); 249 } 250 251 252 256 258 public void verify() { 259 lblSteps(); 260 lbl1Of4APIVersions(); 261 txtJTextArea(); 262 lblJAXPVersion(); 263 cboJAXPVersion(); 264 lblSAXParserVersion(); 265 cboSAXParserVersion(); 266 cbPropagateSAXEventsToGeneratedHandler(); 267 btCancel(); 268 btHelp(); 269 } 270 271 274 public static void main(String args[]) { 275 new SAXDocumentHandlerWizardPage1().verify(); 276 System.out.println("SAXDocumentHandlerWizardPage1 verification finished."); 277 } 278 } 279 280 | Popular Tags |