1 6 package org.netbeans.test.subversion.operators; 7 8 import org.netbeans.jellytools.NbDialogOperator; 9 import org.netbeans.jellytools.nodes.Node; 10 import org.netbeans.jemmy.operators.*; 11 import org.netbeans.test.subversion.operators.actions.CopyAction; 12 13 18 public class CopyToOperator extends NbDialogOperator { 19 20 23 public CopyToOperator() { 24 super("Copy"); 25 } 26 27 31 public static CopyToOperator invoke(Node[] nodes) { 32 new CopyAction().perform(nodes); 33 return new CopyToOperator(); 34 } 35 36 40 public static CopyToOperator invoke(Node node) { 41 return invoke(new Node[] {node}); 42 } 43 44 private JTextAreaOperator _txtJTextArea; 45 private JRadioButtonOperator _rbLocalFolder; 46 private JRadioButtonOperator _rbRemoteFolder; 47 private JLabelOperator _lblDescribeTheCopyPurpose; 48 private JLabelOperator _lblRepositoryFolder; 49 private JComboBoxOperator _cboJComboBox; 50 private JButtonOperator _btBrowse; 51 private JCheckBoxOperator _cbSwitchToCopy; 52 private JCheckBoxOperator _cbSkip; 53 private JLabelOperator _lblWarningMessage; 54 private JButtonOperator _btCopy; 55 private JButtonOperator _btCancel; 56 private JButtonOperator _btHelp; 57 58 59 63 66 public JTextAreaOperator txtJTextArea() { 67 if (_txtJTextArea==null) { 68 _txtJTextArea = new JTextAreaOperator(this); 69 } 70 return _txtJTextArea; 71 } 72 73 76 public JLabelOperator lblDescribeTheCopyPurpose() { 77 if (_lblDescribeTheCopyPurpose==null) { 78 _lblDescribeTheCopyPurpose = new JLabelOperator(this, "Copy Description"); 79 } 80 return _lblDescribeTheCopyPurpose; 81 } 82 83 86 public JRadioButtonOperator rbLocalFolder() { 87 if (_rbLocalFolder == null) { 88 _rbLocalFolder = new JRadioButtonOperator(this, "Local Folder"); 89 } 90 return _rbLocalFolder; 91 } 92 93 public JRadioButtonOperator rbRemoteFolder() { 94 if (_rbRemoteFolder == null) { 95 _rbRemoteFolder = new JRadioButtonOperator(this, "Remote Folder"); 96 } 97 return _rbRemoteFolder; 98 } 99 100 103 public JComboBoxOperator cboJComboBox() { 104 if (_cboJComboBox==null) { 105 _cboJComboBox = new JComboBoxOperator(this); 106 } 107 return _cboJComboBox; 108 } 109 110 113 public JButtonOperator btBrowse() { 114 if (_btBrowse==null) { 115 _btBrowse = new JButtonOperator(this, "Browse..."); 116 } 117 return _btBrowse; 118 } 119 120 123 public JCheckBoxOperator cbSwitchToCopy() { 124 if (_cbSwitchToCopy==null) { 125 _cbSwitchToCopy = new JCheckBoxOperator(this, "Switch to Copy"); 126 } 127 return _cbSwitchToCopy; 128 } 129 130 133 public JCheckBoxOperator cbSkip() { 134 if (_cbSkip==null) { 135 _cbSkip = new JCheckBoxOperator(this, "Skip"); 136 } 137 return _cbSkip; 138 } 139 140 143 public JLabelOperator lblWarningMessage() { 144 if (_lblWarningMessage==null) { 145 _lblWarningMessage = new JLabelOperator(this, 2); 146 } 147 return _lblWarningMessage; 148 } 149 150 153 public JButtonOperator btCopy() { 154 if (_btCopy==null) { 155 _btCopy = new JButtonOperator(this, "Copy"); 156 } 157 return _btCopy; 158 } 159 160 163 public JButtonOperator btCancel() { 164 if (_btCancel==null) { 165 _btCancel = new JButtonOperator(this, "Cancel"); 166 } 167 return _btCancel; 168 } 169 170 173 public JButtonOperator btHelp() { 174 if (_btHelp==null) { 175 _btHelp = new JButtonOperator(this, "Help"); 176 } 177 return _btHelp; 178 } 179 180 181 185 188 public String getCopyPurpose() { 189 return txtJTextArea().getText(); 190 } 191 192 195 public void setCopyPurpose(String text) { 196 txtJTextArea().clearText(); 197 txtJTextArea().typeText(text); 198 } 199 200 201 204 public String getSelectedRepositoryFolder() { 205 return cboJComboBox().getSelectedItem().toString(); 206 } 207 208 public String getRepositoryFolder() { 209 return cboJComboBox().getEditor().getItem().toString(); 210 } 211 212 215 public void selectJComboBox(String item) { 216 cboJComboBox().selectItem(item); 217 } 218 219 222 public void setRepositoryFolder(String text) { 223 cboJComboBox().clearText(); 224 cboJComboBox().typeText(text); 225 } 226 227 229 public RepositoryBrowserImpOperator browseRepository() { 230 btBrowse().pushNoBlock(); 231 return new RepositoryBrowserImpOperator(); 232 } 233 234 237 public void checkSwitchToCopy(boolean state) { 238 if (cbSwitchToCopy().isSelected()!=state) { 239 cbSwitchToCopy().push(); 240 } 241 } 242 243 245 public void copy() { 246 btCopy().push(); 247 } 248 249 251 public void cancel() { 252 btCancel().push(); 253 } 254 255 257 public void help() { 258 btHelp().push(); 259 } 260 261 262 266 269 public void verify() { 270 txtJTextArea(); 271 lblDescribeTheCopyPurpose(); 272 rbLocalFolder(); 273 rbRemoteFolder(); 274 cboJComboBox(); 275 btBrowse(); 276 cbSwitchToCopy(); 277 cbSkip(); 278 btCopy(); 279 btCancel(); 280 btHelp(); 281 } 282 } 283 284 | Popular Tags |