Posted by
Michael Schmid on
Jul 02, 2009; 8:47am
URL: http://imagej.273.s1.nabble.com/setYesLabel-and-setNoLabel-tp3691928p3691932.html
Hi Eirinn,
GenericDialog has a
public void setOKLabel(String label)
method that you can use. There is nothing like this for 'cancel'
Misusing 'Cancel' for something else may also have unwanted side
effects, e.g., aborting a macro on gd.wasCanceled().
Pprobably you will need a 'cancel' button anyhow, e.g., in case the
user finds out that he has added the wrong file. If you really don't
want it, use the public void hideCancelButton() method.
You will have to add a panel for the "Add file" button, and your
plugin should be an ActionListener to that button.
ij.plugin.LUT_Editor is an example for this.
If you want to run it from a macro, you will have to care about the
operation of the 'add file' button for yourself; GenericDialog won't
do it for you (in contrast to the other input types).
Michael
________________________________________________________________
On 2 Jul 2009, at 03:25, Eirinn Mackay wrote:
> Hi,
> I'm building a GUI for my plugin and I've just realised I could
> achieve quite a bit with the GenericDialog if I could set the
> captions of the Yes and No buttons. In my case, I want the no
> button to say "Add another file" and the yes button to say "Run
> batch". I think this is a very simple way of making the generic
> dialog more versatile.
> So would it be possible to add two more functions to the
> GenericDialog class?
> Kind regards,
> Eirinn
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> Eirinn Mackay
> Research Assistant
> Bartlett Group L6
> Queensland Brain Institute
> Brisbane, Australia
> 07 334 66381