Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » DnD Target accepting numerous types?
DnD Target accepting numerous types? [message #442797] Mon, 13 September 2004 14:53 Go to next message
Eclipse UserFriend
Originally posted by: rthomas.pershing.com

Hi, I've read the articles on DnD and have been able to implement several
custom Transfer types to work correctly. However now I'm stumped when
trying to implement a tree Target that accepts more than one custom Types.
Apparently, the target only recognizes the first Transfer type specified
in the array...

Am I missing something else that needs to be done in the Target class to
get this to recognize the other acceptable types as well?

Thanks.
Re: DnD Target accepting numerous types? [message #442897 is a reply to message #442797] Tue, 14 September 2004 20:21 Go to previous message
Veronika Irvine is currently offline Veronika IrvineFriend
Messages: 1272
Registered: July 2009
Senior Member
When you set the targets on a drag source or a drop target, you pass in an
array of Transfer objects - each of which specifies a different type.

/**
* Specifies the list of data types that can be transferred by this
DragSource.
* The application must be able to provide data to match each of these types
when
* a successful drop has occurred.
*
* @param transferAgents a list of Transfer objects which define the types of
data that can be
* dragged from this source
*/
public void setTransfer(Transfer[] transferAgents)

In any of the drop target events (except drop) you can specify which of the
types available in dataTypes you would like to receive by setting the
currentDataType field of the event.

See also:
http://www.eclipse.org/articles/Article-SWT-DND/DND-in-SWT.h tml

"Roderick Thomas" <rthomas@pershing.com> wrote in message
news:ci4c8u$ba6$1@eclipse.org...
> Hi, I've read the articles on DnD and have been able to implement several
> custom Transfer types to work correctly. However now I'm stumped when
> trying to implement a tree Target that accepts more than one custom Types.
> Apparently, the target only recognizes the first Transfer type specified
> in the array...
>
> Am I missing something else that needs to be done in the Target class to
> get this to recognize the other acceptable types as well?
>
> Thanks.
>
Previous Topic:Drawing text on a picture using GC
Next Topic:controls in a shell
Goto Forum:
  


Current Time: Thu Apr 25 11:56:37 GMT 2024

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

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

Back to the top