public interface DragAndDropHandler<D> extends HandlerPlugin<D>
Drag-and-drop handlers discoverable at runtime must implement this interface
and be annotated with @Plugin
with attribute Plugin.type()
=
DragAndDropHandler
.class. While it possible to create a drag-and-drop
handler merely by implementing this interface, it is encouraged to instead
extend AbstractDragAndDropHandler
, for convenience.
Plugin
,
DragAndDropService
Modifier and Type | Method and Description |
---|---|
D |
convertData(DragAndDropData data)
Converts the given
DragAndDropData to the type of data object
supported by this handler. |
D |
convertObject(Object object)
Converts the given object to the type of data object supported by this
handler.
|
boolean |
drop(D dataObject,
Display<?> display)
Performs a drop operation with the given data object in the specified
Display . |
boolean |
dropData(DragAndDropData data,
Display<?> display)
Performs a drop operation with the given data in the specified
Display . |
boolean |
dropObject(Object object,
Display<?> display)
Performs a drop operation with the given data in the specified
Display . |
default boolean |
supports(D dataObject)
Gets whether this handler supports dropping the given data object onto a
compatible display.
|
boolean |
supports(D dataObject,
Display<?> display)
Gets whether this handler supports dropping the given data object onto the
specified display.
|
boolean |
supportsData(DragAndDropData data)
Gets whether this handler supports dropping the given
DragAndDropData onto a compatible display. |
boolean |
supportsData(DragAndDropData data,
Display<?> display)
Gets whether this handler supports dropping the given
DragAndDropData onto the specified display. |
boolean |
supportsDisplay(Display<?> display)
Gets whether this handler supports dropping an assumed-to-be-compatible
data object onto the given
Display . |
boolean |
supportsObject(Object object)
Gets whether this handler supports dropping the given object onto a
compatible display.
|
boolean |
supportsObject(Object object,
Display<?> display)
Gets whether this handler supports dropping the given object onto the
specified display.
|
getIdentifier, log
context, getContext, setContext
compareTo, getPriority, setPriority
getInfo, setInfo
getLocation
getVersion
boolean supports(D dataObject, Display<?> display)
boolean supportsData(DragAndDropData data)
DragAndDropData
onto a compatible display.boolean supportsData(DragAndDropData data, Display<?> display)
DragAndDropData
onto the specified display.boolean supportsObject(Object object)
boolean supportsObject(Object object, Display<?> display)
boolean supportsDisplay(Display<?> display)
Display
.D convertData(DragAndDropData data)
DragAndDropData
to the type of data object
supported by this handler.IllegalArgumentException
- if the handler does not support the given
DragAndDropData
.D convertObject(Object object)
IllegalArgumentException
- if the handler does not support the given
object.boolean drop(D dataObject, Display<?> display)
Display
.IllegalArgumentException
- if the handler is not compatible with the
given data/display combination.boolean dropData(DragAndDropData data, Display<?> display)
Display
.IllegalArgumentException
- if the handler is not compatible with the
given data/display combination.boolean dropObject(Object object, Display<?> display)
Display
.IllegalArgumentException
- if the handler is not compatible with the
given data/display combination.Copyright © 2015–2022 SciJava. All rights reserved.