• Post Reply Bookmark Topic Watch Topic
  • New Topic

cut or copy?  RSS feed

 
Max Dynin
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When I paste a bunch of files I have cut in the Windows explorer (the data flavor being DataFlavor.javaFileListFlavor), the files are not deleted after the action has been processed.

I could delete them myself, but how can I tell if it's a cut or a copy?

Or is there a way to make it automatic?
 
Paul Clapham
Sheriff
Posts: 22185
38
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It doesn't seem right that the target code should be responsible for deleting whatever was cut at the source. After all this could be almost anything -- files in the operating system, text in a Word document, you name it. So I think you're approaching the problem in the wrong way if that's your proposed solution.

But you're asking about "Move" versus "Copy", are you not? "Move" implies that the source object is deleted upon a successful drop, whereas "Copy" implies it is not deleted. I'm going from memory here and it's been a while since I worked with drag-and-drop, but I'm pretty sure it's possible to tell a move from a copy.
 
Max Dynin
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ideally, the clipboard should do it for you, and there should be a way to let it know that the files have been successfully pasted (or not, as the case may be). That would be my preferred solution, obviously...

But how would one go about it? There's nothing in the API that I could find

That's why I came up with the second idea; but even there, I can get items off the clipboard, but I can't find out where they were cut or copied. Creating a listener doesn't help much, a FlavorEvent simply tells you there is a new item on the clipboard, but not how it came to be there.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!