1 | RunTimeGui(boolean displayName) {↵ | | 1 | LoopControlPanel(boolean displayName) {↵
|
2 | this.displayName = displayName;↵ | | 2 | this.displayName = displayName;↵
|
3 | init();↵ | | 3 | init();↵
|
4 | setState(1);↵ | | 4 | setState(1);↵
|
5 | }↵ | | 5 | }↵
|
|
6 | /**↵ | | 6 | /**↵
|
7 | * A newly created component can be initialized with the contents of a Test↵ | | 7 | * A newly created component can be initialized with the contents of a Test↵
|
8 | * Element object by calling this method. The component is responsible for↵ | | 8 | * Element object by calling this method. The component is responsible for↵
|
9 | * querying the Test Element object for the relevant information to display↵ | | 9 | * querying the Test Element object for the relevant information to display↵
|
10 | * in its GUI.↵ | | 10 | * in its GUI.↵
|
11 | * ↵ | | 11 | * ↵
|
12 | * @param element↵ | | 12 | * @param element↵
|
13 | * the TestElement to configure↵ | | 13 | * the TestElement to configure↵
|
14 | */↵ | | 14 | */↵
|
15 | public void configure(TestElement element) {↵ | | 15 | public void configure(TestElement element) {↵
|
16 | super.configure(element);↵ | | 16 | super.configure(element);↵
|
17 | if (element instanceof RunTime) {↵ | | 17 | if (element instanceof LoopController) {↵
|
18 | setState(((RunTime) element).getRuntimeString());↵ | | 18 | setState(((LoopController) element).getLoopString());↵
|
19 | } else {↵ | | 19 | } else {↵
|
20 | setState(1);↵ | | 20 | setState(1);↵
|
21 | }↵ | | 21 | }↵
|
22 | }↵ | | 22 | }↵
|
|
23 | /* Implements JMeterGUIComponent.createTestElement() */↵ | | 23 | /* Implements JMeterGUIComponent.createTestElement() */↵
|
24 | public TestElement createTestElement() {↵ | | 24 | public TestElement createTestElement() {↵
|
25 | RunTime lc = new RunTime();↵ | | 25 | LoopController lc = new LoopController();↵
|
26 | modifyTestElement(lc);↵ | | 26 | modifyTestElement(lc);↵
|
27 | return lc;↵ | | 27 | return lc;↵
|
28 | }↵ | | 28 | }↵
|
|
29 | /* Implements JMeterGUIComponent.modifyTestElement(TestElement) */↵ | | 29 | /* Implements JMeterGUIComponent.modifyTestElement(TestElement) */↵
|
30 | public void modifyTestElement(TestElement lc) {↵ | | 30 | public void modifyTestElement(TestElement lc) {↵
|
31 | configureTestElement(lc);↵ | | 31 | configureTestElement(lc);↵
|
32 | if (lc instanceof RunTime) {↵ | | 32 | if (lc instanceof LoopController) {↵
|
33 | if (seconds.getText().length() > 0) {↵ | | 33 | if (loops.getText().length() > 0) {↵
|
34 | ((RunTime) lc).setRuntime(seconds.getText());↵ | | 34 | ((LoopController) lc).setLoops(loops.getText());↵
|
35 | } else {↵ | | 35 | } else {↵
|
36 | ((RunTime) lc).setRuntime(0);↵ | | 36 | ((LoopController) lc).setLoops(-1);↵
|
37 | }↵ | | 37 | }↵
|
38 | }↵ | | 38 | }↵
|
39 | } | | 39 | }
|