Class ClientTerminalAddon

java.lang.Object
com.flowingcode.vaadin.addons.xterm.TerminalAddon
com.flowingcode.vaadin.addons.xterm.ClientTerminalAddon
All Implemented Interfaces:
Serializable

public abstract class ClientTerminalAddon extends TerminalAddon
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 Details

    • ClientTerminalAddon

      protected ClientTerminalAddon(XTermBase xterm)
      Constructs a new ClientTerminalAddon and associates it with the specified XTermBase instance.

      This constructor ensures the add-on is registered with the terminal and verifies that the add-on's name, as returned by getName(), is not null. A non-null name is required for client-side add-ons to be uniquely identified and targeted for JavaScript execution.

      Parameters:
      xterm - the XTermBase instance this add-on will be attached to. Must not be null.
      Throws:
      NullPointerException - if xterm is null
      IllegalStateException - if getName() returns null immediately after superclass construction. This check relies on getName() being a static value.
  • Method Details

    • getXterm

      protected XTermBase getXterm()
      The xterm instance that this add-on is associated with.
    • getName

      protected abstract String 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

      protected final void executeJs(String expression, Serializable... parameters)
      Executes a JavaScript expression in the context of this add-on, with the specified parameters.
      See Also: