jmeter-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Felix Schumacher <felix.schumac...@internetallee.de>
Subject Re: svn commit: r1782268 - in /jmeter/trunk: src/core/org/apache/jmeter/gui/util/TextAreaCellRenderer.java xdocs/changes.xml
Date Thu, 09 Feb 2017 05:30:01 GMT


Am 8. Februar 2017 23:16:45 MEZ schrieb pmouawad@apache.org:
>Author: pmouawad
>Date: Wed Feb  8 22:16:45 2017
>New Revision: 1782268
>
>URL: http://svn.apache.org/viewvc?rev=1782268&view=rev
>Log:
>Bug 60712 - Response Assertion : Improve Renderer of Patterns
>Bugzilla Id: 60712
>
>Modified:
>jmeter/trunk/src/core/org/apache/jmeter/gui/util/TextAreaCellRenderer.java
>    jmeter/trunk/xdocs/changes.xml
>
>Modified:
>jmeter/trunk/src/core/org/apache/jmeter/gui/util/TextAreaCellRenderer.java
>URL:
>http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/gui/util/TextAreaCellRenderer.java?rev=1782268&r1=1782267&r2=1782268&view=diff
>==============================================================================
>---
>jmeter/trunk/src/core/org/apache/jmeter/gui/util/TextAreaCellRenderer.java
>(original)
>+++
>jmeter/trunk/src/core/org/apache/jmeter/gui/util/TextAreaCellRenderer.java
>Wed Feb  8 22:16:45 2017
>@@ -18,36 +18,45 @@
> 
> package org.apache.jmeter.gui.util;
> 
>+import java.awt.Color;
> import java.awt.Component;
> 
> import javax.swing.JTable;
>-import javax.swing.JTextArea;
> import javax.swing.table.TableCellRenderer;
> 
> public class TextAreaCellRenderer implements TableCellRenderer {
> 
>-    private JTextArea rend = new JTextArea("");
>+    private JSyntaxTextArea rend = createRenderer(""); //$NON-NLS-1$ 
> 
>     @Override
>public Component getTableCellRendererComponent(JTable table, Object
>value,
>             boolean isSelected, boolean hasFocus,
>             int row, int column) {
>         if(value != null) {
>-            rend = new JTextArea(value.toString());
>+            rend = createRenderer((String)value);
>         } else {
>-            rend = new JTextArea();
>+            rend = createRenderer(""); //$NON-NLS-1$
>         }
>-        // Use two rows, so that we have room for horisontal
>scrollbar, if the text is one long line. Fix for 40371
>-        // This is not an optimal solution, but makes it possible to
>see the line if it is long
>-        rend.setRows(2);
>-        rend.revalidate();
>-        if (!hasFocus && !isSelected) {
>-            rend.setBackground(JMeterColor.LAVENDER);
>+        if (hasFocus || isSelected) {
>+            rend.setBackground(Color.blue);
>+            rend.setForeground(Color.white);
>         }
>         if (table.getRowHeight(row) < getPreferredHeight()) {
>             table.setRowHeight(row, getPreferredHeight());
>         }
>-        return rend;
>+        JTextScrollPane scrollPane =
>JTextScrollPane.getInstance(rend);
>+        return scrollPane;
>+    }
>+
>+    /**
>+     * @param value initial value
>+     * @return {@link JSyntaxTextArea}
>+     */
>+    private JSyntaxTextArea createRenderer(String value) {
>+        JSyntaxTextArea textArea = JSyntaxTextArea.getInstance(2, 50);
>+        textArea.setLanguage("text"); //$NON-NLS-1$
>+        textArea.setInitialText(value.toString());

toString on a String? Looks strange to me.

Felix

>+        return textArea;
>     }
> 
>     public int getPreferredHeight() {
>
>Modified: jmeter/trunk/xdocs/changes.xml
>URL:
>http://svn.apache.org/viewvc/jmeter/trunk/xdocs/changes.xml?rev=1782268&r1=1782267&r2=1782268&view=diff
>==============================================================================
>--- jmeter/trunk/xdocs/changes.xml [utf-8] (original)
>+++ jmeter/trunk/xdocs/changes.xml [utf-8] Wed Feb  8 22:16:45 2017
>@@ -163,6 +163,7 @@ JMeter now requires Java 8. Ensure you u
><li><bug>58943</bug>Create a Better Think Time experience. Contributed
>by Ubik Load Pack (support at ubikloadpack.com)</li>
><li><bug>60602</bug>XPath Extractor : Add Match No. to allow extraction
>randomly, by index or all matches</li>
><li><bug>60710</bug>XPath Extractor : When content on which assertion
>applies is not XML, in View Results Tree the extractor is marked in Red
>and named SAXParseException. Contributed by Ubik Load Pack (support at
>ubikloadpack.com)</li>
>+    <li><bug>60712</bug>Response Assertion : Improve Renderer of
>Patterns</li>
> </ul>
> 
> <h3>Functions</h3>

Mime
View raw message