Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Albireo » Re: Drag and drop and cut, copy, paste between awt / swing and swt.
Re: Drag and drop and cut, copy, paste between awt / swing and swt. [message #10952] Tue, 28 April 2009 15:07 Go to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
Maybe asking the albireo guys?

Tom

Grant Gayed schrieb:
> Hi Greg,
>
> I've asked someone here about this, and though we've never tried this, the
> belief is that it should be possible. On the swt side you subclass
> ByteArrayTransfer, and on the awt/swing side you have a custom data flavor.
> The part that's less clear (though may be trivial to someone that uses
> awt/string reguarly) is how to specify the data type name on the awt/swing
> side, because the awt/swing DataFlavors are keyed by mimeType, which I think
> != the data type name on the swt side. Looking at the javadoc pages,
> SystemFlavorMap looks like it could be useful for doing this mapping.
>
> Sorry if this answer isn't definitive enough, I was hoping that someone else
> had more concrete experience with this (the awt/swing side in particular).
> I plan to investigate this when I have more time and will post an example
> snippet if successful, but for the next while we're winding down the eclipse
> 3.5 work, so I'm not sure when this will be. (If anyone else has an example
> of this then please submit it!).
>
> Grant
>
>
> "Greg Pirsig" <greg.pirsig@gmail.com> wrote in message
> news:80422c4a99c27545a8814a26dd94a875$1@www.eclipse.org...
>> Greetings all!
>>
>> My Project Team and I are evaluating different Rich Client Platforms
>> that we can use with out next integration project. I don't need
>> anything too fancy, but I will need to incorporate some existing swing
>> controls (NASA's World Wind etc) and will need to support cut, copy,
>> paste and drag and drop of custom objects between awt / swing and swt.
>> After reading ali's harrowing journey that seemed to end in defeat
>> (search for "Drag and drop from SWT to Swing with a custom
>> ByteArrayTransfer"), I�d like to clarify if this is a reasonable
>> expectation. Does the Eclipse rcp support custom transfer types between
>> swt and awt / swing? Does it work? Has anyone gotten this to work or
>> should I just stick to swing?
>>
>> Thanks
>>
>> Greg Pirsig.
>>
>> P.S. I've already added this issue to the RCP newsgroup, but without any
>> luck so far. I hope no one minds me adding it here too in an attempt to
>> seek out anyone who can help... also please let me know if there is a
>> better place or another website that I should be asking such questions?
>>
>
>
Re: Drag and drop and cut, copy, paste between awt / swing and swt. [message #10963 is a reply to message #10952] Tue, 05 May 2009 01:34 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: stephan.nagy.gmail.com

While I don't have a snippet or example I can post, I can say we have
done this using both FileTransfer and ByteArrayTransfer so it is possible.

Tom Schindl wrote:
> Maybe asking the albireo guys?
>
> Tom
>
> Grant Gayed schrieb:
>> Hi Greg,
>>
>> I've asked someone here about this, and though we've never tried this, the
>> belief is that it should be possible. On the swt side you subclass
>> ByteArrayTransfer, and on the awt/swing side you have a custom data flavor.
>> The part that's less clear (though may be trivial to someone that uses
>> awt/string reguarly) is how to specify the data type name on the awt/swing
>> side, because the awt/swing DataFlavors are keyed by mimeType, which I think
>> != the data type name on the swt side. Looking at the javadoc pages,
>> SystemFlavorMap looks like it could be useful for doing this mapping.
>>
>> Sorry if this answer isn't definitive enough, I was hoping that someone else
>> had more concrete experience with this (the awt/swing side in particular).
>> I plan to investigate this when I have more time and will post an example
>> snippet if successful, but for the next while we're winding down the eclipse
>> 3.5 work, so I'm not sure when this will be. (If anyone else has an example
>> of this then please submit it!).
>>
>> Grant
>>
>>
>> "Greg Pirsig" <greg.pirsig@gmail.com> wrote in message
>> news:80422c4a99c27545a8814a26dd94a875$1@www.eclipse.org...
>>> Greetings all!
>>>
>>> My Project Team and I are evaluating different Rich Client Platforms
>>> that we can use with out next integration project. I don't need
>>> anything too fancy, but I will need to incorporate some existing swing
>>> controls (NASA's World Wind etc) and will need to support cut, copy,
>>> paste and drag and drop of custom objects between awt / swing and swt.
>>> After reading ali's harrowing journey that seemed to end in defeat
>>> (search for "Drag and drop from SWT to Swing with a custom
>>> ByteArrayTransfer"), I�d like to clarify if this is a reasonable
>>> expectation. Does the Eclipse rcp support custom transfer types between
>>> swt and awt / swing? Does it work? Has anyone gotten this to work or
>>> should I just stick to swing?
>>>
>>> Thanks
>>>
>>> Greg Pirsig.
>>>
>>> P.S. I've already added this issue to the RCP newsgroup, but without any
>>> luck so far. I hope no one minds me adding it here too in an attempt to
>>> seek out anyone who can help... also please let me know if there is a
>>> better place or another website that I should be asking such questions?
>>>
>>
Re: Drag and drop and cut, copy, paste between awt / swing and swt. [message #11028 is a reply to message #10963] Wed, 10 June 2009 09:47 Go to previous messageGo to next message
Greg Pirsig is currently offline Greg PirsigFriend
Messages: 2
Registered: July 2009
Junior Member
I'm delighted that it's possible... If you can offer any crumbs of advice
that would be wonderful because it seems that our project, and perhaps a
few other perople's projects, are languishing with the lack of support.
We are dying here...
Re: Drag and drop and cut, copy, paste between awt / swing and swt. [message #11040 is a reply to message #11028] Sun, 14 June 2009 10:28 Go to previous messageGo to next message
Chris is currently offline ChrisFriend
Messages: 2
Registered: July 2009
Junior Member
I'm stuck on this too! If anyone has any information about how to resolve
the incompatibility between custom SWT ByteArrayTransfer and custom Swing
DataFlavors, please help us out? My am required to provide a solution to
this very soon and unfortunately I'm also stuck! It's just so tricky to
debug because it either all works or it doesn't... I just keep getting
java.awt.datatransfer.UnsupportedFlavorException also.

Does anyone have a code snippet on how to do this, or know how to declare
a DataFlavor to be compatible with a custom SWT ByteArrayTransfer type? It
sounds like this is causing more than a few people some grief.

Help, please, anyone!

Chris.
Re: Drag and drop and cut, copy, paste between awt / swing and swt. [message #485988 is a reply to message #11040] Tue, 15 September 2009 19:50 Go to previous messageGo to next message
Rohit is currently offline RohitFriend
Messages: 5
Registered: July 2009
Junior Member
hi,
Even i am working on this issue. I tried the example given here
http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.swt.sni ppets/src/org/eclipse/swt/snippets/Snippet319.java?view=co

It works well on the windows platform, but doesn't work on Mac OSX 10.6.
Even tried using JRE 1.6. I am using Eclipse SDK 3.5 macosx-cocoa-x86_64.

Thank you,
Rohit
Re: Drag and drop and cut, copy, paste between awt / swing and swt. [message #486141 is a reply to message #485988] Wed, 16 September 2009 14:01 Go to previous messageGo to next message
Grant Gayed is currently offline Grant GayedFriend
Messages: 2150
Registered: July 2009
Senior Member
On Cocoa I don't even see the JLabel there. I've logged
https://bugs.eclipse.org/bugs/show_bug.cgi?id=289612 for this.

Do you have a case on Cocoa where the AWT/Swing control is visible but the
drag and drop is still not working?

Grant


"Rohit " <erohits@gmail.com> wrote in message
news:1f978bb8becb8b7b8deffb9e5f112614$1@www.eclipse.org...
> hi,
> Even i am working on this issue. I tried the example given here
>
http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.swt.sni ppets/src/org/eclipse/swt/snippets/Snippet319.java?view=co
>
> It works well on the windows platform, but doesn't work on Mac OSX 10.6.
> Even tried using JRE 1.6. I am using Eclipse SDK 3.5 macosx-cocoa-x86_64.
>
> Thank you,
> Rohit
>
>
Re: Drag and drop and cut, copy, paste between awt / swing and swt. [message #486179 is a reply to message #486141] Wed, 16 September 2009 16:09 Go to previous messageGo to next message
Rohit is currently offline RohitFriend
Messages: 5
Registered: July 2009
Junior Member
hi Grant,
yeah the Label was not visible earlier. I used frame.pack()
and the label showed up. Even with the label showing DND does not work.
Re: Drag and drop and cut, copy, paste between awt / swing and swt. [message #487054 is a reply to message #486179] Mon, 21 September 2009 16:58 Go to previous message
Grant Gayed is currently offline Grant GayedFriend
Messages: 2150
Registered: July 2009
Senior Member
I see, I've logged https://bugs.eclipse.org/bugs/show_bug.cgi?id=290035 .

Grant


"Rohit " <erohits@gmail.com> wrote in message
news:622a177e4a08c7191f7af1547cbe52c7$1@www.eclipse.org...
> hi Grant,
> yeah the Label was not visible earlier. I used frame.pack()
> and the label showed up. Even with the label showing DND does not work.
>
Re: Drag and drop and cut, copy, paste between awt / swing and swt. [message #575080 is a reply to message #10952] Tue, 05 May 2009 01:34 Go to previous message
Eclipse UserFriend
Originally posted by: stephan.nagy.gmail.com

While I don't have a snippet or example I can post, I can say we have
done this using both FileTransfer and ByteArrayTransfer so it is possible.

Tom Schindl wrote:
> Maybe asking the albireo guys?
>
> Tom
>
> Grant Gayed schrieb:
>> Hi Greg,
>>
>> I've asked someone here about this, and though we've never tried this, the
>> belief is that it should be possible. On the swt side you subclass
>> ByteArrayTransfer, and on the awt/swing side you have a custom data flavor.
>> The part that's less clear (though may be trivial to someone that uses
>> awt/string reguarly) is how to specify the data type name on the awt/swing
>> side, because the awt/swing DataFlavors are keyed by mimeType, which I think
>> != the data type name on the swt side. Looking at the javadoc pages,
>> SystemFlavorMap looks like it could be useful for doing this mapping.
>>
>> Sorry if this answer isn't definitive enough, I was hoping that someone else
>> had more concrete experience with this (the awt/swing side in particular).
>> I plan to investigate this when I have more time and will post an example
>> snippet if successful, but for the next while we're winding down the eclipse
>> 3.5 work, so I'm not sure when this will be. (If anyone else has an example
>> of this then please submit it!).
>>
>> Grant
>>
>>
>> "Greg Pirsig" <greg.pirsig@gmail.com> wrote in message
>> news:80422c4a99c27545a8814a26dd94a875$1@www.eclipse.org...
>>> Greetings all!
>>>
>>> My Project Team and I are evaluating different Rich Client Platforms
>>> that we can use with out next integration project. I don't need
>>> anything too fancy, but I will need to incorporate some existing swing
>>> controls (NASA's World Wind etc) and will need to support cut, copy,
>>> paste and drag and drop of custom objects between awt / swing and swt.
>>> After reading ali's harrowing journey that seemed to end in defeat
>>> (search for "Drag and drop from SWT to Swing with a custom
>>> ByteArrayTransfer"), I�d like to clarify if this is a reasonable
>>> expectation. Does the Eclipse rcp support custom transfer types between
>>> swt and awt / swing? Does it work? Has anyone gotten this to work or
>>> should I just stick to swing?
>>>
>>> Thanks
>>>
>>> Greg Pirsig.
>>>
>>> P.S. I've already added this issue to the RCP newsgroup, but without any
>>> luck so far. I hope no one minds me adding it here too in an attempt to
>>> seek out anyone who can help... also please let me know if there is a
>>> better place or another website that I should be asking such questions?
>>>
>>
Re: Drag and drop and cut, copy, paste between awt / swing and swt. [message #575179 is a reply to message #10963] Wed, 10 June 2009 09:47 Go to previous message
Greg Pirsig is currently offline Greg PirsigFriend
Messages: 2
Registered: July 2009
Junior Member
I'm delighted that it's possible... If you can offer any crumbs of advice
that would be wonderful because it seems that our project, and perhaps a
few other perople's projects, are languishing with the lack of support.
We are dying here...
Re: Drag and drop and cut, copy, paste between awt / swing and swt. [message #575196 is a reply to message #11028] Sun, 14 June 2009 10:28 Go to previous message
Chris is currently offline ChrisFriend
Messages: 2
Registered: July 2009
Junior Member
I'm stuck on this too! If anyone has any information about how to resolve
the incompatibility between custom SWT ByteArrayTransfer and custom Swing
DataFlavors, please help us out? My am required to provide a solution to
this very soon and unfortunately I'm also stuck! It's just so tricky to
debug because it either all works or it doesn't... I just keep getting
java.awt.datatransfer.UnsupportedFlavorException also.

Does anyone have a code snippet on how to do this, or know how to declare
a DataFlavor to be compatible with a custom SWT ByteArrayTransfer type? It
sounds like this is causing more than a few people some grief.

Help, please, anyone!

Chris.
Re: Drag and drop and cut, copy, paste between awt / swing and swt. [message #575382 is a reply to message #11040] Tue, 15 September 2009 19:50 Go to previous message
Rohit  is currently offline Rohit Friend
Messages: 6
Registered: September 2009
Junior Member
hi,
Even i am working on this issue. I tried the example given here
http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.swt.sni ppets/src/org/eclipse/swt/snippets/Snippet319.java?view=co

It works well on the windows platform, but doesn't work on Mac OSX 10.6.
Even tried using JRE 1.6. I am using Eclipse SDK 3.5 macosx-cocoa-x86_64.

Thank you,
Rohit
Re: Drag and drop and cut, copy, paste between awt / swing and swt. [message #575417 is a reply to message #485988] Wed, 16 September 2009 14:01 Go to previous message
Grant Gayed is currently offline Grant GayedFriend
Messages: 2150
Registered: July 2009
Senior Member
On Cocoa I don't even see the JLabel there. I've logged
https://bugs.eclipse.org/bugs/show_bug.cgi?id=289612 for this.

Do you have a case on Cocoa where the AWT/Swing control is visible but the
drag and drop is still not working?

Grant


"Rohit " <erohits@gmail.com> wrote in message
news:1f978bb8becb8b7b8deffb9e5f112614$1@www.eclipse.org...
> hi,
> Even i am working on this issue. I tried the example given here
>
http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.swt.sni ppets/src/org/eclipse/swt/snippets/Snippet319.java?view=co
>
> It works well on the windows platform, but doesn't work on Mac OSX 10.6.
> Even tried using JRE 1.6. I am using Eclipse SDK 3.5 macosx-cocoa-x86_64.
>
> Thank you,
> Rohit
>
>
Re: Drag and drop and cut, copy, paste between awt / swing and swt. [message #575436 is a reply to message #486141] Wed, 16 September 2009 16:09 Go to previous message
Rohit  is currently offline Rohit Friend
Messages: 6
Registered: September 2009
Junior Member
hi Grant,
yeah the Label was not visible earlier. I used frame.pack()
and the label showed up. Even with the label showing DND does not work.
Re: Drag and drop and cut, copy, paste between awt / swing and swt. [message #575464 is a reply to message #486179] Mon, 21 September 2009 16:58 Go to previous message
Grant Gayed is currently offline Grant GayedFriend
Messages: 2150
Registered: July 2009
Senior Member
I see, I've logged https://bugs.eclipse.org/bugs/show_bug.cgi?id=290035 .

Grant


"Rohit " <erohits@gmail.com> wrote in message
news:622a177e4a08c7191f7af1547cbe52c7$1@www.eclipse.org...
> hi Grant,
> yeah the Label was not visible earlier. I used frame.pack()
> and the label showed up. Even with the label showing DND does not work.
>
Previous Topic:ctrl-c ctrl-v not working in 3.5
Next Topic:Any news from the Albireo project?
Goto Forum:
  


Current Time: Thu Mar 28 21:55:46 GMT 2024

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

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

Back to the top