X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fjexer%2FTButton.java;h=30e94edc45339c067dbcb23231de6e445956ec09;hb=91c9a8376f979d2b3df43f14519a30a183d332c5;hp=0fc36a2de2afac6f682e44af5e930289c9cbb60a;hpb=847a4bc53c549c277d479ee904ab45be7f5e4dec;p=fanfix.git diff --git a/src/jexer/TButton.java b/src/jexer/TButton.java index 0fc36a2..30e94ed 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. *