Cut files to the clipboard using SWT

There are many tutorials on copying files to the clipboard using the SWT API. However, I have never seen an explanation of how to cut files to the clipboard. What I'm trying to do is write a simple Java file manager where you can select a file and click Ctrl+X, and when you click Ctrl+Vin your own file manager, the files will be moved (not copied) from their original location to the destination. Does the SWT API really support this or some kind of lower level API needed to accomplish this?

0
source share
1 answer

Mark this image sample . Note that there is a FileTransfer class instead of the ImageTranfer class, which you can use instead.

Regarding the CUT operation:

To do this, you must manually delete the data after copying it to the clipboard. Java does not provide an implementation for a slice operation. . This is with AWT / Swing, but I'm sure it is the same with SWT. You can delete it after a successful copy of the clipboard or a successful paste ... of your choice.

0
source

All Articles