summaryrefslogtreecommitdiffstats
path: root/idrop-swing
diff options
context:
space:
mode:
authorLisa Stillwell <lisa@renci.org>2013-01-15 22:44:55 (GMT)
committer Lisa Stillwell <lisa@renci.org>2013-01-15 22:44:55 (GMT)
commit4b1b951f536055b500718065fa6578edc60c5ad6 (patch)
treeafb6c5283a59801c2bc4e5c4cb311610f175d70a /idrop-swing
parentbdfbc7c8edf3458a044a2f6987c0b0f47e97800d (diff)
downloadQCG-Data-4b1b951f536055b500718065fa6578edc60c5ad6.zip
QCG-Data-4b1b951f536055b500718065fa6578edc60c5ad6.tar.gz
QCG-Data-4b1b951f536055b500718065fa6578edc60c5ad6.tar.bz2
[#983] fixed IRODS Finder dialog to be able to retiurn multiple selections
Diffstat (limited to 'idrop-swing')
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/DownloadDialog.java10
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/finder/IRODSFinderDialog.java28
2 files changed, 33 insertions, 5 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 e56839a..045e3d6 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
@@ -470,10 +470,12 @@ public class DownloadDialog extends javax.swing.JDialog implements ListSelection
(int)this.getLocation().getX(), (int)this.getLocation().getY());
irodsFinder.setVisible(true);
- String selectedPath = irodsFinder.getSelectedAbsolutePath();
- if (selectedPath != null) {
- DefaultTableModel model = (DefaultTableModel) tblFilesToDownload.getModel();
- model.addRow(new Object[] {selectedPath});
+ List<String> selectedPaths = irodsFinder.getSelectedAbsolutePaths();
+ for (String selectedPath: selectedPaths) {
+ if (selectedPath != null) {
+ DefaultTableModel model = (DefaultTableModel) tblFilesToDownload.getModel();
+ model.addRow(new Object[] {selectedPath});
+ }
}
setDownloadButtonState();
}//GEN-LAST:event_btnAddDownloadFileActionPerformed
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/finder/IRODSFinderDialog.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/finder/IRODSFinderDialog.java
index 158b7ee..9ca92aa 100644
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/finder/IRODSFinderDialog.java
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/finder/IRODSFinderDialog.java
@@ -10,6 +10,8 @@
*/
package org.irods.jargon.idrop.finder;
+import java.util.ArrayList;
+import java.util.List;
import javax.swing.ListSelectionModel;
import org.irods.jargon.core.query.CollectionAndDataObjectListingEntry;
import org.irods.jargon.idrop.desktop.systraygui.IDROPCore;
@@ -36,10 +38,15 @@ public class IRODSFinderDialog extends javax.swing.JDialog {
private final IDROPCore idropCore;
private String selectedAbsolutePath = null;
+ private List<String> selectedAbsolutePaths = null;
public String getSelectedAbsolutePath() {
return selectedAbsolutePath;
}
+
+ public List<String> getSelectedAbsolutePaths() {
+ return this.selectedAbsolutePaths;
+ }
public IDROPCore getIdropCore() {
return idropCore;
@@ -139,6 +146,23 @@ public class IRODSFinderDialog extends javax.swing.JDialog {
}
});
}
+
+ private List<String> findSelectedPaths(ListSelectionModel selectionModel) {
+ List<String> paths = new ArrayList();
+
+ for(int idx=selectionModel.getMinSelectionIndex(); idx<=selectionModel.getMaxSelectionIndex(); idx++) {
+
+ if (selectionModel.isSelectedIndex(idx)) {
+ IRODSFinderOutlineModel irodsFileSystemModel = (IRODSFinderOutlineModel) irodsTree.getModel();
+ IRODSNode selectedNode = (IRODSNode) irodsFileSystemModel.getValueAt(idx, 0);
+ log.info("selected node:{}", selectedNode);
+ CollectionAndDataObjectListingEntry entry = (CollectionAndDataObjectListingEntry) selectedNode.getUserObject();
+ paths.add(entry.getFormattedAbsolutePath());
+ }
+ }
+
+ return paths;
+ }
/** This method is called from within the constructor to
* initialize the form.
@@ -259,8 +283,10 @@ public class IRODSFinderDialog extends javax.swing.JDialog {
return;
}
}
-
+
this.selectedAbsolutePath = entry.getFormattedAbsolutePath();
+
+ this.selectedAbsolutePaths = findSelectedPaths(selectionModel);
this.setVisible(false);
enableButtonSelectFolder(true);