|
Re: Common Navigator Drop Problem [message #330334 is a reply to message #330283] |
Fri, 25 July 2008 15:45 |
Francis Upton IV Messages: 472 Registered: July 2009 Location: Oakland, CA |
Senior Member |
|
|
Yes, you can do this by overriding the
ViewerDropAssistant.determineTarget() method. This is given the
TreeItem (event.item). You should be able to use this to construct the
parent from the SWT Tree and then you can store that as a new field in
your subclass. I have not actually tried this, so you should be careful
about making sure where you store this tree path it will always be
correct and what you want. But hopefully this should get you started.
I don't think their is an easier way.
Francis
Mike Bernat wrote:
> We are using the CommonNavigator to display a view of items that exists
> on multiple servers. We support different logical views of the same
> server and therefore the same items could appear in the viewer more than
> once. We use the ITreePathContentProvider to create the tree and ensure
> that each remote item is represented by only one object in the tree,
> even if it is visible in multiple places. Everything works well and
> ITreeSelections and TreePaths seem to be available in all the right
> places, except in the CommonDropAdapterAssistant subclasses. In both the
> validateDrop() and handleDrop() methods, the drop target is available
> only as a simple object from the tree. Since that object can occur more
> than once in the viewer but only once in the underlying tree, it is not
> possible to reliably determine the full parentage of the drop target,
> since the target could have multiple parents.
> Is there any way to get a TreePath for the drop target in validateDrop()
> and handleDrop()?
>
> Thanks in advance,
> Mike
>
--
*new* Common Navigator Framework section in:
3.4RC4 Platform Plugin Developer Guide (Programmer's Guide)
http://help.eclipse.org/ganymede/topic/org.eclipse.platform. doc.isv/guide/cnf.htm
http://dev.eclipse.org/blogs/francis
http://wiki.eclipse.org/Common_Navigator_Framework
http://wiki.eclipse.org/Common_Navigator_Framework_Use_Cases
You have brains in your head.
You have feet in your shoes.
- Dr Seuss, Oh the Places You'll Go
Platform UI Committer for Common Navigator
http://wiki.eclipse.org/index.php/Common_Navigator_Framework
http://help.eclipse.org/galileo/topic/org.eclipse.platform.d oc.isv/guide/cnf.htm
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04432 seconds