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 ClassCustomizerOperator extends JDialogOperator { 36 37 39 public ClassCustomizerOperator(String name) { 40 super(name); 41 } 42 43 private JSplitPaneOperator _sppJSplitPane; 44 private JTextAreaOperator _txtJTextArea; 45 private JLabelOperator _lblNewClass; 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 lblNewClass() { 79 if (_lblNewClass==null) { 80 _lblNewClass = new JLabelOperator(sppJSplitPane(), "NewClass"); 81 } 82 return _lblNewClass; 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 lblNewClass(); 164 btJButton(); 165 tabPropertiesTable(); 166 btClose(); 167 } 168 169 172 public static void main(String args[]) { 173 new ClassCustomizerOperator("Edit New Class").verify(); 174 System.out.println("ClassCustomizerOperator verification finished."); 175 } 176 } 177 | Popular Tags |