Remove unused import

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
IJ1MacroLanguage: require legacy service only lazily

This is needed because we need to be able to discover the
legacy-compatible macros at the time the legacy service is being
initialized, i.e. not yet *quite* available.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Move legacy-compatible command initialization back into service

Otherwise, the legacy-compatible commands and scripts will never be
installed unless the legacy UI is shown!

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Make calls to legacy-compatible commands/scripts synchronous

There is little use in calling commands in a macro when the call returns
before the action is actually performed...

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
IJ1Helper#runMacro: ensure that Macro.getOptions() works

ImageJ 1.x has this funny homebrewn way to provide thread-local
macro options (without using the ThreadLocal class at all). It
also poses a completely unnecessary restriction on the the thread
name. To support that in the broader context, we have to make
sure that the current thread name conforms to that requirement.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
IJ1Helpers: add delegators to get/set the macro options

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
TEMPORARILY switch to snapshot couplings

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
WIP: ensure that legacy-compatible macros find the macro options

WIP: depends on snapshot of SciJava common.

As SciJava's script service calls scripts on different threads,
we have to make extra certain that the appropriate macro options
-- if any -- are available to the ImageJ 1.x macro engine.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Add a unit test for running macros with macro options

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>