summaryrefslogtreecommitdiffstats
path: root/idrop-swing
diff options
context:
space:
mode:
authorLisa Stillwell <lisa@renci.org>2013-01-15 21:02:25 (GMT)
committer Lisa Stillwell <lisa@renci.org>2013-01-15 21:02:25 (GMT)
commit09a7473d581ec710b2debeeb1064445015bd08e3 (patch)
tree7ca7bb9e30a19f6c1214378df82e42eda4b51253 /idrop-swing
parent139211b5c542c0a2a76b56a08aa4a753c0347b43 (diff)
downloadQCG-Data-09a7473d581ec710b2debeeb1064445015bd08e3.zip
QCG-Data-09a7473d581ec710b2debeeb1064445015bd08e3.tar.gz
QCG-Data-09a7473d581ec710b2debeeb1064445015bd08e3.tar.bz2
[#983] fix upload and download dialogs so minus button can delete multiple files in table
Diffstat (limited to 'idrop-swing')
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/DownloadDialog.java16
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/UploadDialog.java14
2 files changed, 21 insertions, 9 deletions
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/DownloadDialog.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/DownloadDialog.java
index 971091f..e56839a 100644
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/DownloadDialog.java
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/DownloadDialog.java
@@ -480,11 +480,17 @@ public class DownloadDialog extends javax.swing.JDialog implements ListSelection
private void btnDeleteDownloadFileActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnDeleteDownloadFileActionPerformed
- int selectedRow = tblFilesToDownload.getSelectedRow();
-
- if (selectedRow >= 0) {
- DefaultTableModel model = (DefaultTableModel) tblFilesToDownload.getModel();
- model.removeRow(selectedRow);
+ int[] selectedRows = tblFilesToDownload.getSelectedRows();
+ int numRowsSelected = selectedRows.length;
+
+ // have to remove rows in reverse
+ for(int i=numRowsSelected-1; i>=0; i--) {
+ //for (int selectedRow: selectedRows) {
+ int selectedRow = selectedRows[i];
+ if (selectedRow >= 0) {
+ DefaultTableModel model = (DefaultTableModel) tblFilesToDownload.getModel();
+ model.removeRow(selectedRow);
+ }
}
}//GEN-LAST:event_btnDeleteDownloadFileActionPerformed
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/UploadDialog.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/UploadDialog.java
index d9ab04f..2762455 100644
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/UploadDialog.java
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/UploadDialog.java
@@ -529,11 +529,17 @@ public class UploadDialog extends javax.swing.JDialog implements ListSelectionLi
private void btnDeleteUploadFileActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnDeleteUploadFileActionPerformed
- int selectedRow = tblFilesToUpload.getSelectedRow();
+ int[] selectedRows = tblFilesToUpload.getSelectedRows();
+ int numRowsSelected = selectedRows.length;
- if (selectedRow >= 0) {
- DefaultTableModel model = (DefaultTableModel) tblFilesToUpload.getModel();
- model.removeRow(selectedRow);
+ // have to remove rows in reverse
+ for(int i=numRowsSelected-1; i>=0; i--) {
+ //for (int selectedRow: selectedRows) {
+ int selectedRow = selectedRows[i];
+ if (selectedRow >= 0) {
+ DefaultTableModel model = (DefaultTableModel) tblFilesToUpload.getModel();
+ model.removeRow(selectedRow);
+ }
}
}//GEN-LAST:event_btnDeleteUploadFileActionPerformed