1 19 20 25 package org.netbeans.jellytools.modules.java; 26 27 import org.netbeans.jemmy.operators.*; 28 29 34 public class OverrideMethodsOperator extends JDialogOperator { 35 36 38 public OverrideMethodsOperator() { 39 super(org.netbeans.jellytools.Bundle.getString("org.netbeans.modules.java.tools.Bundle", "LBL_OverridePanel2_Title")); 40 } 41 42 private JLabelOperator _lblSelectTheMethodsToOverrideOrImplementForMultipleSelectionUseCTRLKey; 43 private JCheckBoxOperator _cbShowSuperclassesAndInterfaces; 44 private JCheckBoxOperator _cbShowAbstractMethodsOnly; 45 private JLabelOperator _lblAvailableSuperclassAndInterfaceMethods; 46 private JTreeOperator _treeAvailableSuperclassAndInterfaceMethods; 47 private JCheckBoxOperator _cbGenerateSuperCalls; 48 private JCheckBoxOperator _cbCopyJavadoc; 49 private JButtonOperator _btOK; 50 private JButtonOperator _btCancel; 51 52 53 57 60 public JLabelOperator lblSelectTheMethodsToOverrideOrImplementForMultipleSelectionUseCTRLKey() { 61 if (_lblSelectTheMethodsToOverrideOrImplementForMultipleSelectionUseCTRLKey==null) { 62 _lblSelectTheMethodsToOverrideOrImplementForMultipleSelectionUseCTRLKey = new JLabelOperator(this, "Select the methods to override or implement. For multiple selection use CTRL key."); 63 } 64 return _lblSelectTheMethodsToOverrideOrImplementForMultipleSelectionUseCTRLKey; 65 } 66 67 70 public JCheckBoxOperator cbShowSuperclassesAndInterfaces() { 71 if (_cbShowSuperclassesAndInterfaces==null) { 72 _cbShowSuperclassesAndInterfaces = new JCheckBoxOperator(this, "Show Superclasses and Interfaces"); 73 } 74 return _cbShowSuperclassesAndInterfaces; 75 } 76 77 80 public JCheckBoxOperator cbShowAbstractMethodsOnly() { 81 if (_cbShowAbstractMethodsOnly==null) { 82 _cbShowAbstractMethodsOnly = new JCheckBoxOperator(this, "Show Abstract Methods Only"); 83 } 84 return _cbShowAbstractMethodsOnly; 85 } 86 87 90 public JLabelOperator lblAvailableSuperclassAndInterfaceMethods() { 91 if (_lblAvailableSuperclassAndInterfaceMethods==null) { 92 _lblAvailableSuperclassAndInterfaceMethods = new JLabelOperator(this, "Available Superclass and Interface Methods:"); 93 } 94 return _lblAvailableSuperclassAndInterfaceMethods; 95 } 96 97 100 public JTreeOperator treeAvailableSuperclassAndInterfaceMethods() { 101 if (_treeAvailableSuperclassAndInterfaceMethods==null) { 102 _treeAvailableSuperclassAndInterfaceMethods = new JTreeOperator(this); 103 } 104 return _treeAvailableSuperclassAndInterfaceMethods; 105 } 106 107 110 public JCheckBoxOperator cbGenerateSuperCalls() { 111 if (_cbGenerateSuperCalls==null) { 112 _cbGenerateSuperCalls = new JCheckBoxOperator(this, "Generate Super Calls"); 113 } 114 return _cbGenerateSuperCalls; 115 } 116 117 120 public JCheckBoxOperator cbCopyJavadoc() { 121 if (_cbCopyJavadoc==null) { 122 _cbCopyJavadoc = new JCheckBoxOperator(this, "Copy Javadoc"); 123 } 124 return _cbCopyJavadoc; 125 } 126 127 130 public JButtonOperator btOK() { 131 if (_btOK==null) { 132 _btOK = new JButtonOperator(this, "OK"); 133 } 134 return _btOK; 135 } 136 137 140 public JButtonOperator btCancel() { 141 if (_btCancel==null) { 142 _btCancel = new JButtonOperator(this, "Cancel"); 143 } 144 return _btCancel; 145 } 146 147 148 152 155 public void checkShowSuperclassesAndInterfaces(boolean state) { 156 if (cbShowSuperclassesAndInterfaces().isSelected()!=state) { 157 cbShowSuperclassesAndInterfaces().push(); 158 } 159 } 160 161 164 public void checkShowAbstractMethodsOnly(boolean state) { 165 if (cbShowAbstractMethodsOnly().isSelected()!=state) { 166 cbShowAbstractMethodsOnly().push(); 167 } 168 } 169 170 173 public void checkGenerateSuperCalls(boolean state) { 174 if (cbGenerateSuperCalls().isSelected()!=state) { 175 cbGenerateSuperCalls().push(); 176 } 177 } 178 179 182 public void checkCopyJavadoc(boolean state) { 183 if (cbCopyJavadoc().isSelected()!=state) { 184 cbCopyJavadoc().push(); 185 } 186 } 187 188 190 public void ok() { 191 btOK().push(); 192 } 193 194 196 public void cancel() { 197 btCancel().push(); 198 } 199 200 201 205 207 public void verify() { 208 lblSelectTheMethodsToOverrideOrImplementForMultipleSelectionUseCTRLKey(); 209 cbShowSuperclassesAndInterfaces(); 210 cbShowAbstractMethodsOnly(); 211 lblAvailableSuperclassAndInterfaceMethods(); 212 treeAvailableSuperclassAndInterfaceMethods(); 213 cbGenerateSuperCalls(); 214 cbCopyJavadoc(); 215 btOK(); 216 btCancel(); 217 } 218 219 222 public static void main(String args[]) { 223 new OverrideMethodsOperator().verify(); 224 System.out.println("OverrideMethodsOperator verification finished."); 225 } 226 } 227 | Popular Tags |