Menu

Copy vs move?

Anonymous
2011-08-11
2013-04-26
  • Anonymous

    Anonymous - 2011-08-11

    Hi, we were just looking at your project at SourceForge, the jOutldd, and it seems to be perfect for our application. However, when emails are dragged from Outlook, they are deleted there (the dnd operation is a move instead of copy). Is there any way to configure this?

    Thanks a lot!

     
  • wide

    wide - 2011-08-12

    Hello Egil Sørensen,

    in your DropTargetAdapter function dragOver, set the accepted drag mode to COPY if MOVE is requested. Maybe this is nessesary in function drop too. I cannot check this at the moment.

    public void dragOver(java.awt.dnd.DropTargetDragEvent dtde) {
      int action = dtde.getDropAction();
      if (action == DnDConstants.ACTION_MOVE) { 
         action = DnDConstants.ACTION_COPY;
      }
      dtde.acceptDrag(action);
    }
    public void drop(java.awt.dnd.DropTargetDragEvent dtde) {
      int action = dtde.getDropAction();
      if (action == DnDConstants.ACTION_MOVE) { 
         action = DnDConstants.ACTION_COPY;
      }
      dtde.acceptDrop(action);
    }
    

    Regards
    Wolfgang Imig

     
  • Anonymous

    Anonymous - 2011-08-15

    Fantastic! That did exactly what we needed.

    Thanks again for a great library, this really helps us out with a problem we've been having for years!

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.