X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fjexer%2FTButton.java;h=064e927566effd281321502a7ad02031012fff84;hb=3649b9210ea425f398ba8c24f9509669cf72aa96;hp=c05a4b1025be40ec9bf7e76c858a9c0bba404c78;hpb=daa4106c096cd4d2b92c3cbae6491edccd25fcc4;p=fanfix.git diff --git a/src/jexer/TButton.java b/src/jexer/TButton.java index c05a4b1..064e927 100644 --- a/src/jexer/TButton.java +++ b/src/jexer/TButton.java @@ -56,7 +56,7 @@ public final class TButton extends TWidget { * * @return mnemonic string */ - public final MnemonicString getMnemonic() { + public MnemonicString getMnemonic() { return mnemonic; } @@ -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. *