1 19 package org.netbeans.jellytools.modules.xml; 20 21 import org.netbeans.jemmy.operators.*; 22 23 28 public class XSLTransformationDialog extends JDialogOperator { 29 30 33 public XSLTransformationDialog() { 34 super( "XSL Transformation" ); 35 } 36 37 private JCheckBoxOperator _cbOverwriteOutput; 38 private JLabelOperator _lblOutput; 39 private JButtonOperator _btBrowseSource; 40 private JComboBoxOperator _cboXMLSource; 41 private JLabelOperator _lblXSLTScript; 42 private JComboBoxOperator _cboJComboBox; 43 public static final String ITEM_DONOTHING = "Do Nothing"; 44 public static final String ITEM_APPLYDEFAULTACTION = "Apply Default Action"; 45 public static final String ITEM_OPENINBROWSER = "Open in Browser"; 46 private JButtonOperator _btBrowseScript; 47 private JButtonOperator _btCancel; 48 private JComboBoxOperator _cboXSLTScript; 49 private JButtonOperator _btHelp; 50 private JButtonOperator _btOK; 51 private JComboBoxOperator _cboOutput; 52 public static final String ITEM_BOOKSHTML = "Books.html"; 53 public static final String ITEM_PREVIEWOPENINBROWSER = "Preview (open in browser)"; 54 private JLabelOperator _lblProcessOutput; 55 private JLabelOperator _lblXMLSource; 56 57 58 62 66 public JCheckBoxOperator cbOverwriteOutput() { 67 if (_cbOverwriteOutput==null) { 68 _cbOverwriteOutput = new JCheckBoxOperator( this, "Overwrite Output", 0 ); 69 } 70 return _cbOverwriteOutput; 71 } 72 73 77 public JLabelOperator lblOutput() { 78 if (_lblOutput==null) { 79 _lblOutput = new JLabelOperator( this, "Output:", 0 ); 80 } 81 return _lblOutput; 82 } 83 84 88 public JButtonOperator btBrowseSource() { 89 if (_btBrowseSource==null) { 90 _btBrowseSource = new JButtonOperator( this, "Browse...", 0 ); 91 } 92 return _btBrowseSource; 93 } 94 95 99 public JComboBoxOperator cboXMLSource() { 100 if (_cboXMLSource==null) { 101 _cboXMLSource = new JComboBoxOperator(this, 0); 102 } 103 return _cboXMLSource; 104 } 105 106 110 public JLabelOperator lblXSLTScript() { 111 if (_lblXSLTScript==null) { 112 _lblXSLTScript = new JLabelOperator( this, "XSLT Script:", 0 ); 113 } 114 return _lblXSLTScript; 115 } 116 117 121 public JComboBoxOperator cboJComboBox() { 122 if (_cboJComboBox==null) { 123 _cboJComboBox = new JComboBoxOperator(this, 3); 124 } 125 return _cboJComboBox; 126 } 127 128 132 public JButtonOperator btBrowseScript() { 133 if (_btBrowseScript==null) { 134 _btBrowseScript = new JButtonOperator( this, "Browse...", 1 ); 135 } 136 return _btBrowseScript; 137 } 138 139 143 public JButtonOperator btCancel() { 144 if (_btCancel==null) { 145 _btCancel = new JButtonOperator( this, "Cancel", 0 ); 146 } 147 return _btCancel; 148 } 149 150 154 public JComboBoxOperator cboXSLTScript() { 155 if (_cboXSLTScript==null) { 156 _cboXSLTScript = new JComboBoxOperator(this, 1); 157 } 158 return _cboXSLTScript; 159 } 160 161 165 public JButtonOperator btHelp() { 166 if (_btHelp==null) { 167 _btHelp = new JButtonOperator( this, "Help", 0 ); 168 } 169 return _btHelp; 170 } 171 172 176 public JButtonOperator btOK() { 177 if (_btOK==null) { 178 _btOK = new JButtonOperator( this, "OK", 0 ); 179 } 180 return _btOK; 181 } 182 183 187 public JComboBoxOperator cboOutput() { 188 if (_cboOutput==null) { 189 _cboOutput = new JComboBoxOperator(this, 2); 190 } 191 return _cboOutput; 192 } 193 194 198 public JLabelOperator lblProcessOutput() { 199 if (_lblProcessOutput==null) { 200 _lblProcessOutput = new JLabelOperator( this, "Process Output:", 0 ); 201 } 202 return _lblProcessOutput; 203 } 204 205 209 public JLabelOperator lblXMLSource() { 210 if (_lblXMLSource==null) { 211 _lblXMLSource = new JLabelOperator( this, "XML Source:", 0 ); 212 } 213 return _lblXMLSource; 214 } 215 216 217 221 224 public void checkOverwriteOutput( boolean state ) { 225 if (cbOverwriteOutput().isSelected()!=state) { 226 cbOverwriteOutput().push(); 227 } 228 } 229 230 233 public void browseSource() { 234 btBrowseSource().push(); 235 } 236 237 240 public void setXMLSource( String item ) { 241 cboXMLSource().selectItem(item, true, true); 242 } 243 244 247 public void setJComboBox( String item ) { 248 cboJComboBox().selectItem(item, true, true); 249 } 250 251 254 public void browseScript() { 255 btBrowseScript().push(); 256 } 257 258 261 public void cancel() { 262 btCancel().push(); 263 } 264 265 268 public void setXSLTScript( String item ) { 269 cboXSLTScript().selectItem(item, true, true); 270 } 271 272 275 public void help() { 276 btHelp().push(); 277 } 278 279 282 public void oK() { 283 btOK().push(); 284 } 285 286 289 public void setOutput( String item ) { 290 cboOutput().selectItem(item, true, true); 291 } 292 293 294 298 301 public void verify() { 302 cbOverwriteOutput(); 303 lblOutput(); 304 btBrowseSource(); 305 cboXMLSource(); 306 lblXSLTScript(); 307 cboJComboBox(); 308 btBrowseScript(); 309 btCancel(); 310 cboXSLTScript(); 311 btHelp(); 312 btOK(); 313 cboOutput(); 314 lblProcessOutput(); 315 lblXMLSource(); 316 } 317 318 321 public static void main(String args[]) { 322 new XSLTransformationDialog().verify(); 323 System.out.println("XSLTransformationDialog verification finished."); 324 } 325 } 326 | Popular Tags |