X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fjexer%2FTButton.java;fp=src%2Fjexer%2FTButton.java;h=fb8c08e35c4c3a48b6361036837d308c7eb3b9cc;hb=8582f35a3ffb8212463076217eb89278f42331d4;hp=c05a4b1025be40ec9bf7e76c858a9c0bba404c78;hpb=daa4106c096cd4d2b92c3cbae6491edccd25fcc4;p=nikiroo-utils.git diff --git a/src/jexer/TButton.java b/src/jexer/TButton.java index c05a4b1..fb8c08e 100644 --- a/src/jexer/TButton.java +++ b/src/jexer/TButton.java @@ -75,6 +75,16 @@ public final class TButton extends TWidget { */ private TAction action; + /** + * Act as though the button was pressed. This is useful for other UI + * elements to get the same action as if the user clicked the button. + */ + public void dispatch() { + if (action != null) { + action.DO(); + } + } + /** * Private constructor. *