1 18 19 package org.apache.jmeter.protocol.java.control.gui; 20 21 import java.awt.BorderLayout ; 22 23 import org.apache.jmeter.protocol.java.config.JavaConfig; 24 import org.apache.jmeter.protocol.java.config.gui.JavaConfigGui; 25 import org.apache.jmeter.protocol.java.sampler.JavaSampler; 26 import org.apache.jmeter.samplers.gui.AbstractSamplerGui; 27 import org.apache.jmeter.testelement.TestElement; 28 29 35 public class JavaTestSamplerGui extends AbstractSamplerGui 36 { 37 38 private JavaConfigGui javaPanel = null; 39 40 43 public JavaTestSamplerGui() 44 { 45 super(); 46 init(); 47 } 48 49 public String getLabelResource() 50 { 51 return "java_request"; 52 } 53 54 57 private void init() 58 { 59 setLayout(new BorderLayout (0, 5)); 60 setBorder(makeBorder()); 61 62 add(makeTitlePanel(), BorderLayout.NORTH); 63 64 javaPanel = new JavaConfigGui(false); 65 66 add(javaPanel, BorderLayout.CENTER); 67 } 68 69 70 public TestElement createTestElement() 71 { 72 JavaSampler sampler = new JavaSampler(); 73 modifyTestElement(sampler); 74 return sampler; 75 } 76 77 78 public void modifyTestElement(TestElement sampler) 79 { 80 sampler.clear(); 81 JavaConfig config = (JavaConfig) javaPanel.createTestElement(); 82 configureTestElement(sampler); 83 sampler.addTestElement(config); 84 } 85 86 87 public void configure(TestElement el) 88 { 89 super.configure(el); 90 javaPanel.configure(el); 91 } 92 } 93 94 | Popular Tags |