You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit df48f01
Browse filesBrowse the repository at this point in the historyBrowse files
Support computed parameter choices, closing the DynamicCommand gap
Counting DynamicCommand's uses across the scijava and imagej repositories
shows two different needs wearing one coat: about 39 files mutate the
metadata of a declared parameter (setChoices, setMinimumValue), and about
31 add parameters that do not exist statically (addInput). SciJava Common
serves both by making ModuleInfo mutable and per-instance, which is
exactly what makes harvesting hard -- a platform cannot know a command's
parameters without constructing it.
Adding parameters was already covered by generated groups, and better,
because those are declared: @group(membersFrom = ...) says where the
dynamic part is and implies that the rest is fixed.
This adds the other half. @parameter(choicesFrom = "behavior") names a
behavior producing the values a parameter may take, so the parameter
stays statically visible while its values follow the state; choices =
{...} covers the static case; and ParameterNode.choices() hands a user
interface the resolved list without it caring which kind it was. Being a
behavior, it works for scripts, which DynamicCommand never did.
There is therefore no DynamicCommand base class and no mutable
description. If min and max want the same treatment, minFrom and maxFrom
follow the identical pattern -- worth adding when a widget needs it.
NB: one full-reactor run failed with twelve ops-image suites erroring in
SCIFIO's format discovery (Context.inject on a null context), in code
this branch does not touch. It did not reproduce on re-run or in
isolation, and the same suites passed in the surrounding runs. Recorded
here in case it recurs in CI.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013gJpzGd3ksbME4CN6Tu2ni
0 commit comments