1 19 20 25 package org.netbeans.jellytools.modules.editor; 26 27 import org.netbeans.jemmy.operators.*; 28 29 34 public class AddKeybinding extends JDialogOperator { 35 36 38 public AddKeybinding() { 39 super(java.util.ResourceBundle.getBundle("org.netbeans.editor.Bundle").getString("MSP_AddTitle")); 40 } 41 42 private JLabelOperator _lblShortcutSequence; 43 private JTextFieldOperator _txtShortcutSequence; 44 private JTextAreaOperator _txtJTextArea; 45 private JButtonOperator _btOK; 46 private JButtonOperator _btClear; 47 private JButtonOperator _btCancel; 48 private JButtonOperator _btHelp; 49 50 51 55 58 public JLabelOperator lblShortcutSequence() { 59 if (_lblShortcutSequence==null) { 60 _lblShortcutSequence = new JLabelOperator(this, java.util.ResourceBundle.getBundle("org.netbeans.modules.editor.options.Bundle").getString("LBL_KSIP_Sequence")); 61 } 62 return _lblShortcutSequence; 63 } 64 65 68 public JTextFieldOperator txtShortcutSequence() { 69 if (_txtShortcutSequence==null) { 70 _txtShortcutSequence = new JTextFieldOperator(this); 71 } 72 return _txtShortcutSequence; 73 } 74 75 78 public JTextAreaOperator txtJTextArea() { 79 if (_txtJTextArea==null) { 80 _txtJTextArea = new JTextAreaOperator(this); 81 } 82 return _txtJTextArea; 83 } 84 85 88 public JButtonOperator btOK() { 89 if (_btOK==null) { 90 _btOK = new JButtonOperator(this, java.util.ResourceBundle.getBundle("org.netbeans.modules.editor.options.Bundle").getString("KBEP_OK_LABEL")); 91 } 92 return _btOK; 93 } 94 95 98 public JButtonOperator btClear() { 99 if (_btClear==null) { 100 _btClear = new JButtonOperator(this, java.util.ResourceBundle.getBundle("org.netbeans.modules.editor.options.Bundle").getString("KBEP_CLEAR_LABEL")); 101 } 102 return _btClear; 103 } 104 105 108 public JButtonOperator btCancel() { 109 if (_btCancel==null) { 110 _btCancel = new JButtonOperator(this, java.util.ResourceBundle.getBundle("org.openide.explorer.propertysheet.Bundle").getString("CTL_Cancel")); 111 } 112 return _btCancel; 113 } 114 115 118 public JButtonOperator btHelp() { 119 if (_btHelp==null) { 120 _btHelp = new JButtonOperator(this, java.util.ResourceBundle.getBundle("org.openide.explorer.propertysheet.Bundle").getString("CTL_Help")); 121 } 122 return _btHelp; 123 } 124 125 126 130 133 public String getShortcutSequence() { 134 return txtShortcutSequence().getText(); 135 } 136 137 140 public void setShortcutSequence(String text) { 141 txtShortcutSequence().setText(text); 142 } 143 144 147 public void typeShortcutSequence(String text) { 148 txtShortcutSequence().typeText(text); 149 } 150 151 154 public String getJTextArea() { 155 return txtJTextArea().getText(); 156 } 157 158 161 public void setJTextArea(String text) { 162 txtJTextArea().setText(text); 163 } 164 165 168 public void typeJTextArea(String text) { 169 txtJTextArea().typeText(text); 170 } 171 172 174 public void oK() { 175 btOK().push(); 176 } 177 178 180 public void clear() { 181 btClear().push(); 182 } 183 184 186 public void cancel() { 187 btCancel().push(); 188 } 189 190 192 public void help() { 193 btHelp().push(); 194 } 195 196 197 201 203 public void verify() { 204 lblShortcutSequence(); 205 txtShortcutSequence(); 206 txtJTextArea(); 207 btOK(); 208 btClear(); 209 btCancel(); 210 btHelp(); 211 } 212 213 216 public static void main(String args[]) { 217 new AddKeybinding().verify(); 218 System.out.println("AddKeybinding verification finished."); 219 } 220 } 221 222 | Popular Tags |