Class SetFocusAndSelectCommand

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

public class SetFocusAndSelectCommand extends Command
Command that sets focus on an input element and selects all of its text content.

This command is useful for directing user attention to an input field and pre-selecting its contents so the user can immediately type a replacement value.

  • Constructor Details

    • SetFocusAndSelectCommand

      public SetFocusAndSelectCommand(String elementId)
      Creates a SetFocusAndSelectCommand for the specified element.
      Parameters:
      elementId - the ID of the input element to focus and select
  • 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