Class ClientTerminalAddon
java.lang.Object
com.flowingcode.vaadin.addons.xterm.TerminalAddon
com.flowingcode.vaadin.addons.xterm.ClientTerminalAddon
- All Implemented Interfaces:
Serializable
Represents an abstract base class for server-side terminal add-ons that have a corresponding
client-side (JavaScript) component or require interaction with the client-side terminal
environment. It extends
TerminalAddon and specializes its use for client-aware
operations.- Author:
- Javier Godoy / Flowing Code S.A.
- See Also:
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedClientTerminalAddon(XTermBase xterm) Constructs a newClientTerminalAddonand associates it with the specifiedXTermBaseinstance. -
Method Summary
Modifier and TypeMethodDescriptionprotected final voidexecuteJs(String expression, Serializable... parameters) Executes a JavaScriptexpressionin the context of this add-on, with the specifiedparameters.protected abstract StringgetName()Retrieves the unique name of this client-side add-on.protected XTermBasegetXterm()The xterm instance that this add-on is associated with.
-
Constructor Details
-
ClientTerminalAddon
Constructs a newClientTerminalAddonand associates it with the specifiedXTermBaseinstance.This constructor ensures the add-on is registered with the terminal and verifies that the add-on's name, as returned by
getName(), is notnull. A non-null name is required for client-side add-ons to be uniquely identified and targeted for JavaScript execution.- Parameters:
xterm- theXTermBaseinstance this add-on will be attached to. Must not benull.- Throws:
NullPointerException- ifxtermisnullIllegalStateException- ifgetName()returnsnullimmediately after superclass construction. This check relies ongetName()being a static value.
-
-
Method Details
-
getXterm
The xterm instance that this add-on is associated with. -
getName
Retrieves the unique name of this client-side add-on.This name is used by
executeJs(String, Serializable...)to target the corresponding JavaScript object on the client (i.e.,this.addons[name]within the client-side terminal's scope). The name effectively acts as a key in a client-side add-ons collection managed by the terminal.- Returns:
- the unique, non-null string identifier for the client-side counterpart of this add-on. Subclasses must implement this to provide a name for add-on-specific JavaScript execution.
-
executeJs
Executes a JavaScriptexpressionin the context of this add-on, with the specifiedparameters.
-