-
Notifications
You must be signed in to change notification settings - Fork 52
Allow plugin parameters to be hidden #42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I wonder whether it is not worth making a special case of purely UI If the UI doesn't support graying out then setting invisible or even [2] see also |
Rather than adding an 'active' state, a more generic solution might be to add a visibilityFunction attribute to declare a method (as Java calls them...) which returns a value for 'visibility', or allowing the visibility attribute to take a method name, similar to 'callback'. Then on initialisation and when any parameter is modified the visibilityFunctions can be called and the UI harvester redrawn if there are any changes. Given an ItemVisibility.HIDDEN option, some code to toggle visibility of secondary (advanced settings) parameters might look like this:
Adding an ItemVisibility.DISABLED option would also make it straightforward to provide the familiar UX that adaerr described. Obviously developers would need to take care not to run computationally expensive code in these functions to prevent lag in the GUI. |
I'm not sure about the current status of the parameter visibility implementation. When testing with scripts, only the #@String(visibility=NORMAL, value="T1") t1
#@String(visibility=TRANSIENT, value="T2") t2
#@String(visibility=INVISIBLE, value="T3") t3
#@String(visibility=MESSAGE, value="T4") t4
println t1
println t2
println t3
println t4 As stated in the posts above, it would be very useful to have some possibility to dynamically set the visibility of an input item on a UI level, e.g. by greying out mutually exclusive options dependent on the state of another (boolean or choice) parameter. This goes in line with improving the parameter validation, see #47. |
We were wondering what the status on this issue was, @ctrueden? Especially with respect to (macro) recording of /cc @milkyklim |
@stelfrich wrote:
This is unrelated to visibility of parameters in UI widgets, no? In general, |
@dietzc and I actually made big progress on related issues during the still-ongoing Konstanz hackathon. It's on the dev branch of scijava/scijava right now, but the goal is to move it to scijava-common or scijava-types soon. This will be part of SJC3 and a revamped widget framework, with a goal of releasing something as part of the December hackathon in Dresden. With this scheme, you won't need all these callbacks to enable or disable parameters, in the case where the value of a dropdown box controls which controls are visible. Here is a proof-of-concept preview (UI still needs polish): For those scrutinizing the code, please also note that the use of the |
It is: sorry 😞 ! This issue was the first one that turned up during a search...
Thanks for the update, @ctrueden! |
@ctrueden Looks very good to me! I think that'd be very useful! |
@ctrueden, when do you think this feature will be released? You said that you were thinking of doing it last December, but it's been a while since then. |
@sudgy We are actively working on SciJava 3 / SciJava Ops during the next 3 months, and the updated widget framework is part of that work. I doubt I will work on adding the ability to hide plugin parameters to SciJava 2 (the currently released incarnation). I cannot promise when it will be released, but in general, SciJava 3 is a high priority. |
Yeah, I'm honestly not really any good with GUIs, I just got the bare minimum done for my purposes. If anybody wants to make a more modern implementation of DPDialog, be my guest. |
This issue has been mentioned on Image.sc Forum. There might be relevant details there: |
This issue has been mentioned on Image.sc Forum. There might be relevant details there: https://forum.image.sc/t/access-to-imagej2-input-harvester-generated-elements/49338/3 |
This issue has been mentioned on Image.sc Forum. There might be relevant details there: https://forum.image.sc/t/dynamiccommand-not-displaying-without-error/60767/7 |
This issue has been mentioned on Image.sc Forum. There might be relevant details there: |
Some modules may have differing inputs depending on the values of other inputs. For example, a thresholding plugin where you select which thresholding method to use may activate or deactivate certain secondary parameters depending on the method chosen.
I.e.: Command implementers might want the ability to show and hide parameters based on the settings of some current parameter. This could be done via its callback mechanism. Change the various UI harvester implementations to allow this behavior.
We could implement this by adding an "active" boolean state to each input. All inactive inputs are hidden in the UI. Also, all inputs inactive at the time the module is run would not be included when recording a script of that module execution.
Note: for simplicity and non-gui UIs, hiding parameters makes more sense than adding/deleting parameters.
Migrated-From: http://trac.imagej.net/ticket/683, http://trac.imagej.net/ticket/885
The text was updated successfully, but these errors were encountered: