jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fschumac...@apache.org
Subject [jmeter] branch master updated: Better handling of displaying long comments in the GUI
Date Sat, 02 Jan 2021 12:09:00 GMT
This is an automated email from the ASF dual-hosted git repository.

fschumacher 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 c990226  Better handling of displaying long comments in the GUI
c990226 is described below

commit c9902261de609b9979bbc54664b5e10cf7d851cb
Author: Felix Schumacher <felix.schumacher@internetallee.de>
AuthorDate: Sat Jan 2 13:07:32 2021 +0100

    Better handling of displaying long comments in the GUI
    
    Enable linewrapping in the comments text area and shorten
    comments when used as tool-tips to 80 characters.
    
    Bugzilla 65012
---
 .../src/main/java/org/apache/jmeter/gui/AbstractJMeterGuiComponent.java | 2 ++
 src/core/src/main/java/org/apache/jmeter/gui/MainFrame.java             | 2 +-
 xdocs/changes.xml                                                       | 1 +
 3 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/core/src/main/java/org/apache/jmeter/gui/AbstractJMeterGuiComponent.java
b/src/core/src/main/java/org/apache/jmeter/gui/AbstractJMeterGuiComponent.java
index aecb70f..b966638 100644
--- a/src/core/src/main/java/org/apache/jmeter/gui/AbstractJMeterGuiComponent.java
+++ b/src/core/src/main/java/org/apache/jmeter/gui/AbstractJMeterGuiComponent.java
@@ -269,6 +269,8 @@ public abstract class AbstractJMeterGuiComponent extends JPanel implements
JMete
         titlePanel.add(nameField);
 
         titlePanel.add(labelFor(nameField, "testplan_comments"));
+        commentField.setWrapStyleWord(true);
+        commentField.setLineWrap(true);
         titlePanel.add(commentField);
 
         // Note: VerticalPanel has a workaround for Box layout which aligns elements, so
we can't
diff --git a/src/core/src/main/java/org/apache/jmeter/gui/MainFrame.java b/src/core/src/main/java/org/apache/jmeter/gui/MainFrame.java
index da3e027..85e886e 100644
--- a/src/core/src/main/java/org/apache/jmeter/gui/MainFrame.java
+++ b/src/core/src/main/java/org/apache/jmeter/gui/MainFrame.java
@@ -670,7 +670,7 @@ public class MainFrame extends JFrame implements TestStateListener, Remoteable,
                         if (testElement instanceof TestElement) {
                             String comment = ((TestElement) testElement).getComment();
                             if (StringUtils.isNotBlank(comment)) {
-                                return comment;
+                                return StringUtils.abbreviate(comment, 80);
                             }
                         }
                     }
diff --git a/xdocs/changes.xml b/xdocs/changes.xml
index 5f5ecb8..6dba1de 100644
--- a/xdocs/changes.xml
+++ b/xdocs/changes.xml
@@ -112,6 +112,7 @@ Summary
 <h3>General</h3>
 <ul>
   <li><bug>65028</bug>Add documentation for the property <code>client.rmi.localport</code></li>
+  <li><bug>65012</bug>Better handling of displaying long comments in the
GUI</li>
 </ul>
 
 <ch_section>Non-functional changes</ch_section>


Mime
View raw message