Add a simple interactive test for the script editor

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Add test-scoped Beanshell and Jython dependencies to the script editor

This facilitates testing, but probably we want to comment them out
in the future because they are only needed for *interactive* testing.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Let the script editor use the ScriptInfo infrastructure

This way, we automatically reap the beautiful support for
context/parameter injection (think '// @StatusService status' at the
top of the file).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Refactor evalScript() in the script editor

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Use evalScript() also to run non-compiled scripts

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
ScriptService: get rid of the initialize() method

This method was intended for use with the script editor, but we do things
differently now, using the ScriptService in a more standard way (at the
same time removing a difference in script handling between the script
editor and the rest of ImageJ2).

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

We can now use a simpler version of all the run method calls.
TextEditor: tweak style
ModuleService: tweak javadoc
Close the script's output streams only after the script is done

It was not quite clear from the contract implicitly defined by the name
'evalScript()' that it is a fire-and-forget method; 'eval' usually
implies that the respective entity is to be evaluated completely. This
is fixed now: evalScript() will return only when the script execution
has finished.

Implicitly, this also fixes the problem where evaluating a single-liner
Beanshell script printing a simple string would close the output streams
before the string was printed.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Ignore scrollToRect() if textArea is not set

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Always call scrollToRect() on EDT in script editor

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Add some Javadoc to script editor's JTextAreaWriter

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
DefaultScriptService: introduce the term "alias"

The term "type map" is rather vague. Conversely, "alias map" conveys the
function of the data structure: to map string aliases to concrete Java
class objects.

It also paves the way for API that allows external code to extend the
table of aliases to include additional things.
ScriptService: remove unnecessary imports
ScriptService: add API for adding more aliases
Merge branch 'script-editor'

This branch updates the Script Editor to use the new ScriptService
architecture. The Script Editor now executes scripts by the same
mechanism used when ScriptService#run is called!