| Project Explorer Drop problem [message #333371] | 
Sat, 06 December 2008 03:23   | 
 
Eclipse User  | 
 | 
 | 
   | 
 
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.
 |  
 |  
  | 
 | 
 | 
Powered by 
FUDForum. Page generated in 0.25915 seconds