In a scijava-based application, e.g. Mastodon or sciview, that has menus and uses the “@Plugin(type = Command.class)” system of menu items (plugins), I have noticed the plugins can be either:
a) started w/o GUI inputs harvesting, default/last_used values are injected, or
b) started w/ GUI inputs harvesting, a dialog window pops up with unresolved inputs.
I have noticed that a) happens when there is no ImageJ2 main window around, and vice versa. So my main() methods typically start with
final ImageJ ij = new ImageJ(); ij.ui().showUI(); //provide ij.context to my app later
This gives me b) behaviour for plugins. Good. But there’s one unneeded window more…
I wonder how to init the context (or something else) to get b) behaviour with out the ImageJ window around?