Closed stelfrich closed 7 years ago
This is definitely a step forward, so merging!
I do have this intuition that using toString()
for the objects in these combo boxes is not going to cut the mustard somehow... @dietzc and I are doing the same thing with the revamped widget framework, but I can't shake the feeling that there will be edge cases. In some cases perhaps toString()
is being used for too many conflicting things (e.g. it is used for debugging SciJava events). Or perhaps we cannot override toString()
for certain types of objects whose code we don't control.
A more flexible solution might be to preferentially support another method such as Named#getName()
method in cases where the thing implements Named
.
For now though, I am OK with this being a problem for future @ctrueden. 😝
A more flexible solution might be to preferentially support another method such as
Named#getName()
method in cases where the thing implementsNamed
.
I'll file an issue to remind future @ctrueden 👍 . But where would that actually live? scijava-ui-swing
because the drop downs for image selections are ObjectWidget
s (I haven't completely grasped that part yet..)?
Filing it in scijava-common
for now is fine. It is a decision that needs to be made independent of specific UI implementations. Just documented somewhere, like in the ObjectWidget
interface perhaps.
Fixes an issue when showing a selection dialog for
ImagePlus
parameters in a Swing UI. In that case, the dropdown for selecting an image gets populated withtoString
representations of the usable objects (ImageDisplay
among others).