Use the context class loader in more places

We should be consistent: either we restrict the class loader to the one
that loaded imagej-legacy, or we use the current thread's context class
loader, not both.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Remove completed fixme

This was done in the last imagej-legacy release.
LegacyUI: don't display on separate thread

This was based off the AbstractUserInterface's show() implementation, to
show a display off-thread. However, this causes problems in the legacy
layer where we depend on side-effects, such as registering an ImagePlus
in response to display creation.
DefaultLegacyOpener: factor out OpenFile

Instead of always using the OpenFile command, we will use a focused
GetPath command only if given a null path. Then we will use the
IOService directly.

This prevents unwanted dialogs to pop up, for example, if no format is
found.
DefaultLegacyOpener: cache services

Ideally we would just use context injection here. However, the
instantiation in DefaultLegacyHooks is too early for context injection
to work right now.

So let's at least cache these services between open runs.
LegacyUI: run file choosing on the EDT

Apparently, when IJ 1.x is the application frame, using a JFileChooser
can cause deadlocks if not run on the EDT. Observed in the
ij.io.OpenDialog class.

So, for the LegacyUI, since we're using a JFileChooser with an ImageJ as
our application frame, we should probably ensure it's run on the EDT.
DefaultLegacyOpener: update info comments

Updated the SCIFIO version and format titles in the ImagePlus info.
They are easier to read now.
Remove completed fixme

This was done in the last imagej-legacy release.
LegacyUI: don't display on separate thread

This was based off the AbstractUserInterface's show() implementation, to
show a display off-thread. However, this causes problems in the legacy
layer where we depend on side-effects, such as registering an ImagePlus
in response to display creation.
DefaultLegacyOpener: factor out OpenFile

Instead of always using the OpenFile command, we will use a focused
GetPath command only if given a null path. Then we will use the
IOService directly.

This prevents unwanted dialogs to pop up, for example, if no format is
found.
DefaultLegacyOpener: cache services

Ideally we would just use context injection here. However, the
instantiation in DefaultLegacyHooks is too early for context injection
to work right now.

So let's at least cache these services between open runs.
DefaultLegacyOpener: update info comments

Updated the SCIFIO version and format titles in the ImagePlus info.
They are easier to read now.
Merge branch 'fix-legacy-opener'

Updates the legacy-opener to not rely on OpenFile for opening things.

Closes #28
Merge pull request #30 from imagej/fix-legacy-opener

Fix legacy opener
Bump to next development cycle

Signed-off-by: Mark Hiner <hinerm@gmail.com>
LegacyCommandline: support multiple successive context instantiations

This is needed to support fiji-compat's integration testing...

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Bump to preemptively bumped parent version

That version also lists the ij1-patcher version we now require at minimum.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Implement interceptDragAndDropFile

This allows us to intercept drag-and-drop file requests and pass them to
SCIFIO.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Do not intercept dragged 'n dropped LUTs

Otherwise, ImageJ 1.x will not apply them properly.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Merge branch 'open-drag-n-drop'

This topic branch lets SCIFIO handle dragged 'n dropped files (except
for lookup tables, which are special).

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