Bug 50221

Summary: Renaming elements in the tree does not resize label
Product: JMeter Reporter: jens_0
Component: MainAssignee: JMeter issues mailing list <issues>
Severity: minor CC: jens_0
Priority: P2    
Version: 2.4   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   

Description jens_0 2010-11-05 08:59:21 UTC
Often, when test elements are renamed, their label in the test tree does not resize: When the name is longer than before, it is displayed with "...", if the name is shorter than before, it the blue selection box is too large.

This can be fixed by expanding or collapsing the element, in case it has children.
Comment 1 Sebb 2010-11-05 10:59:53 UTC
Or by disabling and re-enabling the element...
Comment 2 jens_0 2011-02-02 11:00:34 UTC
The method JMeterTreeNode.nameChanged() is never called but fixes this.

It needs to be called on the right moment, probably on the node that just is left when changing the focus. The only events that I found are raised too late: They are applied on the node that is switched to, but if you switch back to the node with short label "..." then it helps:

So this only solves it halfway. It can't be that difficult?
Comment 3 Sebb 2011-02-02 11:30:45 UTC
Thanks for that insight - I have found the place in GuiPackage where the GUI fields are saved when changing node. Adding a call to nameChanged() seems to fix the issue:

URL: http://svn.apache.org/viewvc?rev=1066517&view=rev
Bug 50221 - Renaming elements in the tree does not resize label

Comment 4 jens_0 2011-07-20 09:09:08 UTC
I get null pointer exceptions sometimes when opening large test plans at the start of JMeter.

This solved the problem:

    /** {@inheritDoc} */
    public void nameChanged() {
+   	if (treeModel != null) {
+    	}