WidgetModel: getChoices() can return null

... and indeed, the default implementation in AbstractModuleItem *does*
return null. Therefore, we should *never* expect it to return a list
in all cases, and exercise defensive programming instead.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Add a Module class for use with script input parameters

The easiest way to handle input parameters is really to have a Module and
pass it to the CommandService.

This is what we will do with scripts, too, so we need a special-purpose
Module whose only goal is to populate input parameters.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Support input parameters in scripts

With this change, the script service will parse the first few lines for
patterns of the form:

	@Class name

It will stop at the first line that contains at least one alphanumeric
character but no '@' character.

If any such input parameters are found, they will be populated via the
CommandService.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Add a proper JavaDoc for the Javascript test

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
JavascriptTest: simplify the code

Recent changes allow us to instantiate the SciJava context with a
given service interface.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
JavascriptTest: add a test for input parameters

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Script inputs: set a helpful dialog title

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Merge branch 'master' into script-parameters
Rename AbstractScriptEngineFactory

It is the abstract superclass of ScriptLanguage plugin implementations,
so for consistency with the rest of ImageJ2 should really be called
AbstractScriptLanguage rather than AbstractScriptEngineFactory.
ScriptLanguage: make javadoc consistent

This change updates the javadoc of ScriptLanguage and
AbstractScriptLanguage to be consistent with the other types of ImageJ2
plugins.
AbstractScriptLanguage: remove redundant method

Interface methods are already required for concrete classes to
implement, so there is no reason to declare one abstract (except
to narrow the return type or alter the javadoc).
AbstractScriptLanguage: use private not protected

See:
http://developer.imagej.net/coding-style#Private_over_protected_fields_and_methods
AbstractScriptLanguage: tweak section dividers
ScriptFinder: tweak formatting
ScriptService: remove service accessor methods

In general, we try to avoid hardcoding service dependencies in the
service interfaces themselves. We can rely on service injection using
SciJava Common's @Parameter mechanism in the service implementations.
DefaultScriptService: make method private

Public service methods should all be defined in some interface.
Otherwise, we are introducing API only present in Default*Service
implementations, which means that downstream code relying on it must
hardcode the Default*Service version. This is undesirable: it kills
extensibility in the form of alternative service implementations.
DefaultScriptService: fix method order
ScriptFinder: fix javadoc comment style
ScriptFinder: fix code style
ScriptFinder: add section header comments