Drag&Drop in a Table [message #440289] |
Wed, 28 July 2004 13:39 |
Eclipse User |
|
|
|
Originally posted by: miguel.musiwave.com
Hi everibody,
I'm actually developping an SWT application, and i'm getting some
troubles using Drag&Drop in a Table. I want to move one Item to another
index in this Table. So when i click on an item and i start to move it, in
my DragOver() function i print the currently highlighted item's index, but
the getSelectionIndex() function doesn't return the good index...
Could someone help me? Thanks in advance, and excuse me for my poor
english :)
|
|
|
|
Re: Drag&Drop in a Table [message #440393 is a reply to message #440294] |
Thu, 29 July 2004 12:52 |
Eclipse User |
|
|
|
Originally posted by: miguel.musiwave.com
Thanks for your help, but it's not in the drag but the drop event that the
item field is ;)
Steve Northover wrote:
> That's because the selection doesn't actually change (although it draws that
> way). This happens because an application may do work when the selection
> changes and this probably doesn't want to happen during a drag. Also, if
> the drag is cancelled, the selection would need to be restored. Check out
> the event.item field in the drag event for the item you are after.
> "MELO Miguel" <miguel@musiwave.com> wrote in message
> news:ce8aat$u4j$1@eclipse.org...
> > Hi everibody,
> >
> > I'm actually developping an SWT application, and i'm getting some
> > troubles using Drag&Drop in a Table. I want to move one Item to another
> > index in this Table. So when i click on an item and i start to move it, in
> > my DragOver() function i print the currently highlighted item's index, but
> > the getSelectionIndex() function doesn't return the good index...
> > Could someone help me? Thanks in advance, and excuse me for my poor
> > english :)
> >
|
|
|
Re: Drag&Drop in a Table [message #440400 is a reply to message #440294] |
Thu, 29 July 2004 15:30 |
Paul E. Keyser Messages: 878 Registered: July 2009 |
Senior Member |
|
|
Well, that fails in TableTreeViewer. In TableViewer the highlighting
updates, and the drop-event's "item" is the correct TableItem. In
TableTreeViewer, the highlighting does not update, and the drop-event's
"item" is always null.
I am subclassing ViewerDropAdapter, whose dragOver() method in fact sets
event.feedback to "| DND.FEEDBACK_SELECT", as I confirmed by overriding
dragOver() to simply call super.dragOver() and add tracery before and
after the super-call to display the value of event.feedback and the
value of event.item
Is this a bug in TableTree or is there some special thing I should be
doing?
thanks,
Paul
Steve Northover wrote:
> That's because the selection doesn't actually change (although it draws that
> way). This happens because an application may do work when the selection
> changes and this probably doesn't want to happen during a drag. Also, if
> the drag is cancelled, the selection would need to be restored. Check out
> the event.item field in the drag event for the item you are after.
>
> "MELO Miguel" <miguel@musiwave.com> wrote in message
> news:ce8aat$u4j$1@eclipse.org...
>
>>Hi everibody,
>>
>> I'm actually developping an SWT application, and i'm getting some
>>troubles using Drag&Drop in a Table. I want to move one Item to another
>>index in this Table. So when i click on an item and i start to move it, in
>>my DragOver() function i print the currently highlighted item's index, but
>>the getSelectionIndex() function doesn't return the good index...
>> Could someone help me? Thanks in advance, and excuse me for my poor
>>english :)
>>
>
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.03638 seconds