1 19 24 package org.netbeans.jellytools.modules.xml.catalog; 25 26 import org.netbeans.jemmy.operators.*; 27 import org.netbeans.jellytools.*; 28 import org.netbeans.jellytools.properties.PropertySheetOperator; 29 30 35 public class MountCatalogDialogOperator extends NbDialogOperator { 36 37 39 public MountCatalogDialogOperator() { 40 super("Mount Catalog"); 41 } 42 43 private JLabelOperator _lblCatalogType; 44 private JComboBoxOperator _cboCatalogType; 45 public static final String ITEM_NETBEANSCATALOG = "NetBeans Catalog"; 46 public static final String ITEM_OASISCATALOGRESOLVER = "OASIS Catalog Resolver"; 47 public static final String ITEM_XMLCATALOG = "XML Catalog"; 48 private JLabelOperator _lblCatalogURL; 49 private JTextFieldOperator _txtCatalogURL; 50 private JButtonOperator _btBrowse; 51 private JCheckBoxOperator _cbPreferPublicID; 52 private JTextAreaOperator _txtJTextArea; 53 54 55 59 62 public JLabelOperator lblCatalogType() { 63 if (_lblCatalogType==null) { 64 _lblCatalogType = new JLabelOperator(this, "Catalog Type:"); 65 } 66 return _lblCatalogType; 67 } 68 69 72 public JComboBoxOperator cboCatalogType() { 73 if (_cboCatalogType==null) { 74 _cboCatalogType = new JComboBoxOperator(this); 75 } 76 return _cboCatalogType; 77 } 78 79 82 public JLabelOperator lblCatalogURL() { 83 if (_lblCatalogURL==null) { 84 _lblCatalogURL = new JLabelOperator(this, "Catalog URL:"); 85 } 86 return _lblCatalogURL; 87 } 88 89 92 public JTextFieldOperator txtCatalogURL() { 93 if (_txtCatalogURL==null) { 94 _txtCatalogURL = new JTextFieldOperator(this); 95 } 96 return _txtCatalogURL; 97 } 98 99 102 public JButtonOperator btBrowse() { 103 if (_btBrowse==null) { 104 _btBrowse = new JButtonOperator(this, "Browse..."); 105 } 106 return _btBrowse; 107 } 108 109 112 public JCheckBoxOperator cbPreferPublicID() { 113 if (_cbPreferPublicID==null) { 114 _cbPreferPublicID = new JCheckBoxOperator(this, "Prefer Public ID"); 115 } 116 return _cbPreferPublicID; 117 } 118 119 122 public JTextAreaOperator txtJTextArea() { 123 if (_txtJTextArea==null) { 124 _txtJTextArea = new JTextAreaOperator(this); 125 } 126 return _txtJTextArea; 127 } 128 129 130 134 137 public String getSelectedCatalogType() { 138 return cboCatalogType().getSelectedItem().toString(); 139 } 140 141 144 public void selectCatalogType(String item) { 145 cboCatalogType().selectItem(item); 146 } 147 148 151 public String getCatalogURL() { 152 return txtCatalogURL().getText(); 153 } 154 155 158 public void setCatalogURL(String text) { 159 txtCatalogURL().setText(text); 160 } 161 162 165 public void typeCatalogURL(String text) { 166 txtCatalogURL().typeText(text); 167 } 168 169 171 public void browse() { 172 btBrowse().push(); 173 } 174 175 178 public void checkPreferPublicID(boolean state) { 179 if (cbPreferPublicID().isSelected()!=state) { 180 cbPreferPublicID().push(); 181 } 182 } 183 184 187 public String getJTextArea() { 188 return txtJTextArea().getText(); 189 } 190 191 194 public void setJTextArea(String text) { 195 txtJTextArea().setText(text); 196 } 197 198 201 public void typeJTextArea(String text) { 202 txtJTextArea().typeText(text); 203 } 204 205 206 210 212 public void verifyOASIS() { 213 lblCatalogType(); 214 cboCatalogType(); 215 lblCatalogURL(); 216 txtCatalogURL(); 217 btBrowse(); 218 cbPreferPublicID(); 219 txtJTextArea(); 220 } 221 222 225 public static void main(String args[]) { 226 MountCatalogDialogOperator mcdo = new MountCatalogDialogOperator(); 227 mcdo.selectCatalogType(mcdo.ITEM_NETBEANSCATALOG); 228 mcdo.verifyNb(); 229 mcdo.selectCatalogType(mcdo.ITEM_OASISCATALOGRESOLVER); 230 mcdo.verifyOASIS(); 231 mcdo.selectCatalogType(mcdo.ITEM_XMLCATALOG); 232 mcdo.verifyXML(); 233 System.out.println("MountOASISCatalogDialogOperator verification finished."); 234 } 235 236 239 public void verifyNb() { 240 lblCatalogType(); 241 cboCatalogType(); 242 txtJTextArea(); 243 } 244 245 248 public void verifyXML() { 249 lblCatalogType(); 250 cboCatalogType(); 251 lblCatalogURL(); 252 txtCatalogURL(); 253 txtJTextArea(); 254 } 255 256 } 257 258 | Popular Tags |