jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmoua...@apache.org
Subject [jmeter] branch master updated: Bug 64275 - Function Helper Dialog: Improve UX
Date Sat, 28 Mar 2020 22:38:24 GMT
This is an automated email from the ASF dual-hosted git repository.

pmouawad pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/jmeter.git


The following commit(s) were added to refs/heads/master by this push:
     new 851faa9  Bug 64275 - Function Helper Dialog: Improve UX
851faa9 is described below

commit 851faa9a00b4c439398c5d5b04fb2c83fd23962e
Author: pmouawad <p.mouawad@ubik-ingenierie.com>
AuthorDate: Sat Mar 28 23:37:54 2020 +0100

    Bug 64275 - Function Helper Dialog: Improve UX
---
 .../jmeter/functions/gui/FunctionHelper.java       | 27 +++++++++++-----------
 xdocs/changes.xml                                  |  1 +
 2 files changed, 15 insertions(+), 13 deletions(-)

diff --git a/src/core/src/main/java/org/apache/jmeter/functions/gui/FunctionHelper.java b/src/core/src/main/java/org/apache/jmeter/functions/gui/FunctionHelper.java
index b8e5a28..c2cb842 100644
--- a/src/core/src/main/java/org/apache/jmeter/functions/gui/FunctionHelper.java
+++ b/src/core/src/main/java/org/apache/jmeter/functions/gui/FunctionHelper.java
@@ -34,7 +34,6 @@ import javax.swing.JButton;
 import javax.swing.JComponent;
 import javax.swing.JDialog;
 import javax.swing.JFrame;
-import javax.swing.JLabel;
 import javax.swing.JPanel;
 import javax.swing.JRootPane;
 import javax.swing.event.ChangeEvent;
@@ -52,7 +51,6 @@ import org.apache.jmeter.gui.action.Help;
 import org.apache.jmeter.gui.action.KeyStrokes;
 import org.apache.jmeter.gui.util.JSyntaxTextArea;
 import org.apache.jmeter.gui.util.JTextScrollPane;
-import org.apache.jmeter.gui.util.VerticalPanel;
 import org.apache.jmeter.testelement.property.PropertyIterator;
 import org.apache.jmeter.threads.JMeterContext;
 import org.apache.jmeter.threads.JMeterContextService;
@@ -70,6 +68,8 @@ import org.apache.jorphan.gui.JLabeledTextField;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import net.miginfocom.swing.MigLayout;
+
 public class FunctionHelper extends JDialog implements ActionListener, ChangeListener, LocaleChangeListener
{
     private static final long serialVersionUID = 240L;
 
@@ -134,11 +134,10 @@ public class FunctionHelper extends JDialog implements ActionListener,
ChangeLis
         comboPanel.add(helpButton);
         this.getContentPane().add(comboPanel, BorderLayout.NORTH);
         this.getContentPane().add(parameterPanel, BorderLayout.CENTER);
-        JPanel resultsPanel = new VerticalPanel();
+        JPanel resultsPanel = new JPanel(new MigLayout("fillx, wrap 2", "[][fill,grow]"));
         JPanel generatePanel = new JPanel(new FlowLayout(FlowLayout.CENTER));
-        JPanel displayPanel = new JPanel(new FlowLayout(FlowLayout.LEFT));
-        JPanel variablesPanel = new JPanel(new FlowLayout(FlowLayout.LEFT));
         cutPasteFunction = new JLabeledTextField(JMeterUtils.getResString("cut_paste_function"),
35, null, false); //$NON-NLS-1$
+        cutPasteFunction.setEnabled(false);
         generatePanel.add(cutPasteFunction);
         JButton generateButton = new JButton(JMeterUtils.getResString("generate")); //$NON-NLS-1$
         generateButton.setActionCommand(GENERATE);
@@ -151,17 +150,19 @@ public class FunctionHelper extends JDialog implements ActionListener,
ChangeLis
         generatePanel.add(resetVarsButton);
 
         resultTextArea = JSyntaxTextArea.getInstance(5,60);
+        resultTextArea.setEditable(false);
         resultTextArea.setToolTipText(JMeterUtils.getResString("function_helper_dialog_result_warn"));
-        displayPanel.add(new JLabel(JMeterUtils.getResString("result_function")));
-        displayPanel.add(JTextScrollPane.getInstance(resultTextArea));
 
         variablesTextArea = JSyntaxTextArea.getInstance(10,60);
-        variablesPanel.add(new JLabel(JMeterUtils.getResString("function_helper_dialog_variables")));
-        variablesPanel.add(JTextScrollPane.getInstance(variablesTextArea));
-
-        resultsPanel.add(generatePanel);
-        resultsPanel.add(displayPanel);
-        resultsPanel.add(variablesPanel);
+        variablesTextArea.setEditable(false);
+
+        resultsPanel.add(generatePanel, "span 2");
+        JTextScrollPane resultTextAreaJSP = JTextScrollPane.getInstance(resultTextArea);
+        resultsPanel.add(JMeterUtils.labelFor(resultTextAreaJSP, "result_function"));
+        resultsPanel.add(resultTextAreaJSP);
+        JTextScrollPane variablesTextAreaJSP = JTextScrollPane.getInstance(variablesTextArea);
+        resultsPanel.add(JMeterUtils.labelFor(variablesTextAreaJSP, "function_helper_dialog_variables"));
+        resultsPanel.add(variablesTextAreaJSP);
 
         this.getContentPane().add(resultsPanel, BorderLayout.SOUTH);
         this.pack();
diff --git a/xdocs/changes.xml b/xdocs/changes.xml
index 5acd16f..a024927 100644
--- a/xdocs/changes.xml
+++ b/xdocs/changes.xml
@@ -133,6 +133,7 @@ For instance: log viewer, JSR223 code editor were not previously scaled
with zoo
 <h3>Functions</h3>
 <ul>
   <li><bug>64070</bug><code>_timeshift</code> function does
not work with offset formatters</li>
+  <li><bug>64275</bug>Function Helper Dialog: Improve UX</li>
 </ul>
 
 <h3>I18N</h3>


Mime
View raw message