1 6 package org.netbeans.jellytools.modules.editor; 7 8 import org.netbeans.jemmy.operators.*; 9 import org.netbeans.jemmy.util.NameComponentChooser; 10 11 16 public class AddShortcutDialog extends JDialogOperator { 17 18 20 public AddShortcutDialog() { 21 super("Add Shortcut Dialog"); 22 } 23 24 private JLabelOperator _lblShortcut; 25 private JLabelOperator _lblConflict; 26 private JTextFieldOperator _txtJTextField; 27 private JButtonOperator _btOK; 28 private JButtonOperator _btCancel; 29 private JButtonOperator _btClear; 30 private JButtonOperator _btTab; 31 32 33 37 40 public JLabelOperator lblShortcut() { 41 if (_lblShortcut==null) { 42 _lblShortcut = new JLabelOperator(this, "Shortcut:"); 43 } 44 return _lblShortcut; 45 } 46 47 50 public JLabelOperator lblConflict() { 51 if (_lblConflict==null) { 52 _lblConflict = new JLabelOperator(this,0); 53 } 54 return _lblConflict; 55 } 56 57 60 public JTextFieldOperator txtJTextField() { 61 if (_txtJTextField==null) { 62 _txtJTextField = new JTextFieldOperator(this); 63 } 64 return _txtJTextField; 65 } 66 67 70 public JButtonOperator btOK() { 71 if (_btOK==null) { 72 _btOK = new JButtonOperator(this, "OK"); 73 } 74 return _btOK; 75 } 76 77 80 public JButtonOperator btCancel() { 81 if (_btCancel==null) { 82 _btCancel = new JButtonOperator(this, "Cancel"); 83 } 84 return _btCancel; 85 } 86 87 90 public JButtonOperator btClear() { 91 if (_btClear==null) { 92 _btClear = new JButtonOperator(this, "Clear"); 93 } 94 return _btClear; 95 } 96 97 100 public JButtonOperator btTab() { 101 if (_btTab==null) { 102 _btTab = new JButtonOperator(this, "Tab"); 103 } 104 return _btTab; 105 } 106 107 108 112 115 public String getJTextField() { 116 return txtJTextField().getText(); 117 } 118 119 122 public void setJTextField(String text) { 123 txtJTextField().setText(text); 124 } 125 126 129 public void typeJTextField(String text) { 130 txtJTextField().typeText(text); 131 } 132 133 135 public void ok() { 136 btOK().push(); 137 } 138 139 141 public void cancel() { 142 btCancel().push(); 143 } 144 145 147 public void clear() { 148 btClear().push(); 149 } 150 151 153 public void tab() { 154 btTab().push(); 155 } 156 157 158 162 164 public void verify() { 165 lblShortcut(); 166 txtJTextField(); 167 btOK(); 168 btCancel(); 169 btClear(); 170 btTab(); 171 } 172 173 176 public static void main(String args[]) { 177 new AddShortcutDialog().verify(); 178 System.out.println("AddShortcutDialog verification finished."); 179 } 180 } 181 182 | Popular Tags |