|
Re: Project Explorer Drop problem [message #333533 is a reply to message #333371] |
Tue, 16 December 2008 21:16 |
Francis Upton IV Messages: 472 Registered: July 2009 Location: Oakland, CA |
Senior Member |
|
|
Please file a bug about this:
https://bugs.eclipse.org/bugs/enter_bug.cgi?product=Platform
Select the UI component and put [CommonNavigator] first in the subject line.
Thanks!
Francis
Keshavrao wrote:
> Hi,
>
> I am facing a very strange behaviour during the drop on project
> explorer. I have registered a dropassistant with only one
> possibleDropTarget as the project node, and I am using a
> SingleSelectionTransfer during the drag from some another tree.
> I accept the drop in validateDrop method if its DND.DROP_MOVE.
>
> When i drag an object first on the project node the status is shown
> properly and i am able to drop the object properly. But if i first move
> my dragged object on some other node e.g. folder then i am not allowed
> to drop which is OK because i havent defined IFolder in
> possibleDropTargets, but now if slowly move my dragged object to the
> project node then it doesnt allow me to drop though its one of my
> possibleDropTargets. Then when i move the dragged object out of
> ProjectExplorer and again take it to the project node at the enter only
> this works again.
>
> I have also debugged this and i found that the issue lies in
> ViewerDropAdapter.doDropValidation(DropTargetEvent event) method which
> is below
> private void doDropValidation(DropTargetEvent event) {
> //update last valid operation
> if (event.detail != DND.DROP_NONE) {
> lastValidOperation = event.detail;
> }
> //valid drop and set event detail accordingly
> if (validateDrop(currentTarget, event.detail,
> event.currentDataType)) {
> currentOperation = lastValidOperation;
> } else {
> currentOperation = DND.DROP_NONE;
> }
> event.detail = currentOperation;
> }
>
> here in the second if statement if the validateDrop is false then the
> event.detail is set to DND.DROP_NONE, and this is never reset when i
> move from the folder nodes to the project node.
>
> the control to above method is reached from
> CommonDropAdapter.dragEnter - line::super.dragEnter(event) ->
> ViewerDropAdapter.dragEnter - line::doDropValidation(event)
>
> Thanks and regards,
> Keshav Veerapaneni.
>
>
>
>
>
--
*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 1.23357 seconds