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 and Drop: get data on enter



thanks for responding. The list of dragged drag flavors are not
identical on different OS's/browsers, but the URL type is always
first. On Mac/Safari, the URL type exists as first available drag
flavor, but during the drag you cannot access it. You cannot
access any other drag flavor, either - they all throw this exception.

I'm baffled that a Google search on this exception does not
produce any results. Seems to me that getting the drag contents
while dragging is something you'd regularly do. Especially on OSX...

Thanks,
Florian


On 10/15/2007 12:11 AM, Timothy Wall wrote:
> Are the drag flavors for the dragged URL the same in all cases?  I would
> expect that the different browsers might provide different flavors,
> although all should at least provide the basic text flavor.
> 
> On Oct 14, 2007, at 10:40 AM, Florian Bomers wrote:
> 
>> Hi,
>>
>> when a user drags a URL from the browser into my applet, I need
>> to know the dragged URL already during the drag (e.g. in order to
>> decide if it can be accepted).
>>
>> On Windows, I can just query the Transferable in the dragEnter()
>> method, but the same throws an exception on OSX (see below).
>>
>> Try for yourself (with source):
>> http://www.12fb.com/florian/dndtest/
>>
>> Btw, on debian/linux/gnome I don't get /any/ d'n'd events.
>>
>> Thanks for any hints.
>>
>> Florian
>>
>> PS: the full exception trace:
>>
>> java.awt.dnd.InvalidDnDOperationException: no protocol:
>> Unsupported type
>>     at
>> sun.awt.dnd.SunDropTargetContextPeer.getTransferData(SunDropTargetContextPeer.java:235)
>>
>>     at
>> sun.awt.datatransfer.TransferableProxy.getTransferData(TransferableProxy.java:56)
>>
>>     at
>> java.awt.dnd.DropTargetContext$TransferableProxy.getTransferData(DropTargetContext.java:359)
>>
>>     at URLDropTargetDemo$DropPanel.getData(URLDropTargetDemo.java:56)
>>     at URLDropTargetDemo$DropPanel.dragEnter(URLDropTargetDemo.java:82)
>>     at java.awt.dnd.DropTarget.dragEnter(DropTarget.java:337)
>>     at
>> sun.awt.dnd.SunDropTargetContextPeer.processEnterMessage(SunDropTargetContextPeer.java:295)
>>
>>     at
>> sun.awt.dnd.SunDropTargetContextPeer.access$500(SunDropTargetContextPeer.java:53)
>>
>>     at
>> sun.awt.dnd.SunDropTargetContextPeer$EventDispatcher.dispatchEnterEvent(SunDropTargetContextPeer.java:759)
>>
>>     at
>> sun.awt.dnd.SunDropTargetContextPeer$EventDispatcher.dispatchEvent(SunDropTargetContextPeer.java:727)
>>
>>     at
>> sun.awt.dnd.SunDropTargetEvent.dispatch(SunDropTargetEvent.java:29)
>>     at java.awt.Component.dispatchEventImpl(Component.java:3892)
>>     at java.awt.Container.dispatchEventImpl(Container.java:2068)
>>     at java.awt.Component.dispatchEvent(Component.java:3869)
>>     at
>> java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4256)
>>     at
>> java.awt.LightweightDispatcher.trackMouseEnterExit(Container.java:4061)
>>     at
>> java.awt.LightweightDispatcher.processDropTargetEvent(Container.java:3999)
>>
>>     at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3861)
>>     at java.awt.Container.dispatchEventImpl(Container.java:2054)
>>     at java.awt.Component.dispatchEvent(Component.java:3869)
>>     at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
>>     at
>> java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:269)
>>
>>     at
>> java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:190)
>>
>>     at
>> java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:184)
>>     at
>> java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:176)
>>     at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
>>
>>
>>
>> -- 
>> Florian Bomers
>> Bome Software
>>
>> -------------------------------------------------------
>> Music Software, Development Tools:  http://www.bome.com
>> Java Sound extensions, plugins: http://www.tritonus.org
>> The Java Sound Resources:    http://www.jsresources.org
>> -------------------------------------------------------
>> Please quote this email in your reply. Thanks!
>>  _______________________________________________
>> Do not post admin requests to the list. They will be ignored.
>> Java-dev mailing list      (email@hidden)
>> Help/Unsubscribe/Update your Subscription:
>> http://lists.apple.com/mailman/options/java-dev/email@hidden
>>
>> This email sent to email@hidden
> 
> Timothy Wall
> http://abbot.sf.net
> 
> 
> 
> 

-- 
Florian Bomers
Bome Software

-------------------------------------------------------
Music Software, Development Tools:  http://www.bome.com
Java Sound extensions, plugins: http://www.tritonus.org
The Java Sound Resources:    http://www.jsresources.org
-------------------------------------------------------
Please quote this email in your reply. Thanks!
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden

This email sent to email@hidden

References: 
 >Drag and Drop: get data on enter (From: Florian Bomers <email@hidden>)
 >Re: Drag and Drop: get data on enter (From: Timothy Wall <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.