Package com.oorian.messaging.commands
Class SelectTextCommand
java.lang.Object
com.oorian.messaging.commands.Command
com.oorian.messaging.commands.SelectTextCommand
Command to select all text within a text input or textarea element.
This command programmatically selects all the text content within the specified input element, similar to when a user triple-clicks or uses Ctrl+A. This is useful for improving user experience by pre-selecting text for copying or replacement.
Features:
- Selects all text in input elements
- Targets text inputs and textareas by ID
- Improves user experience for form interactions
- Enables programmatic text selection workflows
Usage:
// Select all text in an input field
SelectTextCommand select = new SelectTextCommand("usernameInput");
JsonObject json = select.toJson();
- Since:
- 2007
- Version:
- 1.0
- Author:
- Marvin P. Warble Jr.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionSelectTextCommand(String elementId) Constructs a new SelectTextCommand to select all text in the specified element. -
Method Summary
Modifier and TypeMethodDescriptiontoJson()Generates the JSON representation of this select text command.Methods inherited from class com.oorian.messaging.commands.Command
getElementId, getId, setElementId, toString
-
Constructor Details
-
SelectTextCommand
Constructs a new SelectTextCommand to select all text in the specified element.- Parameters:
elementId- the ID of the text input or textarea element
-
-
Method Details