• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

cut or copy?

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic