Package com.oorian.messaging.commands
Class SetFocusCommand
java.lang.Object
com.oorian.messaging.commands.Command
com.oorian.messaging.commands.SetFocusCommand
Command to set keyboard focus on a specific DOM element.
This command programmatically sets the keyboard focus to the specified element, similar to when a user clicks on an input field or tabs to it. This is useful for improving user experience by directing attention to specific form fields or interactive elements.
Features:
- Sets keyboard focus on any focusable element
- Targets elements by ID
- Improves form navigation and accessibility
- Enables guided user workflows
Usage:
// Set focus on a login username field
SetFocusCommand focus = new SetFocusCommand("usernameInput");
JsonObject json = focus.toJson();
- Since:
- 2007
- Version:
- 1.0
- Author:
- Marvin P. Warble Jr.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionSetFocusCommand(String elementId) Constructs a new SetFocusCommand to set focus on the specified element. -
Method Summary
Modifier and TypeMethodDescriptiontoJson()Generates the JSON representation of this set focus command.Methods inherited from class com.oorian.messaging.commands.Command
getElementId, getId, setElementId, toString
-
Constructor Details
-
SetFocusCommand
Constructs a new SetFocusCommand to set focus on the specified element.- Parameters:
elementId- the ID of the element to focus
-
-
Method Details