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 ae3cf2f
Browse filesBrowse the repository at this point in the historyBrowse files
scijava-harvest: prototype the parameter dialog model
The model behind a parameter dialog -- groups, dependencies between
parameters, validation -- with no toolkit anywhere, so it is testable
headless and a Swing or JavaFX binding renders it. Prototyped against the
four dialog behaviours actually asked for, each of which taught
something.
A chosen implementation brings its own parameters, and expansion must be
driven by the value's class rather than the declared type: the field says
Joke, the value is a knock-knock joke, and it is the joke's parameters
that appear. Expanding the declared type finds nothing, an interface
having no fields, so Structs.expand and its static childStruct() are not
enough. Static nesting is then the degenerate case where the value's
class never varies, which is what makes one concept cover both.
A group whose size depends on a value cannot be fields at all, since a
class's fields are fixed when it is compiled. It needs parameters built
at runtime -- exactly what a script header needs -- so both are now served
by Parameters.builder(), members over a map. Two requirements that looked
unrelated turned out to be one primitive, and the fake-script test
written earlier as a throwaway became the shipped mechanism.
Callbacks now work for scripts, which SciJava Common never managed: it
resolved callback names by Java reflection, so a script had nothing to
name. ExecutableInstance.behavior(String) resolves a name however that
kind of code does. Cascading callbacks terminate: a callback may change
anything, and two parameters that set each other -- Celsius and
Fahrenheit -- would otherwise never stop, so each callback runs at most
once per set.
Validation has one protocol: return a message, or do not. Allowing a
validator to either throw or return a string is why SciJava Common needs
both validate and validateMessage.
Two bugs found on the way: only one of the two executable paths resolved
behaviors, so visibleWhen and generators silently did nothing; and the
no-container reflection path needed addReads for the same reason the
container's does, which fully open modules disguised until now.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013gJpzGd3ksbME4CN6Tu2ni
0 commit comments