Class ClickCommand

java.lang.Object
com.oorian.messaging.commands.Command
com.oorian.messaging.commands.ClickCommand

public class ClickCommand extends Command
Command to programmatically trigger a click event on a DOM element.

This command simulates a user click on the specified element, firing all associated click event handlers and default behaviors as if the element was actually clicked.

Features:

  • Programmatically triggers click events
  • Targets specific DOM elements by ID
  • Activates all associated event handlers
  • Useful for automated workflows and testing

Usage:


 // Trigger a click on a button
 ClickCommand click = new ClickCommand("submitButton");
 JsonObject json = click.toJson();
 
Since:
2007
Version:
1.0
Author:
Marvin P. Warble Jr.
See Also:
  • Constructor Details

    • ClickCommand

      public ClickCommand(String elementId)
      Constructs a new ClickCommand to trigger a click on the specified element.
      Parameters:
      elementId - the ID of the DOM element to click
  • Method Details

    • toJson

      public JsonObject toJson()
      Generates the JSON representation of this click command.

      The JSON includes the command ID and target element ID.

      Specified by:
      toJson in class Command
      Returns:
      a JsonObject containing the click command attributes