Drag and Drop with URLs [message #371876] |
Wed, 23 July 2003 00:03 |
Eclipse User |
|
|
|
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 |
Eclipse User |
|
|
|
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 |
Eclipse User |
|
|
|
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 |
Eclipse User |
|
|
|
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 |
Eclipse User |
|
|
|
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
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03866 seconds