Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Drag and Drop validation
Drag and Drop validation [message #444970] Fri, 22 October 2004 17:34 Go to next message
Sai [Srinivasan Sairam] is currently offline Sai [Srinivasan Sairam]Friend
Messages: 36
Registered: July 2009
Member
I have drag and drop working between two trees (say TreeX and TreeY). In
my case DnD from TreeX to TreeY as well from TreeY to TreeX are allowed.
I made it to work by having drag and drop listener attached to both the
trees. Now comes the validation part ... DnD from TreeX to TreeX and DnD
from TreeY to TreeY are not permitted. I want to change the cursor to
"DND.NONE" when a DnD from X to X or from Y to Y is initiated. Which is
the best place to perform this validation and how would I know that drag
and drop is happening within the same tree?

Any ideas .... very much appreciated.

Thanks
Srinivasan Sairam
Re: Drag and Drop validation [message #444973 is a reply to message #444970] Fri, 22 October 2004 18:03 Go to previous message
Veronika Irvine is currently offline Veronika IrvineFriend
Messages: 1272
Registered: July 2009
Senior Member
You can not know what the source is in a drag and drop. The source could be
another application for example.

You could:
1) Define two different transfer types so that TreeX is the source of type A
but the target of type B
- this will work while dragging
OR
2) Include in the data being transferred some information about the source
(e.g. an ID) and reject the dropped data if the ID is the same as the target
- this will not change the cursor because it happens only when the data is
dropped but will stop the drop


"Srinivasan Sairam" <Srinivasan.Sairam@gxs.com> wrote in message
news:clbgai$due$1@eclipse.org...
>I have drag and drop working between two trees (say TreeX and TreeY). In
> my case DnD from TreeX to TreeY as well from TreeY to TreeX are allowed.
> I made it to work by having drag and drop listener attached to both the
> trees. Now comes the validation part ... DnD from TreeX to TreeX and DnD
> from TreeY to TreeY are not permitted. I want to change the cursor to
> "DND.NONE" when a DnD from X to X or from Y to Y is initiated. Which is
> the best place to perform this validation and how would I know that drag
> and drop is happening within the same tree?
>
> Any ideas .... very much appreciated.
>
> Thanks
> Srinivasan Sairam
>
Previous Topic:Drang And Drop Arbitrary Objects
Next Topic:ToolBar problems
Goto Forum:
  


Current Time: Thu Apr 25 13:38:19 GMT 2024

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

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

Back to the top