Class SetFocusAndValueCommand

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

public class SetFocusAndValueCommand extends Command
Command that sets focus on an input element and assigns it a new value.

This command focuses the specified element and updates its value in a single operation, useful for programmatically populating and focusing an input field.

  • Constructor Details

    • SetFocusAndValueCommand

      public SetFocusAndValueCommand(String elementId, String value)
      Creates a SetFocusAndValueCommand for the specified element and value.
      Parameters:
      elementId - the ID of the input element to focus
      value - the value to set on the element
  • Method Details

    • toJson

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

      Subclasses must implement this method to provide their specific JSON structure for serialization and transmission to the client.

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