Add script editor templates from Fiji's Script Editor

With ImageJ2's script editor, every component can ship their own
templates simply by bundling things in the /script-editor/ directory
of the .jar file. To provide everything needed for Fiji to switch
to the new script editor, imagej-legacy needs to take custody of the
templates for use with the legacy ImageJ 1.x classes.

This commit brings a verbatim copy of the templates from Fiji's
Script Editor. In the next commits, we will work on them more.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Add a TestDrive for the editor in legacy mode

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Move the ImageJ 1.x macro templates to a more appropriate folder

The directory in which the templates are stored indicates the name
of the language. The name 'Macro' is awfully general, however. So
let's stick with 'IJ1 Macro'.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Add a method to IJ1Helper to evaluate macros

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Add an almost JSR-223-compliant script engine for ImageJ 1.x macros

This is a crucial building block to allow Fiji to switch over to ImageJ2's
script editor: Fiji *needs* to support ImageJ 1.x macros in the script
editor, otherwise users will actually say something.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
TEMPORARY snapshot coupling for testing

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Add a legacy default importer

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Merge 'ij1-macro-engine' into HEAD
Avoid auto-importing non-public classes

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
No need to auto-import java.lang.*

The script languages auto-import those already themselves.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Be extra careful to avoid eternally bouncing status messages

Without this patch, a status message originating from modern mode
would bounce back and forth merrily, hogging the CPU rather nicely.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Merge 'ij1-auto-imports' into HEAD
Avoid depending on EssentialLegacyHooks

The DefaultLegacyHooks need to be loaded in order to execute
DefaultLegacyService's initialize() method, but that is exactly where we
want to call the ij1-patcher that wants to patch the
EssentialLegacyHooks.

So far, that was not a problem because we always had a different class
loader to patch, but we are about to switch to a startup process where
we force ImageJ 1.x to use the same class loader for its plugins as for
its core classes. That means we have to be careful *not* to use the
EssentialLegacyHooks class prematurely.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Merge 'script-templates' into HEAD
Do not require the UI service to initialize the legacy service

Catch 22...

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Make sure that the DefaultLegacyService has a slightly higher priority

We need to make certain that the LegacyUI is initialized only when the
legacy service is available already. That means that we have to make
certain that the DefaultUIService has a lower priority than the legacy
service. Or vice versa.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
TEMPORARY dependency bumps
WIP: This is the big switch to the new startup procedure

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Merge 'legacy-startup' into HEAD