package kg.apc.jmeter.reporters;

import java.awt.BorderLayout;
import kg.apc.jmeter.JMeterPluginsUtils;
import org.apache.jmeter.testelement.TestElement;
import org.apache.jmeter.visualizers.gui.AbstractListenerGui;

/**
 *
 * @author undera
 */
public class ConsoleStatusLoggerGui extends AbstractListenerGui {

    public static final String WIKIPAGE = "ConsoleStatusLogger";

    public ConsoleStatusLoggerGui() {
        super();
        init();
    }

    @Override
    public String getStaticLabel() {
        return JMeterPluginsUtils.prefixLabel("Console Status Logger");
    }

    public String getLabelResource() {
        return getClass().getCanonicalName();
    }

    public TestElement createTestElement() {
        TestElement te = new ConsoleStatusLogger();
        modifyTestElement(te);
        te.setComment(JMeterPluginsUtils.getWikiLinkText(WIKIPAGE));
        return te;
    }

    public void modifyTestElement(TestElement te) {
        super.configureTestElement(te);
    }

    private void init() {
        setLayout(new BorderLayout(0, 5));
        setBorder(makeBorder());
        add(JMeterPluginsUtils.addHelpLinkToPanel(makeTitlePanel(), WIKIPAGE), BorderLayout.NORTH);
    }
}

@@ -57,16 +57,78 @@
 Layout;%0A
+import javax.swing.JScrollPane;%0Aimport javax.swing.JTextArea;%0A
 import k
@@ -160,16 +160,16 @@
 sUtils;%0A
-
 import o
@@ -635,32 +635,45 @@
 ogger%22);%0A    %7D%0A%0A
+   @Override%0A
     public Strin
@@ -740,32 +740,45 @@
 lName();%0A    %7D%0A%0A
+   @Override%0A
     public TestE
@@ -980,24 +980,37 @@
  te;%0A    %7D%0A%0A
+   @Override%0A
     public v
@@ -1194,24 +1194,24 @@
 eBorder());%0A
-
         add(
@@ -1298,16 +1298,728 @@
 NORTH);%0A
+        JTextArea info = new JTextArea();%0A        info.setEditable(false);%0A        info.setWrapStyleWord(true);%0A        info.setOpaque(false);%0A        info.setLineWrap(true);%0A        info.setColumns(20);%0A%0A        JScrollPane jScrollPane1 = new javax.swing.JScrollPane();%0A        jScrollPane1.setViewportView(info);%0A        jScrollPane1.setBorder(null);%0A        %0A        info.setText(%22This is a simple listener that prints short summary log to console while JMeter is running in non-GUI mode. %22%0A                + %22It also writes the same info into jmeter.log in GUI mode.%22%0A                + %22%5Cn%5CnNote that response time and latency values printed are averages.%22);%0A%0A        add(jScrollPane1, BorderLayout.CENTER);%0A
     %7D%0A%7D%0A

add small description in GUI