Package org.scijava.ui.dnd
Interface DragAndDropData
-
- All Known Implementing Classes:
AbstractDragAndDropData,DefaultDragAndDropData
public interface DragAndDropDataInterface for drag-and-drop data.- Author:
- Curtis Rueden
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default <T> TgetData(Class<T> type)Gets the data as an object of the given Java class.ObjectgetData(MIMEType mimeType)Gets the data with respect to the given MIME type.default MIMETypegetMIMEType(Class<?> type)Gets the best supported MIME type matching the given Java class.List<MIMEType>getMIMETypes()Gets the list of supported MIME types.default booleanisSupported(Class<?> type)Gets whether the data can be provided as an object of the given Java class.booleanisSupported(MIMEType mimeType)Gets whether the data can be provided as an object with the given MIME type.
-
-
-
Method Detail
-
isSupported
boolean isSupported(MIMEType mimeType)
Gets whether the data can be provided as an object with the given MIME type.
-
isSupported
default boolean isSupported(Class<?> type)
Gets whether the data can be provided as an object of the given Java class.
-
getData
Object getData(MIMEType mimeType)
Gets the data with respect to the given MIME type.- Returns:
- The data object for the given MIME type. May return null if the
data is requested too early in the drag-and-drop process, such as
during a
DragEnterEventrather than aDropEvent. - Throws:
IllegalArgumentException- if the MIME type is not supported.
-
getData
default <T> T getData(Class<T> type)
Gets the data as an object of the given Java class.
-
getMIMEType
default MIMEType getMIMEType(Class<?> type)
Gets the best supported MIME type matching the given Java class.
-
-