1 | public class TransactionControllerGui extends AbstractControllerGui {↵ | | 1 | public class JavaTestSamplerGui extends AbstractSamplerGui {↵
|
|
2 | private JCheckBox parent; // If selected, then generate parent sample, otherwise as per original controller↵ | | |
|
|
3 | /**↵ | | |
|
4 | * Create a new TransactionControllerGui instance.↵ | | |
|
5 | */↵ | | |
|
6 | public TransactionControllerGui() {↵ | | |
|
7 | init(↵ | | 2 | /** Panel containing the configuration options. */↵
|
| | | 3 | private JavaConfigGui javaPanel = null;↵
|
|
| | | 4 | /**↵
|
| | | 5 | * Constructor for JavaTestSamplerGui↵
|
| | | 6 | */↵
|
| | | 7 | public JavaTestSamplerGui() {↵
|
| | | 8 | super();↵
|
| | | 9 | init();↵
|
| | | 10 | }↵
|
|
| | | 11 | public String getLabelResource() {↵
|
| | | 12 | return "java_request"; // $NON-NLS-1$↵
|
| | | 13 | }↵
|
|
| | | 14 | /**↵
|
| | | 15 | * Initialize the GUI components and layout.↵
|
| | | 16 | */↵
|
| | | 17 | private void init() {↵
|
| | | 18 | setLayout(new BorderLayout(0, 5));↵
|
| | | 19 | setBorder(makeBorder());↵
|
|
| | | 20 | add(makeTitlePanel(), BorderLayout.NORTH);↵
|
|
| | | 21 | javaPanel = new JavaConfigGui(false);↵
|
|
8 | );↵ | | 22 | add(javaPanel, BorderLayout.CENTER);↵
|
9 | }↵ | | 23 | }↵
|
|
10 | /* Implements JMeterGUIComponent.createTestElement() */↵ | | 24 | /* Implements JMeterGuiComponent.createTestElement() */↵
|
11 | public TestElement createTestElement() {↵ | | 25 | public TestElement createTestElement() {↵
|
12 | TransactionController lc = new TransactionController();↵ | | 26 | ↵
|
13 | configureTestElement(lc);↵ | | |
|
14 | return lc;↵ | | |
|
15 | }↵ | | |
|
|
16 | public void configure(TestElement el) {↵ | | |
|
17 | super.configure(el↵ | | 27 | JavaSampler sampler = new JavaSampler();↵
|
18 | );↵ | | 28 | modifyTestElement(sampler);↵
|
19 | parent.setSelected(((TransactionController) el).isParent());↵ | | 29 | return sampler;↵
|
20 | }↵ | | 30 | }↵
|
|
21 | /* Implements JMeterGUIComponent.modifyTestElement(TestElement) */↵ | | 31 | /* Implements JMeterGuiComponent.modifyTestElement(TestElement) */↵
|
22 | public void modifyTestElement(TestElement el) {↵ | | 32 | public void modifyTestElement(TestElement ↵
|
23 | configureTestElement(el);↵ | | |
|
24 | ((TransactionController) el).setParent(parent.isSelected());↵ | | |
|
25 | }↵ | | |
|
|
26 | public String getLabelResource() {↵ | | |
|
27 | return "transaction_controller_title"; // $NON-NLS-1$↵ | | |
|
28 | }↵ | | |
|
|
29 | /**↵ | | |
|
30 | * Initialize the GUI components and layout for this component.↵ | | |
|
31 | */↵ | | |
|
32 | private void init() {↵ | | |
|
33 | setLayout(new VerticalLayout(5, VerticalLayout.BOTH, VerticalLayout.TOP));↵ | | |
|
34 | setBorder(makeBorder());↵ | | |
|
35 | add(makeTitlePanel());↵ | | |
|
36 | parent = new JCheckBox(JMeterUtils.getResString("transaction_controller_parent")); // $NON-NLS-1$↵ | | |
|
37 | add(parent↵ | | 33 | sampler) {↵
|
| | | 34 | sampler.clear();↵
|
| | | 35 | JavaConfig config = (JavaConfig) javaPanel.createTestElement();↵
|
| | | 36 | configureTestElement(sampler);↵
|
| | | 37 | sampler.addTestElement(config);↵
|
| | | 38 | }↵
|
|
| | | 39 | /* Overrides AbstractJMeterGuiComponent.configure(TestElement) */↵
|
| | | 40 | public void configure(TestElement el) {↵
|
| | | 41 | super.configure(el);↵
|
38 | );↵ | | 42 | javaPanel.configure(el);↵
|
39 | | | 43 |
|