feature request: disable Button from plugin callback

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

feature request: disable Button from plugin callback

Adrian Daerr
Hello all,

It would be nice if a org.scijava.widget.Button could
be disabled (e.g. grayed out) and enabled in the UI parameter
harvesting dialog (from within some @Parameter callback) if the
current parameters do not allow its action.

This seems different from the problems associated with dynamically
changing parameter number and/or properties [1], as no reconfiguration
of the UI is required beyond a redraw. The widget should still be
displayed, only its status toggled (one could e.g. add the enabling
condition to the description/tooltip to give the user a hint).

Does this sound reasonable or should such a feature be included in
tracker issue 42 [1]?

cheers,
Adrian

[1] https://github.com/scijava/scijava-common/issues/42
"Allow plugin parameters to be hidden"

_______________________________________________
ImageJ-devel mailing list
[hidden email]
http://imagej.net/mailman/listinfo/imagej-devel
Reply | Threaded
Open this post in threaded view
|

Re: feature request: disable Button from plugin callback

Curtis Rueden
Hi Adrian,

Yes, I suggest commenting on issue 42. In that issue, I wrote that graying out makes less sense than setting visible/invisible, though I am not sure that's really true in every case. Worth having a discussion there.

And note that technically in code, there is little difference between calling widget.setVisible(false) and widget.setEnabled(false). The former makes the widget disappear, and the latter grays it out. (I can't remember whether the containing ancestor panes automatically redo their layout when setVisible on a child component is called, though.)

Regards,
Curtis

On Fri, Aug 28, 2015 at 11:59 AM, Adrian Daerr <[hidden email]> wrote:
Hello all,

It would be nice if a org.scijava.widget.Button could
be disabled (e.g. grayed out) and enabled in the UI parameter
harvesting dialog (from within some @Parameter callback) if the
current parameters do not allow its action.

This seems different from the problems associated with dynamically
changing parameter number and/or properties [1], as no reconfiguration
of the UI is required beyond a redraw. The widget should still be
displayed, only its status toggled (one could e.g. add the enabling
condition to the description/tooltip to give the user a hint).

Does this sound reasonable or should such a feature be included in tracker issue 42 [1]?

cheers,
Adrian

[1] https://github.com/scijava/scijava-common/issues/42
"Allow plugin parameters to be hidden"

_______________________________________________
ImageJ-devel mailing list
[hidden email]
http://imagej.net/mailman/listinfo/imagej-devel


_______________________________________________
ImageJ-devel mailing list
[hidden email]
http://imagej.net/mailman/listinfo/imagej-devel