Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

22
LINES

< > BotCompany Repo | #1019176 // FileTransferable - represents one or more files

JavaX fragment (include)

1  
import java.awt.datatransfer.Transferable;
2  
import java.awt.datatransfer.DataFlavor;
3  
import java.awt.datatransfer.UnsupportedFlavorException;
4  
5  
sclass FileTransferable implements Transferable {
6  
  new L<File> files;
7  
8  
  *(File  f) { files.add(f); }
9  
  *(L<File> *files) {}
10  
11  
  public DataFlavor[] getTransferDataFlavors() {
12  
    ret new DataFlavor[] { DataFlavor.javaFileListFlavor };
13  
  }
14  
15  
  public bool isDataFlavorSupported(DataFlavor flavor) {
16  
    ret eq(flavor, DataFlavor.javaFileListFlavor);
17  
  }
18  
19  
  public O getTransferData(DataFlavor flavor) {
20  
    ret files;
21  
  }
22  
}

Author comment

Began life as a copy of #1006061

download  show line numbers  debug dex  old transpilations   

Travelled to 12 computer(s): bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1019176
Snippet name: FileTransferable - represents one or more files
Eternal ID of this version: #1019176/1
Text MD5: 5c8e907ba8a0ea5b72325a30a9f60565
Author: stefan
Category: javax / gui
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-10-27 01:40:50
Source code size: 585 bytes / 22 lines
Pitched / IR pitched: No / No
Views / Downloads: 338 / 918
Referenced in: [show references]