Comments (5)
khammond25 (migrated from Bugzilla):
*** #759 has been marked as a duplicate of this bug. ***
from jmeter.
khammond25 (migrated from Bugzilla):
Created attachment patch.ArgumentsPanel.diff: Patch for ArgumentsPanel.java; file contains the diff
patch.ArgumentsPanel.diff
--- \jakarta-jmeter-cvs\jakarta-jmeter\src\org\apache\jmeter\config\gui\ArgumentsPanel.java Thu Jul 26 00:34:44 2001
+++ \jakarta-jmeter-nightly\2001.09.15\jakarta-jmeter\src\org\apache\jmeter\config\gui\ArgumentsPanel.java Thu Sep 20 13:32:52 2001
@@ -117,9 +117,14 @@
***********************************************************/
public void keyReleased(KeyEvent e)
{
- tableModel.setValueAt(table.getValueAt(table.getSelectedRow(), table.getSelectedColumn()),
- table.getSelectedRow(), table.getSelectedColumn());
- this.repaint();
+ /* Note sure why we have code here, so I commented it out. Seems to work fine. [khammond]
+ if (tableModel.getRowCount() > 0)
+ {
+ tableModel.setValueAt(table.getValueAt(table.getSelectedRow(), table.getSelectedColumn()),
+ table.getSelectedRow(), table.getSelectedColumn());
+ this.repaint();
+ }
+ */
}
/************************************************************
@@ -148,15 +153,67 @@
public void actionPerformed(ActionEvent e)
{
String action = e.getActionCommand();
+
if(action.equals("Delete"))
{
- tableModel.removeRow(table.getSelectedRow());
- tableModel.fireTableDataChanged();
+ if (tableModel.getRowCount() > 0)
+ {
+ // If a table cell is being edited, we must cancel the editing before
+ // deleting the row
+ if (table.isEditing())
+ {
+ TableCellEditor cellEditor = table.getCellEditor(table.getEditingRow(), table.getEditingColumn());
+ cellEditor.cancelCellEditing();
+ }
+
+ int rowSelected = table.getSelectedRow();
+
+ tableModel.removeRow(rowSelected);
+ tableModel.fireTableDataChanged();
+
+ // Disable the DELETE button if no rows remaining after delete
+ if (tableModel.getRowCount() == 0)
+ {
+ delete.setEnabled(false);
+ }
+
+ // Table still contains one or more rows, so highlight (select)
+ // the appropriate one.
+ else
+ {
+ int rowToSelect = rowSelected;
+
+ if (rowSelected >= tableModel.getRowCount())
+ {
+ rowToSelect = rowSelected - 1;
+ }
+
+ table.setRowSelectionInterval(rowToSelect, rowToSelect);
+ }
+ }
}
else if(action.equals("Add"))
{
+ // If a table cell is being edited, we should accept the current value
+ // and stop the editing before adding a new row.
+ if (table.isEditing())
+ {
+ TableCellEditor cellEditor = table.getCellEditor(table.getEditingRow(), table.getEditingColumn());
+ cellEditor.stopCellEditing();
+ }
+
tableModel.addNewRow();
tableModel.fireTableDataChanged();
+
+ // Enabled the DELETE button if it is currently disabled.
+ if (!delete.isEnabled())
+ {
+ delete.setEnabled(true);
+ }
+
+ // Highlight (select) the appropriate row.
+ int rowToSelect = tableModel.getRowCount() - 1;
+ table.setRowSelectionInterval(rowToSelect, rowToSelect);
}
}
@@ -178,13 +235,22 @@
scroller.setColumnHeaderView(table.getTableHeader());
this.add(scroller);
+
+ // ADD button
add = new JButton(JMeterUtils.getResString("add"));
+ add.setMnemonic('A');
add.setActionCommand("Add");
+ add.addActionListener(this);
+
+ // DELETE button
delete = new JButton(JMeterUtils.getResString("delete"));
+ delete.setEnabled(false); // disabled by default
+ delete.setMnemonic('D');
delete.setActionCommand("Delete");
- JPanel buttonPanel = new JPanel();
- add.addActionListener(this);
delete.addActionListener(this);
+
+ // Button Panel
+ JPanel buttonPanel = new JPanel();
buttonPanel.add(add);
buttonPanel.add(delete);
this.add(buttonPanel);
@@ -322,5 +388,4 @@
}
}
}
-
}
from jmeter.
khammond25 (migrated from Bugzilla):
The attachment contain a fix for this bug and a fix for #767. It also
contains the following new functionality:
- ADD and DELETE buttons behave more user-friendly. They now select a row
after the button is pressed. - ADD and DELETE buttons now have mnemonics. After creating the first row, you
can add/edit the remaining rows using just your keyboard (never have to move
your mouse pointer to the next row and click). - The DELETE button is set to disabled (grayed out) when there are no rows in
the table.
from jmeter.
Jordi Salvat i Alabart (migrated from Bugzilla):
Marking all bugs RESOLVED before JMeter 1.8's release date as VERIFIED.
Yes, it's pretty poor QA procedure, but there's bugs here lingering since JMeter
1.6, and we need to clean up a little.
from jmeter.
Jordi Salvat i Alabart (migrated from Bugzilla):
Bulk-closing all bugs RESOLVED before JMeter 1.8 release date.
from jmeter.
Related Issues (20)
- server.rmi.ssl.keystore.file property not working during test run in distributed mode
- Test
- According to RFC 2046 and RFC 7578, the request header of multipart/form-data should not include the charset. HOT 3
- Unable to generate HTM report in Jmeter HOT 2
- The default timeout period is added
- Recorder: Transaction Control
- [Listener > Graph Results] Throughput per seconds
- Error when uploading file using PUT method in jmeter 5.5 and 5.6(URGENT)
- kg.apc.jmeter.vizualizers.CorrectedResultCollector HOT 1
- how to debug in gui HOT 1
- Exception in building JMeter(Execution failed for task ':src:dist:runGui'.) HOT 3
- in building JMeter source meet EXCEPTION_STACK_OVERFLOW (Execution failed for task ':src:dist:runGui'.)) HOT 16
- OS process sampler cannot be executed in Macos
- Jmeter: JMSSampler could not able to get the actual response body message from ActiveMQ REPLY Queue
- Add a space between key and value after : in View Results Tree > Sampler result tab
- random function generate multiple value when access more than once HOT 8
- Command-line mode doesn't stop and keeps running tests repeatedly HOT 1
- Cookie Manager not working properly
- Unable to create sample labels dynamically
- JMS Publisher not updating values when jndi.properties file changes HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jmeter.