You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jmeter.apache.org by pm...@apache.org on 2017/02/21 19:48:08 UTC

svn commit: r1783924 - in /jmeter/trunk: src/protocol/http/org/apache/jmeter/protocol/http/proxy/gui/ProxyControlGui.java xdocs/changes.xml

Author: pmouawad
Date: Tue Feb 21 19:48:08 2017
New Revision: 1783924

URL: http://svn.apache.org/viewvc?rev=1783924&view=rev
Log:
Bug 60711 - Improve Delete button behaviour for Assertions / Header Manager / User Parameters GUIs
Bugzilla Id: 60711

Modified:
    jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/proxy/gui/ProxyControlGui.java
    jmeter/trunk/xdocs/changes.xml

Modified: jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/proxy/gui/ProxyControlGui.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/proxy/gui/ProxyControlGui.java?rev=1783924&r1=1783923&r2=1783924&view=diff
==============================================================================
--- jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/proxy/gui/ProxyControlGui.java (original)
+++ jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/proxy/gui/ProxyControlGui.java Tue Feb 21 19:48:08 2017
@@ -363,7 +363,6 @@ public class ProxyControlGui extends Log
     /** {@inheritDoc} */
     @Override
     public void itemStateChanged(ItemEvent e) {
-        // System.err.println(e.paramString());
         enableRestart();
     }
 
@@ -401,13 +400,9 @@ public class ProxyControlGui extends Log
             includeModel.fireTableDataChanged();
             enableRestart();
         } else if (command.equals(DELETE_EXCLUDE)) {
-            excludeModel.removeRow(excludeTable.getSelectedRow());
-            excludeModel.fireTableDataChanged();
-            enableRestart();
+            deleteRowFromTable(excludeModel, excludeTable);
         } else if (command.equals(DELETE_INCLUDE)) {
-            includeModel.removeRow(includeTable.getSelectedRow());
-            includeModel.fireTableDataChanged();
-            enableRestart();
+            deleteRowFromTable(includeModel, includeTable);
         } else if (command.equals(CHANGE_TARGET)) {
             log.debug("Change target " + targetNodes.getSelectedItem());
             log.debug("In model " + model);
@@ -430,6 +425,34 @@ public class ProxyControlGui extends Log
     }
 
     /**
+     * Delete row from table, select one if possible and enable restart button 
+     * @param tableModel {@link PowerTableModel} 
+     * @param table {@link JTable}
+     * 
+     */
+    private void deleteRowFromTable(PowerTableModel tableModel, JTable table) {
+        int selectedRow = table.getSelectedRow();
+        if(selectedRow >= 0) {
+            tableModel.removeRow(table.getSelectedRow());                
+        } else {
+            if(table.getRowCount()>0) {
+                tableModel.removeRow(0);
+            }
+        }
+        
+        tableModel.fireTableDataChanged();
+        if(table.getRowCount()>0) {
+            if(selectedRow == -1) {
+                table.setRowSelectionInterval(0, 0);
+            } else {
+                int rowToSelect = selectedRow>0 ? selectedRow-1:0;
+                table.setRowSelectionInterval(rowToSelect, rowToSelect);
+            }
+        }
+        enableRestart();
+    }
+
+    /**
      * Add suggested excludes to exclude table
      * @param table {@link JTable}
      */

Modified: jmeter/trunk/xdocs/changes.xml
URL: http://svn.apache.org/viewvc/jmeter/trunk/xdocs/changes.xml?rev=1783924&r1=1783923&r2=1783924&view=diff
==============================================================================
--- jmeter/trunk/xdocs/changes.xml [utf-8] (original)
+++ jmeter/trunk/xdocs/changes.xml [utf-8] Tue Feb 21 19:48:08 2017
@@ -193,7 +193,7 @@ JMeter now requires Java 8. Ensure you u
     <li><bug>54525</bug>Search Feature : Enhance it with ability to replace</li>
     <li><bug>60530</bug>Add API to create JMeter threads while test is running. Based on a contribution by Logan Mauzaize (logan.mauzaize at gmail.com) and Maxime Chassagneux (maxime.chassagneux at gmail.com).</li>
     <li><bug>60514</bug>Ability to apply a naming convention on Children of a Transaction Controller. Contributed by Ubik Load Pack (support at ubikloadpack.com)</li>
-    <li><bug>60711</bug>Improve Delete button behaviour for Assertions / Header Manager / User Parameters GUIs</li>
+    <li><bug>60711</bug>Improve Delete button behaviour for Assertions / Header Manager / User Parameters GUIs / Exclude, Include in HTTP(S) Test Script Recorder</li>
     <li><bug>60593</bug>Switch to G1 GC algorithm</li>
     <li><bug>60595</bug>Add a SplashScreen at the start of JMeter GUI. Contributed by Maxime Chassagneux (maxime.chassagneux at gmail.com).</li>
     <li><bug>55258</bug>Drop "Close" icon from toolbar and add "New" to menu. Partly based on contribution from Sanduni Kanishka (https://github.com/SanduniKanishka)</li>