summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Conway <mikeconway@dhcp152-54-6-70.wireless.europa.renci.org>2011-06-24 14:03:26 (GMT)
committer Mike Conway <mikeconway@dhcp152-54-6-70.wireless.europa.renci.org>2011-06-24 14:03:26 (GMT)
commit8251904c0a8a24f186ffe0b41ade0d6a53537973 (patch)
tree9fdd22da278cae1050d512860275b68bb0bfe274
parent8b62d96432b5ec9bb6b820bdb68c6fb8bf5d1481 (diff)
downloadQCG-Data-8251904c0a8a24f186ffe0b41ade0d6a53537973.zip
QCG-Data-8251904c0a8a24f186ffe0b41ade0d6a53537973.tar.gz
QCG-Data-8251904c0a8a24f186ffe0b41ade0d6a53537973.tar.bz2
[#254] drag and drop, desktop to irods file should use irods parent as target
-rw-r--r--idrop-swing/release_notes.txt2
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/IRODSTreeTransferHandler.java13
2 files changed, 11 insertions, 4 deletions
diff --git a/idrop-swing/release_notes.txt b/idrop-swing/release_notes.txt
index 4d7f22a..715e578 100644
--- a/idrop-swing/release_notes.txt
+++ b/idrop-swing/release_notes.txt
@@ -6,4 +6,4 @@ work in progress -- Milestone 0.9.8
*[#308] irods tree does not refresh when deleting a directory
* [#61] delete local file multi-select
-
+*[#254] drag and drop, desktop to irods file should use irods parent as target
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/IRODSTreeTransferHandler.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/IRODSTreeTransferHandler.java
index 72cb51a..6f4bc67 100644
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/IRODSTreeTransferHandler.java
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/IRODSTreeTransferHandler.java
@@ -342,13 +342,20 @@ public class IRODSTreeTransferHandler extends TransferHandler {
}
// handle a drop from the local file system
- private void processDropOfFileList(Transferable transferable, IRODSNode parent) throws IdropRuntimeException {
+ private void processDropOfFileList(Transferable transferable, IRODSNode dropTargetNode) throws IdropRuntimeException {
log.info("process as drop of file list");
-
+
+ IRODSNode effectiveTargetNode;
+ if (dropTargetNode.isLeaf()) {
+ effectiveTargetNode = (IRODSNode) dropTargetNode.getParent();
+ } else {
+ effectiveTargetNode = dropTargetNode;
+ }
+
final String sourceResource = idropGui.getIrodsAccount().getDefaultStorageResource();
final List<File> sourceFiles;
- CollectionAndDataObjectListingEntry putTarget = (CollectionAndDataObjectListingEntry) parent.getUserObject();
+ CollectionAndDataObjectListingEntry putTarget = (CollectionAndDataObjectListingEntry) effectiveTargetNode.getUserObject();
final String targetIrodsFileAbsolutePath = putTarget.getPathOrName();
try {