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
commit 510c92fe736b29325625e8d3bb0698676e0ffffb Author: pmouawad <[email protected]> AuthorDate: Sun Mar 29 22:11:17 2020 +0200 Bug 64287 - WhileController: Improve UX --- .../jmeter/control/gui/WhileControllerGui.java | 27 +++++++--------------- xdocs/changes.xml | 1 + 2 files changed, 9 insertions(+), 19 deletions(-) diff --git a/src/core/src/main/java/org/apache/jmeter/control/gui/WhileControllerGui.java b/src/core/src/main/java/org/apache/jmeter/control/gui/WhileControllerGui.java index 2ce6fc4..30921fc 100644 --- a/src/core/src/main/java/org/apache/jmeter/control/gui/WhileControllerGui.java +++ b/src/core/src/main/java/org/apache/jmeter/control/gui/WhileControllerGui.java @@ -19,8 +19,6 @@ package org.apache.jmeter.control.gui; import java.awt.BorderLayout; -import javax.swing.Box; -import javax.swing.JLabel; import javax.swing.JPanel; import org.apache.jmeter.control.WhileController; @@ -31,14 +29,14 @@ import org.apache.jmeter.gui.util.JTextScrollPane; import org.apache.jmeter.testelement.TestElement; import org.apache.jmeter.util.JMeterUtils; +import net.miginfocom.swing.MigLayout; + @GUIMenuSortOrder(4) @TestElementMetadata(labelResource = "while_controller_title") public class WhileControllerGui extends AbstractControllerGui { private static final long serialVersionUID = 240L; - private static final String CONDITION_LABEL = "while_controller_label"; // $NON-NLS-1$ - /** * A field allowing the user to specify the condition (not yet used). */ @@ -118,11 +116,7 @@ public class WhileControllerGui extends AbstractControllerGui { setLayout(new BorderLayout(0, 5)); setBorder(makeBorder()); add(makeTitlePanel(), BorderLayout.NORTH); - - JPanel mainPanel = new JPanel(new BorderLayout()); - mainPanel.add(createConditionPanel(), BorderLayout.NORTH); - add(mainPanel, BorderLayout.CENTER); - + add(createConditionPanel(), BorderLayout.CENTER); } /** @@ -131,20 +125,15 @@ public class WhileControllerGui extends AbstractControllerGui { * @return a GUI panel containing the condition components */ private JPanel createConditionPanel() { - JPanel conditionPanel = new JPanel(new BorderLayout(5, 0)); - - // Condition LABEL - JLabel conditionLabel = new JLabel(JMeterUtils.getResString(CONDITION_LABEL)); - conditionPanel.add(conditionLabel, BorderLayout.WEST); + JPanel conditionPanel = new JPanel(new MigLayout("fillx, wrap 2", "[][fill,grow]")); // Condition // This means exit if last sample failed - theCondition = JSyntaxTextArea.getInstance(5, 50); // $NON-NLS-1$ + theCondition = JSyntaxTextArea.getInstance(5, 50); + JTextScrollPane theConditionJSP = JTextScrollPane.getInstance(theCondition); + conditionPanel.add(JMeterUtils.labelFor(theConditionJSP, "while_controller_label")); theCondition.setName(CONDITION); - conditionLabel.setLabelFor(theCondition); - conditionPanel.add(JTextScrollPane.getInstance(theCondition), BorderLayout.CENTER); - - conditionPanel.add(Box.createHorizontalGlue(), BorderLayout.NORTH); + conditionPanel.add(theConditionJSP); return conditionPanel; } diff --git a/xdocs/changes.xml b/xdocs/changes.xml index 9a7bab0..a3b0f65 100644 --- a/xdocs/changes.xml +++ b/xdocs/changes.xml @@ -120,6 +120,7 @@ For instance: log viewer, JSR223 code editor were not previously scaled with zoo <li><bug>64277</bug>ForEach Controller: Improve UX</li> <li><bug>64280</bug>If Controller: Improve UX</li> <li><bug>64282</bug>Throughput Controller: Improve UX</li> + <li><bug>64287</bug>WhileController: Improve UX</li> </ul> <h3>Listeners</h3>
