1 19 20 25 package org.netbeans.jellytools.modules.java; 26 27 import org.netbeans.jemmy.operators.*; 28 import org.netbeans.jemmy.util.NameComponentChooser; 29 30 35 public class FieldCustomizerOperator extends JDialogOperator { 36 37 39 public FieldCustomizerOperator(String name) { 40 super(name); 41 } 42 43 private JSplitPaneOperator _sppJSplitPane; 44 private JTextAreaOperator _txtJTextArea; 45 private JLabelOperator _lblErr; 46 private JButtonOperator _btJButton; 47 private JTableOperator _tabPropertiesTable; 48 private JButtonOperator _btClose; 49 50 51 55 58 public JSplitPaneOperator sppJSplitPane() { 59 if (_sppJSplitPane==null) { 60 _sppJSplitPane = new JSplitPaneOperator(this); 61 } 62 return _sppJSplitPane; 63 } 64 65 68 public JTextAreaOperator txtJTextArea() { 69 if (_txtJTextArea==null) { 70 _txtJTextArea = new JTextAreaOperator(sppJSplitPane()); 71 } 72 return _txtJTextArea; 73 } 74 75 78 public JLabelOperator lblErr() { 79 if (_lblErr==null) { 80 _lblErr = new JLabelOperator(sppJSplitPane(), "err"); 81 } 82 return _lblErr; 83 } 84 85 88 public JButtonOperator btJButton() { 89 if (_btJButton==null) { 90 _btJButton = new JButtonOperator(sppJSplitPane()); 91 } 92 return _btJButton; 93 } 94 95 98 public JTableOperator tabPropertiesTable() { 99 if (_tabPropertiesTable==null) { 100 _tabPropertiesTable = new JTableOperator(sppJSplitPane()); 101 } 102 return _tabPropertiesTable; 103 } 104 105 108 public JButtonOperator btClose() { 109 if (_btClose==null) { 110 _btClose = new JButtonOperator(this, "Close"); 111 } 112 return _btClose; 113 } 114 115 116 120 123 public String getJTextArea() { 124 return txtJTextArea().getText(); 125 } 126 127 130 public void setJTextArea(String text) { 131 txtJTextArea().setText(text); 132 } 133 134 137 public void typeJTextArea(String text) { 138 txtJTextArea().typeText(text); 139 } 140 141 143 public void jButton() { 144 btJButton().push(); 145 } 146 147 149 public void close() { 150 btClose().push(); 151 } 152 153 154 158 160 public void verify() { 161 sppJSplitPane(); 162 txtJTextArea(); 163 lblErr(); 164 btJButton(); 165 tabPropertiesTable(); 166 btClose(); 167 } 168 169 172 public static void main(String args[]) { 173 new FieldCustomizerOperator("Edit New Field").verify(); 174 System.out.println("FieldCustomizerOperator verification finished."); 175 } 176 } 177 178 | Popular Tags |