Add a helpful comment

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Change comment to conform with ImageJ2's coding style

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Introduce a hook to execute at the end of WindowManager#closeAllWindows()

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
LegacyHooks: fix javadoc terminology

LegacyHooks was originally envisioned as an interface, but to ensure
backwards compatibility, was ultimately chosen to be an abstract base
class instead. That way, concrete subclasses will still be binary
compatible with the class even if new (concrete) methods are added.
LegacyHooks#quit(): improve javadoc

This clarifies the purpose of the method, and provides a link back to
the method being hooked.
Introduce a hook called just before IJ1 disposal

This hook is called after ImageJ1 has already done all its checks and
confirmed that indeed it is going to dispose itself and quit, but before
it has actually done so.

The LegacyHooks#disposing() method can now been overridden to control
exactly what happens before ImageJ1 disposes of itself and quits.

As currently written, there is one small wrinkle: ImageJ1 actually saves
its preferences _before_ this hook is triggered, meaning that even if
the disposal is canceled at this point, preferences will still have been
updated. This was done mostly for pragmatic reasons, and could be fixed
later if needed with some effort in the CodeHacker.

Thanks to Johannes Schindelin for the invaluable pair programming!
EssentialLegacyHooks: fix javadoc link and style
LegacyHooks#getContext(): tweak javadoc
Add a test for LegacyHooks shutdown hooks

All it does right now is verify that the hooks were indeed called, once
each. It does not check whether they were called in the right order. And
it does not check whether returning false with any of them will
terminate the shutdown sequence as it should.
Merge pull request #29 from imagej/close-all-windows

This branch adds a couple of extra hooks to ImageJ1 to facilitate better
shutdown behavior.