Closed gselzer closed 1 year ago
@gselzer wrote:
it is really 3 actions in 1. Each action has the same result, but operates on different types. ... What does the remaining functionality in SourceSearchActionFactory get us?
The three actions you're talking about are:
SciJava scripts:
if (info instanceof ScriptInfo) sourceForScript((ScriptInfo) info);
Legacy (original ImageJ) commands:
if (id.startsWith("legacy:")) sourceForLegacyCommand(info);
Other modules, notably SciJava/ImageJ2 Command
plugins:
sourceForClass(info, info.loadDelegateClass());
So by "remaining functionality" you mean (3), right? What it gets us is a Source button for SciJava commands, like everything in imagej-plugins-commands for example.
Do I understand your question correctly?
Do I understand your question correctly?
@ctrueden hard to say as I am having trouble recalling, but I think by "remaining functionality" I was describing (2), as (1) and (3) encapsulated the functionality I moved out.
I think my point was just to make sure that we actually need (2) here, if we have (3) already. But again, I don't really remember since this was months ago.
The
Source
search action is super cool. It's so cool that I wanna move it upstream.The interesting thing, though, is that it is really 3 actions in 1. Each action has the same result, but operates on different types.
ScriptInfo
s, opening aorg.scijava.ui.swing.script.TextEditor
to display the source code. That functionality is moved intoscijava/script-editor
in scijava/script-editor#63ModuleInfo
s more generally. That functionality is moved into SciJava Search via scijava/scijava-search#24My remaining question: What does the remaining functionality in
SourceSearchActionFactory
get us? The only difference between thisActionFactory
and the work added to scijava/scijava-search#24 is that thisActionFactory
assumes that theModuleInfo
is aCommandInfo
and loads the class from thePresets
of thatCommandInfo
viaIJ1Helper.getClassLoader
.Do we really need to do all of that? I'll have to understand it better...