checkstyle sweep
[fanfix.git] / src / jexer / TButton.java
index c05a4b1025be40ec9bf7e76c858a9c0bba404c78..064e927566effd281321502a7ad02031012fff84 100644 (file)
@@ -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.
      *