Remove unused variable

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Remove unused main method

TestDrive classes should live in the src/test/java/ directory structure...

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Port findResources() method from deprecated class

ImageJ's AppUtils class has been deprecated in favor of SciJava's, but
the findResources() method has not made it there yet.

It is actually not quite well-exercised enough yet to graduate to
SciJava common; Besides, it is not at all clear what class would be
its appropriate destination (AppUtils? FileUtils? ResourceUtils?).

So let's develop this method in imagej-ui-swing until it is stable, and
move it then.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Avoid using deprecated class

The AppUtils class from imagej-common was deprecated in favor of SciJava
common's version.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Skip templates for unhandled script languages

To determine which script languages are handled, we already discover the
script engine factories, so we might just as well make use of them when
loading the templates (instead of figuring out -- again! -- which one
is the appropriate one).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Add a place-holder interface for syntax highlighter plugins

This will allow third-party components to provide their own syntax
highlighting plugins for additional languages.

The next commit will actually convert all of our custom syntax
highlighters into such plugins so that we 'eat our own dog food'.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Add long overdue Javadoc for the TextEditor class

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Convert all of our custom syntax highlighters into plugins

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Add a helper to generate import statements

This will be needed for the auto-import feature we have to introduce for
backwards-compatibility with the Fiji Script Editor.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Add Fiji's Auto-Import feature

In Fiji, many (but not all) script languages support the
"auto-import" feature, i.e. all of ImageJ 1.x classes (and for
backwards compatibility, even TrakEM2 classes) are imported by
default.

This feature is not really robust: what to do if two classes of the
same name live in two different packages? This question is not at all
academic, as the example of ImageJ 1.x' own Resizer classes show.

Another problem occurs when new classes are introduced that make
formerly unique names ambiguous. All of a sudden, all of the scripts
that use this class fail.

Basically, auto-imports share all the downsides with the highly
deprecated wildcard imports, so we will deprecate this feature right
from its introduction.

However, we need to support it so that Fiji can switch to the forked and
improved ImageJ2 script editor.

Fiji's Script Editor auto-imports all of ImageJ 1.x' classes; however,
we will *not* make imagej-ui-swing depend on ImageJ 1.x *just* to
support a deprecated feature. Instead, we introduce a new type of
plugin -- AutoImporter -- that will be implemented by a class in
imagej-legacy and enumerate the classes to auto-import.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Merge 'editor' into HEAD
Deprecate the auto-import feature by default

... but make it opt-in via Edit>Auto-Import. We might have to make it
opt-out, though, because people might be using this feature heavily...

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

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