Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Drag & Drop both ways



on 11/17/02 4:11 PM, Rolf Howarth at email@hidden wrote:

> I'm just adding drag and drop of files between my app and the
> desktop, in both directions. It mostly works, even with a customised
> drag image, apart from two issues:
>
> 1. I must be missing something obvious in the API but how do I stop
> dragging files onto myself?? If I initiate a drag inside my window
> but then cancel it by releasing the button without leaving the window
> I still receive an incoming drag as if I'd dragged the file in from
> the Finder!

In this case your dropTarget's dragEnter() method shouldn't accept the drag
if dragSource == dropTarget. Now, I don9t think you can get at the
dragSource from the DropTargetDragEvent (the parameter to dragEnter()). But
you could use DragSourceListener to keep some state when it does dragging
and check this state in your component's dragEnter().

> 2. When receiving multiple files from the Finder I get a
> java.util.List containing File objects. However, when I try to send
> multiple files the same way it's ignored. I can only ever send a
> single file, using a serialised java.io.File (as opposed to a
> java.util.List) in my Transferable.
>
> Any ideas? This is 1.3.1 under 10.2.2 by the way.

In all likeliness just a bug, and one that's not very likely to get fixed on
1.3.1. It would be worth trying if 1.4.1 will work for you - if not we'll
jump on it.

-Vladimir
_______________________________________________
java-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/java-dev
Be sure to read the FAQ http://developer.apple.com/java/faq/ before posting
Do not post admin requests to the list. They will be ignored.

References: 
 >Drag & Drop both ways (From: Rolf Howarth <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.