jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmoua...@apache.org
Subject svn commit: r1724320 - in /jmeter/trunk: src/core/org/apache/jmeter/images/ src/core/org/apache/jmeter/resources/ src/protocol/http/org/apache/jmeter/protocol/http/gui/ xdocs/
Date Tue, 12 Jan 2016 21:02:59 GMT
Author: pmouawad
Date: Tue Jan 12 21:02:59 2016
New Revision: 1724320

URL: http://svn.apache.org/viewvc?rev=1724320&view=rev
Log:
Bug 58843 - Improve the usable space in the http sampler gui 
#resolve #68
Bugzilla Id: 58843

Added:
    jmeter/trunk/src/core/org/apache/jmeter/images/collapse-close.png   (with props)
    jmeter/trunk/src/core/org/apache/jmeter/images/collapse-open.png   (with props)
Modified:
    jmeter/trunk/src/core/org/apache/jmeter/resources/messages.properties
    jmeter/trunk/src/core/org/apache/jmeter/resources/messages_fr.properties
    jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/gui/HTTPFileArgsPanel.java
    jmeter/trunk/xdocs/changes.xml

Added: jmeter/trunk/src/core/org/apache/jmeter/images/collapse-close.png
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/images/collapse-close.png?rev=1724320&view=auto
==============================================================================
Binary file - no diff available.

Propchange: jmeter/trunk/src/core/org/apache/jmeter/images/collapse-close.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: jmeter/trunk/src/core/org/apache/jmeter/images/collapse-open.png
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/images/collapse-open.png?rev=1724320&view=auto
==============================================================================
Binary file - no diff available.

