1 18 19 package org.apache.jmeter.control.gui; 20 21 import javax.swing.JCheckBox ; 22 23 import org.apache.jmeter.control.InterleaveControl; 24 import org.apache.jmeter.testelement.TestElement; 25 import org.apache.jmeter.util.JMeterUtils; 26 import org.apache.jorphan.gui.layout.VerticalLayout; 27 28 31 public class InterleaveControlGui extends AbstractControllerGui 32 { 33 private JCheckBox style; 34 35 public InterleaveControlGui() 36 { 37 init(); 38 } 39 40 public void configure(TestElement el) 41 { 42 super.configure(el); 43 if (((InterleaveControl) el).getStyle() 44 == InterleaveControl.IGNORE_SUB_CONTROLLERS) 45 { 46 style.setSelected(true); 47 } 48 else 49 { 50 style.setSelected(false); 51 } 52 } 53 54 public TestElement createTestElement() 55 { 56 InterleaveControl ic = new InterleaveControl(); 57 modifyTestElement(ic); 58 return ic; 59 } 60 61 65 public void modifyTestElement(TestElement ic) 66 { 67 configureTestElement(ic); 68 if (style.isSelected()) 69 { 70 ((InterleaveControl) ic).setStyle( 71 InterleaveControl.IGNORE_SUB_CONTROLLERS); 72 } 73 else 74 { 75 ((InterleaveControl) ic).setStyle( 76 InterleaveControl.USE_SUB_CONTROLLERS); 77 } 78 } 79 80 public String getLabelResource() 81 { 82 return "interleave_control_title"; 83 } 84 85 private void init() 86 { 87 setLayout( 88 new VerticalLayout(5, VerticalLayout.LEFT, VerticalLayout.TOP)); 89 setBorder(makeBorder()); 90 91 add(makeTitlePanel()); 92 93 style = 94 new JCheckBox (JMeterUtils.getResString("ignore_subcontrollers")); 95 add(style); 96 } 97 } 98 | Popular Tags |