1 21 22 package org.netbeans.jellytools.modules.debuggercore.operators; 23 24 import org.netbeans.jemmy.operators.*; 25 26 31 public class AttachJDialogOperator extends JDialogOperator { 32 33 35 public AttachJDialogOperator() { 36 super("Attach"); 37 } 38 39 private JComboBoxOperator _cboDebugger; 40 private JComboBoxOperator _cboConnector; 41 private JTextFieldOperator _txtTransport; 43 private JTextFieldOperator _txtHost; 44 private JTextFieldOperator _txtPort; 45 private JButtonOperator _btOK; 46 private JButtonOperator _btCancel; 47 private JButtonOperator _btHelp; 48 49 50 54 57 public JComboBoxOperator cboDebugger() { 58 if (_cboDebugger==null) { 59 _cboDebugger = new JComboBoxOperator(this); 60 } 61 return _cboDebugger; 62 } 63 64 public JComboBoxOperator cboConnector() { 66 if (_cboConnector==null) { 67 _cboConnector = new JComboBoxOperator(this,1); 68 } 69 return _cboConnector; 70 } 71 73 76 public JTextFieldOperator txtTransport() { 77 if (_txtTransport==null) { 78 _txtTransport = new JTextFieldOperator(this); 79 } 80 return _txtTransport; 81 } 82 83 86 public JTextFieldOperator txtHost() { 87 if (_txtHost==null) { 88 _txtHost = new JTextFieldOperator(this, 1); 89 } 90 return _txtHost; 91 } 92 93 96 public JTextFieldOperator txtPort() { 97 if (_txtPort==null) { 98 _txtPort = new JTextFieldOperator(this, 2); 99 } 100 return _txtPort; 101 } 102 103 106 public JButtonOperator btOK() { 107 if (_btOK==null) { 108 _btOK = new JButtonOperator(this, "OK"); 109 } 110 return _btOK; 111 } 112 113 116 public JButtonOperator btCancel() { 117 if (_btCancel==null) { 118 _btCancel = new JButtonOperator(this, "Cancel"); 119 } 120 return _btCancel; 121 } 122 123 126 public JButtonOperator btHelp() { 127 if (_btHelp==null) { 128 _btHelp = new JButtonOperator(this, "Help"); 129 } 130 return _btHelp; 131 } 132 133 134 138 141 public String getSelectedDebugger() { 142 return cboDebugger().getSelectedItem().toString(); 143 } 144 145 148 public void selectDebugger(String item) { 149 cboDebugger().selectItem(item); 150 } 151 152 public void selectConnector(String item) { 154 cboConnector().selectItem(item); 155 } 156 157 public void selectConnector(int item) { 158 cboConnector().selectItem(1); 159 } 160 164 public void typeDebugger(String text) { 165 cboDebugger().typeText(text); 166 } 167 168 171 public String getTransport() { 172 return txtTransport().getText(); 173 } 174 175 178 public void setTransport(String text) { 179 txtTransport().setText(text); 180 } 181 182 185 public void typeTransport(String text) { 186 txtTransport().typeText(text); 187 } 188 189 192 public String getHost() { 193 return txtHost().getText(); 194 } 195 196 199 public void setHost(String text) { 200 txtHost().setText(text); 201 } 202 203 206 public void typeHost(String text) { 207 txtHost().typeText(text); 208 } 209 210 213 public String getPort() { 214 return txtPort().getText(); 215 } 216 217 220 public void setPort(String text) { 221 txtPort().setText(text); 222 } 223 224 227 public void typePort(String text) { 228 txtPort().typeText(text); 229 } 230 231 233 public void oK() { 234 btOK().push(); 235 } 236 237 239 public void cancel() { 240 btCancel().push(); 241 } 242 243 245 public void help() { 246 btHelp().push(); 247 } 248 249 250 254 256 public void verify() { 257 cboDebugger(); 258 txtTransport(); 259 txtHost(); 260 txtPort(); 261 btOK(); 262 btCancel(); 263 btHelp(); 264 } 265 266 269 public static void main(String args[]) { 270 System.out.println("AttachJDialogOperator verification finished."); 272 java.util.Enumeration enumeration = System.getProperties().keys(); 273 String property; 274 while (enumeration.hasMoreElements()) { 275 property = (String ) enumeration.nextElement(); 276 System.out.println(property + "\t" + System.getProperty(property) ); 277 } 278 279 280 } 281 } 282 283 | Popular Tags |