Propchange: jmeter/trunk/src/core/org/apache/jmeter/images/collapse-open.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Modified: jmeter/trunk/src/core/org/apache/jmeter/resources/messages.properties
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/resources/messages.properties?rev=1724320&r1=1724319&r2=1724320&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/resources/messages.properties (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/resources/messages.properties Tue Jan 12 21:02:59
2016
@@ -970,9 +970,9 @@ second=second
 secure=Secure
 send_file=Send Files With the Request\:
 send_file_browse=Browse...
-send_file_filename_label=File Path\:
-send_file_mime_label=MIME Type\:
-send_file_param_name_label=Parameter Name\:
+send_file_filename_label=File Path
+send_file_mime_label=MIME Type
+send_file_param_name_label=Parameter Name
 server=Server Name or IP\:
 servername=Servername \:
 session_argument_name=Session Argument Name
@@ -1336,3 +1336,5 @@ xpath_tidy_show_warnings=Show warnings
 you_must_enter_a_valid_number=You must enter a valid number
 zh_cn=Chinese (Simplified)
 zh_tw=Chinese (Traditional)
+
+collapse_tooltip=Click to open / collapse

Modified: jmeter/trunk/src/core/org/apache/jmeter/resources/messages_fr.properties
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/resources/messages_fr.properties?rev=1724320&r1=1724319&r2=1724320&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/resources/messages_fr.properties (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/resources/messages_fr.properties Tue Jan 12 21:02:59
2016
@@ -955,9 +955,9 @@ second=seconde
 secure=S\u00E9curis\u00E9 \:
 send_file=Envoyer un fichier avec la requ\u00EAte \:
 send_file_browse=Parcourir...
-send_file_filename_label=Chemin du fichier \: 
-send_file_mime_label=Type MIME \:
-send_file_param_name_label=Nom du param\u00E8tre \:
+send_file_filename_label=Chemin du fichier
+send_file_mime_label=Type MIME
+send_file_param_name_label=Nom du param\u00E8tre
 server=Nom ou IP du serveur \:
 servername=Nom du serveur \:
 session_argument_name=Nom des arguments de la session

Modified: jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/gui/HTTPFileArgsPanel.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/gui/HTTPFileArgsPanel.java?rev=1724320&r1=1724319&r2=1724320&view=diff
==============================================================================
--- jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/gui/HTTPFileArgsPanel.java
(original)
+++ jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/gui/HTTPFileArgsPanel.java
Tue Jan 12 21:02:59 2016
@@ -20,14 +20,18 @@ package org.apache.jmeter.protocol.http.
 
 import java.awt.BorderLayout;
 import java.awt.Component;
+import java.awt.Cursor;
 import java.awt.FlowLayout;
 import java.awt.event.ActionEvent;
 import java.awt.event.ActionListener;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
 import java.io.File;
 import java.util.Iterator;
 
 import javax.swing.BorderFactory;
 import javax.swing.Box;
+import javax.swing.ImageIcon;
 import javax.swing.JButton;
 import javax.swing.JFileChooser;
 import javax.swing.JLabel;
@@ -35,6 +39,7 @@ import javax.swing.JPanel;
 import javax.swing.JScrollPane;
 import javax.swing.JTable;
 import javax.swing.ListSelectionModel;
+import javax.swing.SwingConstants;
 import javax.swing.table.TableCellEditor;
 
 import org.apache.jmeter.gui.util.FileDialoger;
@@ -77,7 +82,7 @@ public class HTTPFileArgsPanel extends J
 
     /** A button for removing files from the table. */
     private JButton delete;
-
+    
     /** Command for adding a row to the table. */
     private static final String ADD = "add"; // $NON-NLS-1$
 
@@ -107,8 +112,35 @@ public class HTTPFileArgsPanel extends J
      *  the title for the component.
      */
     public HTTPFileArgsPanel(String label) {
-        tableLabel = new JLabel(label);
+        ImageIcon image = JMeterUtils.getImage("collapse-open.png");
+        tableLabel = new JLabel(label, image, SwingConstants.LEFT);
         init();
+        tableLabel.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
+        tableLabel.setToolTipText(JMeterUtils.getResString("collapse_tooltip"));
+        tableLabel.addMouseListener(new MouseAdapter() {
+            @Override
+            public void mouseClicked(MouseEvent e) {
+                hideFileArgsMainPanel(null);
+            }
+        });
+    }
+    
+    private void hideFileArgsMainPanel(Boolean force) {
+        BorderLayout bl = (BorderLayout) this.getLayout();
+        
+        boolean result = false;
+        String[] borders = {BorderLayout.CENTER, BorderLayout.WEST, BorderLayout.SOUTH};
+        for (String border : borders) {
+            Component tableComponent = bl.getLayoutComponent(border);
+            if(tableComponent != null) {
+                boolean visible = force!=null?force.booleanValue():!tableComponent.isVisible();
+                tableComponent.setVisible(visible);
+                
+                result |= visible;
+            }
+        }
+        
+        tableLabel.setIcon(result?JMeterUtils.getImage("collapse-open.png"):JMeterUtils.getImage("collapse-close.png"));
     }
 
     /**
@@ -198,9 +230,11 @@ public class HTTPFileArgsPanel extends J
         if (tableModel.getRowCount() == 0) {
             browse.setEnabled(false);
             delete.setEnabled(false);
+            hideFileArgsMainPanel(Boolean.FALSE);
         } else {
             browse.setEnabled(true);
             delete.setEnabled(true);
+            hideFileArgsMainPanel(Boolean.TRUE);
         }
     }
 
@@ -344,7 +378,7 @@ public class HTTPFileArgsPanel extends J
      * @return a panel containing the title label
      */
     private Component makeLabelPanel() {
-        JPanel labelPanel = new JPanel(new FlowLayout(FlowLayout.CENTER));
+        JPanel labelPanel = new JPanel(new FlowLayout(FlowLayout.LEFT));
         labelPanel.add(tableLabel);
         return labelPanel;
     }

Modified: jmeter/trunk/xdocs/changes.xml
URL: http://svn.apache.org/viewvc/jmeter/trunk/xdocs/changes.xml?rev=1724320&r1=1724319&r2=1724320&view=diff
==============================================================================
--- jmeter/trunk/xdocs/changes.xml (original)
+++ jmeter/trunk/xdocs/changes.xml Tue Jan 12 21:02:59 2016
@@ -96,6 +96,7 @@ Summary
     <li><bug>57696</bug>HTTP Request : Improve responseMessage when resource
download fails. Contributed by Ubik Load Pack (support at ubikloadpack.com)</li>
     <li><bug>57995</bug>Use FileServer for HTTP Request files. Implemented
by Andrey Pokhilko (andrey at blazemeter.com) and contributed by BlazeMeter Ltd.</li>
     <li><bug>58811</bug>When pasting arguments between http samplers the
column "Encode" and "Include Equals" are lost. Contributed by Benoit Wiart (benoit dot wiart
at gmail.com)</li>
+    <li><bug>58843</bug>Improve the usable space in the HTTP sampler GUI.
Contributed by Benoit Wiart (benoit dot wiart at gmail.com)</li>
 </ul>
 
 <h3>Other samplers</h3>



Mime
View raw message