Bug 52679 - User Parameters columns narrow
User Parameters columns narrow
Product: JMeter
Classification: Unclassified
Component: Main
All All
: P5 regression (vote)
: ---
Assigned To: JMeter issues mailing list
Depends on:
  Show dependency tree
Reported: 2012-02-16 09:48 UTC by immanuel.hayden
Modified: 2012-02-29 13:27 UTC (History)
1 user (show)

min-width vs width (706 bytes, text/html)
2012-02-18 09:43 UTC, immanuel.hayden
Proposal patch (2.50 KB, patch)
2012-02-18 13:21 UTC, Milamber
Details | Diff
Proposal Patch II (3.46 KB, patch)
2012-02-29 10:06 UTC, immanuel.hayden
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description immanuel.hayden 2012-02-16 09:48:21 UTC

Just saw 2.6 release -> nice changes :D
But I also have one issue that I would count as a regression from the 2.5 version: In the User Parameters element the columns are much narrower than they need to be.
For one user they only fill about half the width of the element. This wouldn't be an issue if the column would remember the width once you resize it, but after you switch away from the element and back again the columns are needlessly narrow again.

So, it would be cool if the columns either stay the width they are resized to or if they could be as wide as the widest element in them

eg like this:

| Name        | User_1                |            |
|-------------------------------------|   little   |
| longvarname | bla                   |   wasted   |
| short       | even longer var value |   space    |

currently it's more like this:

| Name      | User_1    |                          |
|-----------------------|         much             |
| longvarna | bla       |         wasted           |
| short     | even long |         space            |

thanks for considering :)

Comment 1 Philippe Mouawad 2012-02-17 20:49:36 UTC
This "regression" is an effect of fix to 27112.
Comment 2 immanuel.hayden 2012-02-18 09:43:11 UTC
Created attachment 28350 [details]
min-width vs width

thought so much ;)

this is why my idea was, not so much to change this back (as I quite clearly see the use of that feature), but to make the column size choice more intelligent (eg. in css terms: define a min-width instead of a width)

with my bad html and css skills I created the attached mockup. notice how the second long text gets wrapped when using "width" instead of "min-width" (yes, I am too stupid to get overflow working just now ;)).
Comment 3 Milamber 2012-02-18 13:21:42 UTC
Created attachment 28351 [details]
Proposal patch

* Arbitrary minimum size to 200 px after (nb columns * 200) > table width (and a scroll pane)
* Else column width = table width / nb column (no scroll pane)
Comment 4 immanuel.hayden 2012-02-18 15:27:35 UTC
while definitely an improvement, as far as I understand this, the table is still not "content-aware" (eg. mostly short variable names, but much content -> still two columns with the same width)
I think this guy http://binkley.blogspot.com/2006/01/getting-jtable-columns-widths-to-fit.html has the solution that I would describe as best fitting (without the min-width, but that should be only an if in the right place ;))
Comment 5 Philippe Mouawad 2012-02-28 20:36:13 UTC
Hello Milamber, 
Until we find a better solution, +1 for your solution.

Comment 6 immanuel.hayden 2012-02-29 10:06:16 UTC
Created attachment 28405 [details]
Proposal Patch II

Sorry this took me so long ... was not trivial for me to get jmeter compiling because eclipse didn't like it (ended up ditching eclipse in the end).
Anyhow, here is my proposal patch which I patched together from http://bosmeeuw.wordpress.com/2011/08/07/java-swing-automatically-resize-table-columns-to-their-contents/ ... colums are sized to either fit the content (with a little additional margin) or 100 px minimum width. I am pretty sure there is a more elegant way to do this, but for now I'm happy it works :D
Comment 7 Philippe Mouawad 2012-02-29 13:27:26 UTC
Applied, thanks for the patch.

Date: Wed Feb 29 13:25:02 2012
New Revision: 1295094

URL: http://svn.apache.org/viewvc?rev=1295094&view=rev
Bug 52679 - User Parameters columns narrow