public final EventHandler<ActionEvent> getOnAction ()

taken from field

The action, which is invoked whenever the MenuItem is fired. This may be due to the user clicking on the button with the mouse, or by a touch event, or by a key press, or if the developer programatically invokes the fire() method.