jmeter-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vladimir Sitnikov <sitnikov.vladi...@gmail.com>
Subject Re: Some feedback on JMeter UI
Date Wed, 02 Oct 2019 21:20:07 GMT
Here you go: https://github.com/apache/jmeter/pull/513

What do you think?

The key idea there is to avoid "panel-in-panel" approach to the UI.
panel-in-panel is "nice" to build UI from pieces, however, it complicates
alignment of the fields that reside in different sub-sub-panels.

The most trivial case is
        JPanel titlePanel = new JPanel(new MigLayout("fillx, wrap 2",
"[][fill,grow]"));
        titlePanel.add(titleLabel, "span 2"); // this item spans for two
columns
        titlePanel.add(nameLabel); // this is placed into column 1
        titlePanel.add(nameField); // this is placed into column 2, and
then layout wraps since we have 2 columns only
        titlePanel.add(commentLabel); // row 2, column 1
        titlePanel.add(commentField); // row 2, column 2

A bit more interesting case is where to put "loop forever" checkbox.
Note: I don't like the checkbox itself, but the goal here is the layout
itself rather than re-designing all the UI components.

So let's place "forever":
https://github.com/apache/jmeter/pull/513/files#diff-ae547a9060410d9e4f28c1d91f9645b7R238-R240

        threadPropsPanel.add(loopsLabel, "split 2"); // this goes into
"column1", however "split2" specifies that our column is split in two pieces
        threadPropsPanel.add(foreverCheckbox, "gapleft push"); // this is
placed to the second subcolumn of the first column. And we say it should
push all the gap to the left
        threadPropsPanel.add(loopsField); // this goes to the "column 2"

That is it. It does not require "panel-in-panel", and the fields become
aligned.

Vladimir

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message