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.RevertAction; 12 13 18 public class RevertModificationsOperator extends NbDialogOperator { 19 20 23 public RevertModificationsOperator() { 24 super("Revert Modifications"); 25 } 26 27 31 public static RevertModificationsOperator invoke(Node[] nodes) { 32 new RevertAction().perform(nodes); 33 return new RevertModificationsOperator(); 34 } 35 36 40 public static RevertModificationsOperator invoke(Node node) { 41 return invoke(new Node[] {node}); 42 } 43 44 private JLabelOperator _lblStartWithRevision; 45 private JLabelOperator _lblEndWithRevision; 46 private JTextFieldOperator _txtStartRevision; 47 private JTextFieldOperator _txtEndRevision; 48 private JTextFieldOperator _txtRevision; 49 private JLabelOperator _lblEmptyMeansRepositoryHEAD; 50 private JButtonOperator _btSearch; 51 private JButtonOperator _btSearch2; 52 private JButtonOperator _btSearch3; 53 private JLabelOperator _lblRevertModificationsFrom; 54 private JRadioButtonOperator _rbPreviousCommits; 55 private JRadioButtonOperator _rbLocalChanges; 56 private JRadioButtonOperator _rbSingleCommit; 57 private JButtonOperator _btRevert; 58 private JButtonOperator _btCancel; 59 private JButtonOperator _btHelp; 60 61 62 66 69 public JLabelOperator lblStartWithRevision() { 70 if (_lblStartWithRevision==null) { 71 _lblStartWithRevision = new JLabelOperator(this, "Starting"); 72 } 73 return _lblStartWithRevision; 74 } 75 76 79 public JLabelOperator lblEndWithRevision() { 80 if (_lblEndWithRevision==null) { 81 _lblEndWithRevision = new JLabelOperator(this, "Ending"); 82 } 83 return _lblEndWithRevision; 84 } 85 86 89 public JTextFieldOperator txtStartRevision() { 90 if (_txtStartRevision==null) { 91 _txtStartRevision = new JTextFieldOperator(this, 1); 92 } 93 return _txtStartRevision; 94 } 95 96 99 public JTextFieldOperator txtEndRevision() { 100 if (_txtEndRevision==null) { 101 _txtEndRevision = new JTextFieldOperator(this); 102 } 103 return _txtEndRevision; 104 } 105 106 109 public JTextFieldOperator txtRevision() { 110 if (_txtRevision==null) { 111 _txtRevision = new JTextFieldOperator(this, 2); 112 } 113 return _txtRevision; 114 } 115 116 119 public JLabelOperator lblEmptyMeansRepositoryHEAD() { 120 if (_lblEmptyMeansRepositoryHEAD==null) { 121 _lblEmptyMeansRepositoryHEAD = new JLabelOperator(this, "(empty means repository HEAD)"); 122 } 123 return _lblEmptyMeansRepositoryHEAD; 124 } 125 126 129 public JButtonOperator btSearch() { 130 if (_btSearch==null) { 131 _btSearch = new JButtonOperator(this, "Search..."); 132 } 133 return _btSearch; 134 } 135 136 139 public JButtonOperator btSearch2() { 140 if (_btSearch2==null) { 141 _btSearch2 = new JButtonOperator(this, "Search...", 1); 142 } 143 return _btSearch2; 144 } 145 146 149 public JButtonOperator btSearch3() { 150 if (_btSearch3==null) { 151 _btSearch3 = new JButtonOperator(this, "Search...", 2); 152 } 153 return _btSearch3; 154 } 155 156 159 public JRadioButtonOperator rbPreviousCommits() { 160 if (_rbPreviousCommits==null) { 161 _rbPreviousCommits = new JRadioButtonOperator(this, "Revert Modifications from Previous Commits"); 162 } 163 return _rbPreviousCommits; 164 } 165 166 169 public JRadioButtonOperator rbSingleCommit() { 170 if (_rbSingleCommit==null) { 171 _rbSingleCommit = new JRadioButtonOperator(this, "Revert Modifications from Single Commit"); 172 } 173 return _rbSingleCommit; 174 } 175 176 179 public JRadioButtonOperator rbLocalChanges() { 180 if (_rbLocalChanges==null) { 181 _rbLocalChanges = new JRadioButtonOperator(this, "Revert Local Changes"); 182 } 183 return _rbLocalChanges; 184 } 185 186 189 public JButtonOperator btRevert() { 190 if (_btRevert==null) { 191 _btRevert = new JButtonOperator(this, "Revert"); 192 } 193 return _btRevert; 194 } 195 196 199 public JButtonOperator btCancel() { 200 if (_btCancel==null) { 201 _btCancel = new JButtonOperator(this, "Cancel"); 202 } 203 return _btCancel; 204 } 205 206 209 public JButtonOperator btHelp() { 210 if (_btHelp==null) { 211 _btHelp = new JButtonOperator(this, "Help"); 212 } 213 return _btHelp; 214 } 215 216 217 221 226 public String getTxtStartRevision() { 227 return txtStartRevision().getText(); 228 } 229 230 235 public void setStartRevision(String text) { 236 txtStartRevision().clearText(); 237 txtStartRevision().typeText(text); 238 } 239 240 245 public String getEndRevision() { 246 return txtEndRevision().getText(); 247 } 248 249 254 public String getRevision() { 255 return txtRevision().getText(); 256 } 257 258 263 public void setRevision(String text) { 264 txtRevision().clearText(); 265 txtRevision().typeText(text); 266 } 267 268 273 public void setEndRevision(String text) { 274 txtEndRevision().clearText(); 275 txtEndRevision().typeText(text); 276 } 277 278 280 public void search() { 281 btSearch().push(); 282 } 283 284 286 public void search2() { 287 btSearch2().push(); 288 } 289 290 292 public void previousCommits() { 293 rbPreviousCommits().push(); 294 } 295 296 298 public void localChanges() { 299 rbLocalChanges().push(); 300 } 301 302 304 public void revert() { 305 btRevert().push(); 306 } 307 308 310 public void cancel() { 311 btCancel().push(); 312 } 313 314 316 public void help() { 317 btHelp().push(); 318 } 319 320 321 325 328 public void verify() { 329 lblStartWithRevision(); 330 lblEndWithRevision(); 331 txtStartRevision(); 332 txtEndRevision(); 333 lblEmptyMeansRepositoryHEAD(); 334 btSearch(); 335 btSearch2(); 336 rbPreviousCommits(); 337 rbLocalChanges(); 338 btRevert(); 339 btCancel(); 340 btHelp(); 341 } 342 } 343 344 | Popular Tags |