1 | public class InterleaveControlGui extends AbstractControllerGui {↵ | | 1 | public class RandomControlGui extends AbstractControllerGui {↵
|
2 | private JCheckBox style;↵ | | 2 | private JCheckBox style;↵
|
|
3 | public InterleaveControlGui() {↵ | | 3 | public RandomControlGui() {↵
|
4 | init();↵ | | 4 | init();↵
|
5 | }↵ | | 5 | }↵
|
|
6 | public void configure(TestElement el) {↵ | | |
|
7 | super.configure(el);↵ | | |
|
8 | if (((InterleaveControl) el).getStyle() == InterleaveControl.IGNORE_SUB_CONTROLLERS) {↵ | | |
|
9 | style.setSelected(true);↵ | | |
|
10 | } else {↵ | | |
|
11 | style.setSelected(false);↵ | | |
|
12 | }↵ | | |
|
13 | }↵ | | |
|
|
14 | public TestElement createTestElement() {↵ | | 6 | public TestElement createTestElement() {↵
|
15 | InterleaveControl ic = new InterleaveControl();↵ | | 7 | RandomController ic = new RandomController();↵
|
16 | modifyTestElement(ic);↵ | | 8 | modifyTestElement(ic);↵
|
17 | return ic;↵ | | 9 | return ic;↵
|
18 | }↵ | | 10 | }↵
|
|
19 | /**↵ | | 11 | /**↵
|
20 | * Modifies a given TestElement to mirror the data in the gui components.↵ | | 12 | * Modifies a given TestElement to mirror the data in the gui components.↵
|
21 | * ↵ | | 13 | * ↵
|
22 | * @see org.apache.jmeter.gui.JMeterGUIComponent#modifyTestElement(TestElement)↵ | | 14 | * @see org.apache.jmeter.gui.JMeterGUIComponent#modifyTestElement(TestElement)↵
|
23 | */↵ | | 15 | */↵
|
24 | public void modifyTestElement(TestElement ic) {↵ | | 16 | public void modifyTestElement(TestElement ic) {↵
|
25 | configureTestElement(ic);↵ | | 17 | configureTestElement(ic);↵
|
26 | if (style.isSelected()) {↵ | | 18 | if (style.isSelected()) {↵
|
27 | ((InterleaveControl) ic).setStyle(InterleaveControl.IGNORE_SUB_CONTROLLERS);↵ | | 19 | ((RandomController) ic).setStyle(InterleaveControl.IGNORE_SUB_CONTROLLERS);↵
|
28 | } else {↵ | | 20 | } else {↵
|
29 | ((InterleaveControl) ic).setStyle(InterleaveControl.USE_SUB_CONTROLLERS);↵ | | 21 | ((RandomController) ic).setStyle(InterleaveControl.USE_SUB_CONTROLLERS);↵
|
30 | }↵ | | 22 | }↵
|
31 | }↵ | | 23 | }↵
|
|
32 | /**↵ | | 24 | /**↵
|
33 | * Implements JMeterGUIComponent.clearGui↵ | | 25 | * Implements JMeterGUIComponent.clearGui↵
|
34 | */↵ | | 26 | */↵
|
35 | public void clearGui() {↵ | | 27 | public void clearGui() {↵
|
36 | super.clearGui(); ↵ | | 28 | super.clearGui(); ↵
|
37 | style.setSelected(false);↵ | | 29 | style.setSelected(false);↵
|
38 | }↵ | | 30 | }↵
|
39 | ↵ | | |
|
| | | 31 | public void configure(TestElement el) {↵
|
| | | 32 | super.configure(el);↵
|
| | | 33 | if (((RandomController) el).getStyle() == InterleaveControl.IGNORE_SUB_CONTROLLERS) {↵
|
| | | 34 | style.setSelected(true);↵
|
| | | 35 | } else {↵
|
| | | 36 | style.setSelected(false);↵
|
| | | 37 | }↵
|
| | | 38 | }↵
|
|
40 | public String getLabelResource() {↵ | | 39 | public String getLabelResource() {↵
|
41 | return "interleave_control_title"; // $NON-NLS-1$↵ | | 40 | return "random_control_title"; // $NON-NLS-1$↵
|
42 | }↵ | | 41 | }↵
|
|
43 | private void init() {↵ | | 42 | private void init() {↵
|
44 | setLayout(new VerticalLayout(5, VerticalLayout.BOTH, VerticalLayout.TOP));↵ | | 43 | setLayout(new VerticalLayout(5, VerticalLayout.BOTH, VerticalLayout.TOP));↵
|
45 | setBorder(makeBorder());↵ | | 44 | setBorder(makeBorder());↵
|
|
46 | add(makeTitlePanel());↵ | | 45 | add(makeTitlePanel());↵
|
|
47 | style = new JCheckBox(JMeterUtils.getResString("ignore_subcontrollers")); // $NON-NLS-1$↵ | | 46 | style = new JCheckBox(JMeterUtils.getResString("ignore_subcontrollers")); // $NON-NLS-1$↵
|
48 | add(style);↵ | | 47 | add(style);↵
|
49 | | | 48 |
|