Cut/Copy files

Hello!

I have following question:

I m using System Clipboard as clipboard for file cut/copy/paste (file system is represented via JTree).

The question is how will i know what i need to do with file on "paste" action (i.e. copy on copy or move on cut)? Problem is because when using other flavors u mostly copy data to clipboard and while using filelistdata u only copy links and theres no flag in system clipboard which can be used to tell system right action.

Great thanks.

[505 byte] By [Alantiea] at [2007-11-27 11:12:58]
# 1

public int getSourceActions(JComponent c) {

return COPY_OR_MOVE;

}

This method from the TransferHandler class usually is used to check what action should be carried out when a Paste command is called.

COPY would represent a file copy and MOVE a cut action. COPY_OR_MOVE could represent either, and it is up to you to decide which action should be carried out when a paste is called.

ICE

icewalker2ga at 2007-7-29 13:57:57 > top of Java-index,Desktop,Core GUI APIs...