mirror of
https://github.com/mitb-archive/filebot
synced 2024-11-17 06:45:06 -05:00
+ added special handling to enable LINK-Drop as "Do-not-resolve-Folders-to-Files-Drop"
This commit is contained in:
parent
c4082db18d
commit
89aa1c5b91
@ -3,7 +3,9 @@ package net.sourceforge.filebot.ui.rename;
|
|||||||
|
|
||||||
|
|
||||||
import static java.util.Arrays.*;
|
import static java.util.Arrays.*;
|
||||||
|
import static net.sourceforge.filebot.ui.transfer.FileTransferable.*;
|
||||||
|
|
||||||
|
import java.awt.datatransfer.Transferable;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
||||||
@ -36,8 +38,26 @@ class FilesListTransferablePolicy extends FileTransferablePolicy {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void handleTransferable(Transferable tr, TransferAction action) throws Exception {
|
||||||
|
if (action == TransferAction.LINK) {
|
||||||
|
// special handling for do-not-resolve-folders-drop
|
||||||
|
clear();
|
||||||
|
load(getFilesFromTransferable(tr), false);
|
||||||
|
} else {
|
||||||
|
// load files recursively by default
|
||||||
|
super.handleTransferable(tr, action);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void load(List<File> files) {
|
protected void load(List<File> files) {
|
||||||
|
load(files, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
protected void load(List<File> files, boolean recursive) {
|
||||||
List<File> entries = new ArrayList<File>();
|
List<File> entries = new ArrayList<File>();
|
||||||
LinkedList<File> queue = new LinkedList<File>(files);
|
LinkedList<File> queue = new LinkedList<File>(files);
|
||||||
|
|
||||||
@ -47,7 +67,7 @@ class FilesListTransferablePolicy extends FileTransferablePolicy {
|
|||||||
if (f.isHidden())
|
if (f.isHidden())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (f.isFile() || MediaDetection.isDiskFolder(f)) {
|
if (!recursive || f.isFile() || MediaDetection.isDiskFolder(f)) {
|
||||||
entries.add(f);
|
entries.add(f);
|
||||||
} else {
|
} else {
|
||||||
queue.addAll(0, asList(f.listFiles()));
|
queue.addAll(0, asList(f.listFiles()));
|
||||||
|
Loading…
Reference in New Issue
Block a user