Class ClickTrigger

All Implemented Interfaces:
Serializable

public class ClickTrigger extends MouseEventTrigger
Fires on the host component's click DOM event. The event's coordinates and modifier-key state are available as static Action.Input sources on MouseEventTrigger.EventData (also reachable as ClickTrigger.EventData through inheritance).

Example — on click, mirror the screen coordinates of the click into two input fields' value properties:


 ClickTrigger click = new ClickTrigger(button);
 click.triggers(
         new SetPropertyAction<>(xField, "value",
                 ClickTrigger.EventData.screenX),
         new SetPropertyAction<>(yField, "value",
                 ClickTrigger.EventData.screenY));
 

For internal use only. May be renamed or removed in a future release.

See Also:
  • Constructor Details

    • ClickTrigger

      public ClickTrigger(Component host)
      Creates a click trigger on the given host component's root element.
      Parameters:
      host - the component to listen on, not null