ij-legacy: move MacAdapter handling from LegacyInjector to
LegacyExtensions

The MacAdapter patches are really needed for the legacy mode, and we
decided some time ago that that category of legacy patches should be
separated from the patches synchronizing legacy and modern state.

Technically, LegacyInjector *would* be the correct location if we still
just switched off the MacAdapter. However, we cannot switch it off at
all times anymore because that would break legacy mode (and hence Fiji,
e.g. when the user wants to quit the application)...

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
ij-legacy: clarify why we patch MacAdapter only sometimes

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Add an application event for opening files

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
MacOSX: handle event when files are dropped onto the application icon

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
ij-legacy: do not let MacAdapter do its thing

If we let MacAdapter run normally, we will not be able to install any
other application listener. But ImageJ2 needs to.

For the moment, this breaks Fiji's legacy mode again: neither Quit nor
Drag 'n Drop of files onto the Dock icon will work. We will fix that in
the next commits.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Updater: when looking for upload site candidates, ignore the disabled ones

Noticed by Jean-Yves Tinevez.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Autoscale never returns a display range of 0
Restore TypeChangers ability to combine channels
We no longer need to hold explicit references to event subscribers

... except when we need to unsubscribe them explicitly.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
SwingScriptRecorder: remember the event subscribers

We need to unsubscribe them after recording. That code is there. But
the subscribers were never set...

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Break out some code into methods
LegacyExtensions: make sure that the FolderOpener is patched properly

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

We will want to ask the ExprEditor whether it bothered to replace
any code.

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

This typo was introduced (most likely by typing 'i' in vi's "I beep"
mode once too many) in 77bc9519(ij-legacy: add "Convert to 8-bit
Grayscale" to File>Import>Image Sequence).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
LegacyExtensions: Fix overriding macro recorder's create macro

We want to initialize a Script Editor in that case, after all.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
CodeHacker: complain when code should have been replaced, but was not

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
CodeHacker: make it easier to debug 'No code replaced' issues

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
LegacyExtensions: Handle StartupMacros.fiji.ijm again

This developer thought that ImageJ 1.x learnt the trick to handle that
file, but it did not, at least not completely.

So let's revert the breakage introduced in Fiji's commit 10a7e737(No
longer patch ImageJ 1.x to know about StartupMacros.fiji.ijm).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Update TODOs
Add a TODO note