From aa6abc527f547fbe61873546e52961891dd25281 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Ulman?= Date: Wed, 18 Oct 2023 16:32:46 +0200 Subject: [PATCH] ADD: DefaultLegacyOpener can open SelfShowableContent... ...which is a new kind of result of opening of inputs, often used in conjuction with openers that do load-and-show on their own, as opposite to load-only-and-have-Fiji-to-show pattern. --- .../java/net/imagej/legacy/plugin/DefaultLegacyOpener.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/net/imagej/legacy/plugin/DefaultLegacyOpener.java b/src/main/java/net/imagej/legacy/plugin/DefaultLegacyOpener.java index cbe5d679..fb74e743 100644 --- a/src/main/java/net/imagej/legacy/plugin/DefaultLegacyOpener.java +++ b/src/main/java/net/imagej/legacy/plugin/DefaultLegacyOpener.java @@ -63,6 +63,7 @@ import org.scijava.plugin.Plugin; import org.scijava.plugin.PluginService; import org.scijava.service.Service; +import org.scijava.ui.SelfShowableContent; /** * The default {@link LegacyOpener} plugin. @@ -200,6 +201,10 @@ public Object open(String path, final int planeIndex, private Object handleData(Context c, Object data, String path, boolean displayResult) { if (data == null) return path; + if (displayResult && data instanceof SelfShowableContent) { + ((SelfShowableContent)data).show(); + return data; + } if (data instanceof Dataset) { final Dataset d = (Dataset) data; ImagePlus imp = null;