1 19 20 25 package org.netbeans.jellytools.modules.java; 26 27 import org.netbeans.jellytools.Bundle; 28 import org.netbeans.jemmy.operators.*; 29 30 35 public class MethodParameterOperator extends JDialogOperator { 36 37 39 public MethodParameterOperator() { 40 super(Bundle.getString("org.openide.explorer.propertysheet.editors.Bundle2", "LAB_EnterParameter")); 41 } 42 43 private JLabelOperator _lblType; 44 private JComboBoxOperator _cboType; 45 private JLabelOperator _lblName; 46 private JTextFieldOperator _txtName; 47 private JCheckBoxOperator _cbFinal; 48 private JButtonOperator _btOK; 49 private JButtonOperator _btCancel; 50 51 52 56 59 public JLabelOperator lblType() { 60 if (_lblType==null) { 61 _lblType = new JLabelOperator(this, Bundle.getString("org.openide.src.nodes.Bundle", "CTL_Type")); 62 } 63 return _lblType; 64 } 65 66 69 public JComboBoxOperator cboType() { 70 if (_cboType==null) { 71 _cboType = new JComboBoxOperator(this); 72 } 73 return _cboType; 74 } 75 76 79 public JLabelOperator lblName() { 80 if (_lblName==null) { 81 _lblName = new JLabelOperator(this, Bundle.getString("org.openide.src.nodes.Bundle", "CTL_Name")); 82 } 83 return _lblName; 84 } 85 86 89 public JTextFieldOperator txtName() { 90 if (_txtName==null) { 91 _txtName = new JTextFieldOperator(this, 1); 92 } 93 return _txtName; 94 } 95 96 99 public JCheckBoxOperator cbFinal() { 100 if (_cbFinal==null) { 101 _cbFinal = new JCheckBoxOperator(this, org.netbeans.jellytools.Bundle.getString("org.openide.explorer.propertysheet.editors.Bundle2", "CTL_Final")); 102 } 103 return _cbFinal; 104 } 105 106 109 public JButtonOperator btOK() { 110 if (_btOK==null) { 111 _btOK = new JButtonOperator(this, Bundle.getString("org.openide.Bundle", "CTL_OK")); 112 } 113 return _btOK; 114 } 115 116 119 public JButtonOperator btCancel() { 120 if (_btCancel==null) { 121 _btCancel = new JButtonOperator(this, Bundle.getString("org.openide.Bundle", "CTL_CANCEL")); 122 } 123 return _btCancel; 124 } 125 126 127 131 134 public String getSelectedType() { 135 return cboType().getSelectedItem().toString(); 136 } 137 138 141 public void selectType(String item) { 142 cboType().selectItem(item); 143 } 144 145 148 public void typeType(String text) { 149 cboType().typeText(text); 150 } 151 152 155 public String getName() { 156 return txtName().getText(); 157 } 158 159 162 public void setName(String text) { 163 txtName().setText(text); 164 } 165 166 169 public void typeName(String text) { 170 txtName().typeText(text); 171 } 172 173 176 public void checkFinal(boolean state) { 177 if (cbFinal().isSelected()!=state) { 178 cbFinal().push(); 179 } 180 } 181 182 184 public void oK() { 185 btOK().push(); 186 } 187 188 190 public void cancel() { 191 btCancel().push(); 192 } 193 194 195 199 201 public void verify() { 202 lblType(); 203 cboType(); 204 lblName(); 205 txtName(); 206 cbFinal(); 207 btOK(); 208 btCancel(); 209 } 210 211 214 public static void main(String args[]) { 215 new MethodParameterOperator().verify(); 216 System.out.println("MethodParameterOperator verification finished."); 217 } 218 } 219 220 | Popular Tags |