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 19:07 Go to next message
Frodo Bilbo is currently offline Frodo Bilbo
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 15:48 Go to previous message
Frodo Bilbo is currently offline Frodo Bilbo
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: Wed Jul 30 01:19:16 EDT 2014

Powered by FUDForum. Page generated in 0.18101 seconds