Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Drag and Drop with URLs
Drag and Drop with URLs [message #371876] Wed, 23 July 2003 00:03 Go to next message
Eclipse UserFriend
Originally posted by: tag.keyboardsamurais.de

I downloaded the code snippet at
http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/plat form-swt-home/snippits/snippet83.html
to get a first impression of how dnd looks like in SWT, but since I have
virtually no experience with dnd and I don't find any answer, I just
have to ask.

How would one accomplish the following task:
Drag a link that is displayed in a Browser (Win32 IE, or Mozilla that
is) onto a Window, drop it there and extract the ascii representation of
the URL. If I drop a Link into the Window of the Snipped that is
mentioned above, I get following results:

Allowed Operations are nullLink;
Data type is 49352 FileGroupDescriptor
Data type is 49353 FileGroupDescriptorW
Data type is 49351 FileContents
Data type is 49362 UniformResourceLocator

and following results for Mozilla:

Allowed Operations are nullCopy;Move;Link;
Data type is 13 CF_UNICODETEXT
Data type is 49352 FileGroupDescriptor
Data type is 49351 FileContents
Data type is 49362 UniformResourceLocator
Data type is 49629 text/x-moz-url-data
Data type is 49630 text/x-moz-url-desc
Data type is 49461 text/html
Data type is 49357 HTML Format
Data type is 13 CF_UNICODETEXT
Data type is 1 CF_TEXT

I figured, I could just extract some data from the DropTargetEvent
(49629 when using Mozilla and 49362 when using IE), but I do not even
know how to access it properly.

Any information about this issue would be highly appreciated.

Y.T.,
Toni
Re: Drag and Drop with URLs [message #371917 is a reply to message #371876] Wed, 23 July 2003 18:16 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: veronika_irvine.oti.com

You need to create your own data transfer type. For example, you could use
"UniformResourceLocator". The format of the data seems to be a null
terminated string.

See:
http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/plat form-swt-home/sn
ippits/snippet79.html

"Antonio Agudo" <tag@keyboardsamurais.de> wrote in message
news:bfkj60$dng$1@eclipse.org...
> I downloaded the code snippet at
>
http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/plat form-swt-home/sn
ippits/snippet83.html
> to get a first impression of how dnd looks like in SWT, but since I have
> virtually no experience with dnd and I don't find any answer, I just
> have to ask.
>
> How would one accomplish the following task:
> Drag a link that is displayed in a Browser (Win32 IE, or Mozilla that
> is) onto a Window, drop it there and extract the ascii representation of
> the URL. If I drop a Link into the Window of the Snipped that is
> mentioned above, I get following results:
>
> Allowed Operations are nullLink;
> Data type is 49352 FileGroupDescriptor
> Data type is 49353 FileGroupDescriptorW
> Data type is 49351 FileContents
> Data type is 49362 UniformResourceLocator
>
> and following results for Mozilla:
>
> Allowed Operations are nullCopy;Move;Link;
> Data type is 13 CF_UNICODETEXT
> Data type is 49352 FileGroupDescriptor
> Data type is 49351 FileContents
> Data type is 49362 UniformResourceLocator
> Data type is 49629 text/x-moz-url-data
> Data type is 49630 text/x-moz-url-desc
> Data type is 49461 text/html
> Data type is 49357 HTML Format
> Data type is 13 CF_UNICODETEXT
> Data type is 1 CF_TEXT
>
> I figured, I could just extract some data from the DropTargetEvent
> (49629 when using Mozilla and 49362 when using IE), but I do not even
> know how to access it properly.
>
> Any information about this issue would be highly appreciated.
>
> Y.T.,
> Toni
>
Re: Drag and Drop with URLs [message #371920 is a reply to message #371917] Wed, 23 July 2003 21:26 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: tag.keyboardsamurais.de

Thank you very much for this valuable information!
Now I have grasped the Idea of Transferables. However the given example
sheds light only on types that are customized, how exactly will I find
out how I represent a data type that is predefined?

I mean in the example there is a class that holds some variables, but I
do not even know what data the url object can hold.

Y.T.,
Toni
Re: Drag and Drop with URLs [message #371953 is a reply to message #371920] Thu, 24 July 2003 19:56 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: veronika_irvine.oti.com

Supporting a OS data transfer type is not trivial. Predefined transfer
types are platform specific and require that you know something about the
data format for the platform. You need to look at MDSN for windows or the
GTK documentation or the Mac on line Carbon documentation. Sometimes it is
as simple as a C String that is null terminated but other types it may be an
opaque data struct that requires you to make OS calls to find out specific
values (for example see FileTransfer on Windows).

I am writing an artile on DND and hope to get into this in a bit more detail
but the bottom line is you need to investigate how the OS defines the data
type before you can interact with it.

"Antonio Agudo" <tag@keyboardsamurais.de> wrote in message
news:bfmucf$64t$1@eclipse.org...
> Thank you very much for this valuable information!
> Now I have grasped the Idea of Transferables. However the given example
> sheds light only on types that are customized, how exactly will I find
> out how I represent a data type that is predefined?
>
> I mean in the example there is a class that holds some variables, but I
> do not even know what data the url object can hold.
>
> Y.T.,
> Toni
>
Re: Drag and Drop with URLs [message #371959 is a reply to message #371953] Thu, 24 July 2003 21:42 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: tag.keyboardsamurais.de

You have just confirmed my worst expectations ;)
So I have to dig deep into the Memory structure of my Object. This
really does not sound trivial :(

But given that I expect a URL to be a null terminated String, how would
I implement a proper nativetojava method, and more importantly - where
and from what Object will this nativetojava method be called?

I am kind of hanging between the gap of JVM and OS and don't know how
exactly the transfer would take place. I did not even find a small SWT
program I could reengineer to get to the interesting part of that.

P.S.: If you complete your article on the subject, please let me know. I
would be most interested!

Y.T.,
Toni
Re: Drag and Drop with URLs [message #393361 is a reply to message #371953] Sat, 29 November 2003 20:48 Go to previous messageGo to next message
Rene Leonhardt is currently offline Rene LeonhardtFriend
Messages: 1
Registered: July 2009
Junior Member
Hello,

has someone made a code snippet, at least for Windows?

Or is the article finished?

Regards,
René

Veronika Irvine wrote:

> Supporting a OS data transfer type is not trivial. Predefined transfer
> types are platform specific and require that you know something about the
> data format for the platform. You need to look at MDSN for windows or the
> GTK documentation or the Mac on line Carbon documentation. Sometimes it is
> as simple as a C String that is null terminated but other types it may be an
> opaque data struct that requires you to make OS calls to find out specific
> values (for example see FileTransfer on Windows).
>
> I am writing an artile on DND and hope to get into this in a bit more detail
> but the bottom line is you need to investigate how the OS defines the data
> type before you can interact with it.
>
> "Antonio Agudo" <tag@keyboardsamurais.de> wrote in message
> news:bfmucf$64t$1@eclipse.org...
>
>>Thank you very much for this valuable information!
>>Now I have grasped the Idea of Transferables. However the given example
>>sheds light only on types that are customized, how exactly will I find
>>out how I represent a data type that is predefined?
>>
>>I mean in the example there is a class that holds some variables, but I
>>do not even know what data the url object can hold.
>>
>>Y.T.,
>>Toni
Re: Drag and Drop with URLs [message #440995 is a reply to message #393361] Mon, 09 August 2004 16:10 Go to previous message
rich boakes is currently offline rich boakesFriend
Messages: 76
Registered: July 2009
Member
Rene Leonhardt wrote:

> Hello,
>
> has someone made a code snippet, at least for Windows?
>
> Or is the article finished?

I arrived here with the same question exactly, and having
read Veronika's articles I'm wondering if anyone work
through this already?

Thanks
Rich
/me braces for the tumbleweed to roll by
Previous Topic:What's Required for an ActiveX control to work with SWT OLE?
Next Topic:Restrict Update Site
Goto Forum:
  


Current Time: Fri Apr 26 20:13:18 GMT 2024

Powered by FUDForum. Page generated in 0.03866 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top