X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fjexer%2FTButton.java;h=fb8c08e35c4c3a48b6361036837d308c7eb3b9cc;hb=8582f35a3ffb8212463076217eb89278f42331d4;hp=0fc36a2de2afac6f682e44af5e930289c9cbb60a;hpb=0d47c5460c8e9d1198928308767a63ad35f46eb8;p=fanfix.git diff --git a/src/jexer/TButton.java b/src/jexer/TButton.java index 0fc36a2..fb8c08e 100644 --- a/src/jexer/TButton.java +++ b/src/jexer/TButton.java @@ -1,4 +1,4 @@ -/** +/* * Jexer - Java Text User Interface * * License: LGPLv3 or later @@ -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. *