Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Drag&Drop in a Table
Drag&Drop in a Table [message #440289] Wed, 28 July 2004 13:39 Go to next message
Eclipse UserFriend
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 #440294 is a reply to message #440289] Wed, 28 July 2004 16:48 Go to previous messageGo to next message
Steve Northover is currently offline Steve NorthoverFriend
Messages: 1636
Registered: July 2009
Senior Member
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 #440393 is a reply to message #440294] Thu, 29 July 2004 12:52 Go to previous messageGo to next message
Eclipse UserFriend
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 Go to previous message
Paul E. Keyser is currently offline Paul E. KeyserFriend
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 :)
>>
>
>
>
Previous Topic:SWT Application using SWT.RIGHT_TO_LEFT style
Next Topic:'JInternalFrame' in SWT
Goto Forum:
  


Current Time: Fri Apr 26 12:20:34 GMT 2024

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

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

Back to the top