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)

import java.awt.datatransfer.Transferable;
import java.awt.datatransfer.DataFlavor;
import java.awt.datatransfer.UnsupportedFlavorException;

sclass FileTransferable implements Transferable {
  new L<File> files;

  *(File  f) { files.add(f); }
  *(L<File> *files) {}

  public DataFlavor[] getTransferDataFlavors() {
    ret new DataFlavor[] { DataFlavor.javaFileListFlavor };
  }

  public bool isDataFlavorSupported(DataFlavor flavor) {
    ret eq(flavor, DataFlavor.javaFileListFlavor);
  }

  public O getTransferData(DataFlavor flavor) {
    ret files;
  }
}

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: 262 / 831
Referenced in: [show references]