Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Drag and drop between AWT and SWT?
Drag and drop between AWT and SWT? [message #163988] Sat, 15 January 2005 00:43 Go to next message
Eclipse UserFriend
Originally posted by: kevinlouisnospam.hotmail.com

I am new to SWT. As far as I know, the mechanism of the DND between AWT and
SWT are totoally different. Is there any way or bridge to make them working
together.

I have an existing component written in AWT and I need to write a new
component in SWT. I want to drag from the AWT to SWT without rewritting the
old one.

Thanks in advance.
Re: Drag and drop between AWT and SWT? [message #164021 is a reply to message #163988] Sun, 16 January 2005 18:23 Go to previous messageGo to next message
gruyer is currently offline gruyerFriend
Messages: 5
Registered: July 2009
Junior Member
Kevin,

Have a look to code: org.eclipse.swt.internal.SWT_AWT.

This offers support to embed an AWT/SWING component into a SWT composite.

(Use SWT+Eclipse 3.0 only , I think this would not exist yet in 2.1).

To embed your AWT component:

Create a SWT composite in your display shell, using style SWT.EMBEDDED.

Create an AWT Panel (for example) to host the AWT component. Creation method
is something such as:

Panel myPanel = SWT_AWT.new_Panel(Composite);

Put your AWR component in the panel:

myPanel.add(myAWTComponent);

Regards

Francois GRUYER

"Kevin" <kevinlouisnospam@hotmail.com> a
Re: Drag and drop between AWT and SWT? [message #164335 is a reply to message #164021] Tue, 18 January 2005 17:15 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: kevinlouisnospam.hotmail.com

Thanks for your reply. I know there is SWT_AWT bridge. I have tried putting
AWT components in the SWT, the DND between the AWT components work. But I
don't know how to get the drop event in SWT from the dragging in AWT. The
DND between AWT and SWT are using Transferable and Transfer to transfer the
data. Do you think the DND works between them?

Thanks,

Kevin

"francois GRUYER" <gruyer.francois@wanadoo.fr> wrote in message
news:csebep$v43$1@www.eclipse.org...
> Kevin,
>
> Have a look to code: org.eclipse.swt.internal.SWT_AWT.
>
> This offers support to embed an AWT/SWING component into a SWT composite.
>
> (Use SWT+Eclipse 3.0 only , I think this would not exist yet in 2.1).
>
> To embed your AWT component:
>
> Create a SWT composite in your display shell, using style SWT.EMBEDDED.
>
> Create an AWT Panel (for example) to host the AWT component. Creation
method
> is something such as:
>
> Panel myPanel = SWT_AWT.new_Panel(Composite);
>
> Put your AWR component in the panel:
>
> myPanel.add(myAWTComponent);
>
> Regards
>
> Francois GRUYER
>
> "Kevin" <kevinlouisnospam@hotmail.com> a
Re: Drag and drop between AWT and SWT? [message #164447 is a reply to message #164335] Tue, 18 January 2005 20:40 Go to previous messageGo to next message
gruyer is currently offline gruyerFriend
Messages: 5
Registered: July 2009
Junior Member
Kevin
I do not know the answer for sure, but I am afraid you ask too much to the
AWT/SWT bridge ;-)

"Kevin" <kevinlouisnospam@hotmail.com> a
Re: Drag and drop between AWT and SWT? [message #164463 is a reply to message #163988] Tue, 18 January 2005 20:43 Go to previous message
Pratik Shah is currently offline Pratik ShahFriend
Messages: 1077
Registered: July 2009
Senior Member
Try the eclipse.platform.swt newsgroup.

"Kevin" <kevinlouisnospam@hotmail.com> wrote in message
news:cs9ov1$u2$1@www.eclipse.org...
> I am new to SWT. As far as I know, the mechanism of the DND between AWT
and
> SWT are totoally different. Is there any way or bridge to make them
working
> together.
>
> I have an existing component written in AWT and I need to write a new
> component in SWT. I want to drag from the AWT to SWT without rewritting
the
> old one.
>
> Thanks in advance.
>
>
Previous Topic:How to rebuild the flow diagram sample
Next Topic:SchemaEditor question : how to generate RCP
Goto Forum:
  


Current Time: Thu Mar 28 21:37:07 GMT 2024

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

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

Back to the top