public class EssentialLegacyHooks extends LegacyHooks
LegacyHooks
to be used in the patched ImageJ 1.x.
This is the minimal implementation of LegacyHooks
and will be
installed by default after patching in the extension points into ImageJ 1.x.
On its own, it does not allow to override the extension points (such as the
editor) with different implementations; one needs to install different hooks
using the
LegacyInjector.installHooks(ClassLoader, LegacyHooks)
method.
This class is also the perfect base class for all implementations of the
LegacyHooks
interface, e.g. to offer "real" extension mechanisms such
as the SciJava-common plugin framework.
LegacyHooks.FatJarNameComparator
Constructor and Description |
---|
EssentialLegacyHooks() |
Modifier and Type | Method and Description |
---|---|
void |
error(Throwable t)
Shows an exception.
|
void |
initialized()
First extension point to run just after ImageJ 1.x spun up.
|
Object |
interceptRunPlugIn(String className,
String arg)
Intercepts LegacyInitializer's Context creation.
|
static ClassLoader |
missingSubdirs(ClassLoader loader,
boolean addPluginsDir)
Intended for sole use with patches in
IJ . |
addMenuItem, addPluginClasspath, addPluginDirectory, autoGenerateConfigFile, autoGenerateConfigFile, createInEditor, debug, dispose, disposing, enableIJ1PluginDirs, getAppName, getAppVersion, getClasspathElements, getContext, getIconURL, getMenuStructure, getThreadAncestors, handleExtraPluginJars, handleNoSuchMethodError, installed, interceptCloseAllWindows, interceptDragAndDropFile, interceptFileOpen, interceptImageWindowClose, interceptKeyPressed, interceptOpen, interceptOpenImage, interceptOpenRecent, isLegacyMode, log, newPluginClassLoader, openInEditor, quit, registerImage, runAfterRefreshMenus, showProgress, showProgress, showStatus, unregisterImage
public void error(Throwable t)
LegacyHooks
error
in class LegacyHooks
t
- the exceptionpublic void initialized()
LegacyHooks
initialized
in class LegacyHooks
public static ClassLoader missingSubdirs(ClassLoader loader, boolean addPluginsDir)
IJ
. DO NOT USE.public Object interceptRunPlugIn(String className, String arg)
One of the most critical code paths in Fiji
is how its runtime patches get installed. It calls the
LegacyEnvironment
, of course, but the idea is for said environment
to install the essential LegacyHooks
which then give ImageJ's
LegacyService
a chance to spin up all of the legacy patches,
including Fiji's (which are add-ons on top of imagej-legacy
).
If this critical code path fails, Fiji fails to start up properly. Ideally,
this should never happen, but this is not an ideal world: corrupt
.jar
files and version skews caused by forgotten updates,
locally-modified files or simply by forward-incompatible downstream updates
can break any number of things in that path. So let's bend over another
inch (the existence of the ij1-patcher
speaks volumes about our
learned ability to do so) and try extra hard to keep things working even
under very unfavorable circumstances.
interceptRunPlugIn
in class LegacyHooks
className
- the class namearg
- the argument passed to the runPlugIn
methodCopyright © 2014–2022 ImageJ. All rights reserved.