Merge branch 'master' of https://github.com/klamonte/jexer
[nikiroo-utils.git] / src / jexer / TButton.java
index c05a4b1025be40ec9bf7e76c858a9c0bba404c78..fb8c08e35c4c3a48b6361036837d308c7eb3b9cc 100644 (file)
@@ -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.
      *