Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » JFace » Drag and Drop into Table, how to get index?
Drag and Drop into Table, how to get index? [message #1058758] Tue, 14 May 2013 23:07 Go to next message
Frodo Bilbo is currently offline Frodo BilboFriend
Messages: 3
Registered: May 2013
Junior Member
I am using a ViewerDropAdapter to support dragging an object to a Table. When the drop operation is complete I can get the object that the mouse was over when it was released but can't see a way to get the table index.

Any ideas?
Re: Drag and Drop into Table, how to get index? [message #1058930 is a reply to message #1058758] Wed, 15 May 2013 19:48 Go to previous message
Frodo Bilbo is currently offline Frodo BilboFriend
Messages: 3
Registered: May 2013
Junior Member
@Override
boolean performDrop(Object data) {		
	DropTargetEvent event = this.getCurrentEvent();
		
	// Get table item that was the target
	TableItem item = (TableItem) event.item;
		
	// use the table item to look up the index
	int tableIndex = item.getParent().indexOf(item);				
	
	return true;
}
Previous Topic:Implementing displaying attached javadoc
Next Topic:display images with tableviewer
Goto Forum:
  


Current Time: Thu Mar 28 21:04:03 GMT 2024

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

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

Back to the top