public class StructuredDrop extends Object
Modifier and Type | Class and Description |
---|---|
static class |
StructuredDrop.AbstractTypedDropHandler<T> |
static class |
StructuredDrop.DropMethod |
static class |
StructuredDrop.Listener |
static interface |
StructuredDrop.TypedDropHandler<T> |
class |
StructuredDrop.TypeMapper<T> |
Constructor and Description |
---|
StructuredDrop() |
Modifier and Type | Method and Description |
---|---|
<TValue,TTransfer extends Transfer> |
add(TTransfer transfer,
BiFunction<TTransfer,DropTargetEvent,TValue> valueGetter,
StructuredDrop.TypedDropHandler<TValue> onEvent)
Adds a drop for the given transfer.
|
<TValue> StructuredDrop.TypeMapper<TValue> |
add(TypedTransfer<TValue> transfer,
StructuredDrop.TypedDropHandler<TValue> onEvent)
Adds a drop for the given filetype.
|
StructuredDrop.TypeMapper<ImmutableList<File>> |
addFile(StructuredDrop.TypedDropHandler<ImmutableList<File>> onEvent)
Adds the ability to drop files.
|
StructuredDrop.TypeMapper<String> |
addText(StructuredDrop.TypedDropHandler<String> onEvent)
Adds the ability to drop text.
|
void |
applyTo(Control... controls) |
void |
applyTo(Control control) |
StructuredDrop.Listener |
getListener() |
static <T> StructuredDrop.TypedDropHandler<T> |
handler(DndOp op,
BiConsumer<DropTargetEvent,T> onValue) |
static <T> StructuredDrop.TypedDropHandler<T> |
handler(DndOp op,
Consumer<T> onValue) |
boolean |
hasHandlerFor(Transfer transfer)
Returns true if it contains a handler for this transfer type.
|
static Transfer |
preferDropTransfer(DropTargetEvent event,
Transfer[] preferreds)
Sets event.currentDataType to the most preferred possible.
|
public boolean hasHandlerFor(Transfer transfer)
public <TValue,TTransfer extends Transfer> StructuredDrop.TypeMapper<TValue> add(TTransfer transfer, BiFunction<TTransfer,DropTargetEvent,TValue> valueGetter, StructuredDrop.TypedDropHandler<TValue> onEvent)
public <TValue> StructuredDrop.TypeMapper<TValue> add(TypedTransfer<TValue> transfer, StructuredDrop.TypedDropHandler<TValue> onEvent)
public StructuredDrop.TypeMapper<String> addText(StructuredDrop.TypedDropHandler<String> onEvent)
public StructuredDrop.TypeMapper<ImmutableList<File>> addFile(StructuredDrop.TypedDropHandler<ImmutableList<File>> onEvent)
public StructuredDrop.Listener getListener()
public void applyTo(Control control)
public void applyTo(Control... controls)
public static Transfer preferDropTransfer(DropTargetEvent event, Transfer[] preferreds)
public static <T> StructuredDrop.TypedDropHandler<T> handler(DndOp op, Consumer<T> onValue)
public static <T> StructuredDrop.TypedDropHandler<T> handler(DndOp op, BiConsumer<DropTargetEvent,T> onValue)