Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/main/java/HandleExtraFileTypes.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
import org.scijava.Context;
import org.scijava.io.IOService;
import org.scijava.ui.UIService;
import org.scijava.ui.dnd.DragAndDropService;
import org.scijava.display.DisplayService;

// Plugin to handle file types which are not implemented
// directly in ImageJ through io.Opener
Expand Down Expand Up @@ -543,6 +545,13 @@ private ImagePlus openImage(final String directory, final String name,
final Object ctx = IJ.runPlugIn("org.scijava.Context", "");
if (ctx instanceof Context) {
final Context context = (Context) ctx;
final DragAndDropService dndService = context.getService(DragAndDropService.class);
final DisplayService dsService = context.getService(DisplayService.class);
if ( dndService != null && dsService != null
&& dndService.drop(path, dsService.getActiveDisplay()) ) {
width = IMAGE_OPENED;
return null;
}
final IOService ioService = context.getService(IOService.class);
final UIService uiService = context.getService(UIService.class);
if (ioService != null && uiService != null) {
Expand Down