Skip to content

Commit

Permalink
ADD: DefaultLegacyOpener can open SelfShowableContent...
Browse files Browse the repository at this point in the history
...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.
  • Loading branch information
xulman committed Oct 18, 2023
1 parent cc00483 commit aa6abc5
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit aa6abc5

Please sign in to comment.