Class XTermBase

java.lang.Object
com.vaadin.flow.component.Component
com.flowingcode.vaadin.addons.xterm.XTermBase
All Implemented Interfaces:
ITerminal, ITerminalOptions, AttachNotifier, DetachNotifier, HasElement, HasEnabled, HasSize, HasStyle, Serializable
Direct Known Subclasses:
XTerm

@NpmPackage(value="xterm", version="5.1.0") @JsModule("./fc-xterm/xterm-element.ts") @CssImport("xterm/css/xterm.css") public abstract class XTermBase extends Component implements ITerminal, ITerminalOptions, HasSize, HasEnabled
Server-side component for the XTerm component.
See Also:
  • Constructor Details

    • XTermBase

      public XTermBase()
      Constructs a new instance of XTerm
  • Method Details

    • executeJs

      protected void executeJs(String expression, Serializable... parameters)
    • addCustomKeyListener

      public Registration addCustomKeyListener(DomEventListener listener, Key key, KeyModifier... modifiers)
      Add a server-side key listener. This method is equivalent to calling addCustomKeyListener(DomEventListener, Key, KeyModifier...) with a KeyLocation of null.
      Returns:
      a registration for the listener.
    • addCustomKeyListener

      public Registration addCustomKeyListener(DomEventListener listener, Key key, KeyLocation location, KeyModifier... modifiers)
      Add a server-side key listener.
      Returns:
      a registration for the listener.
    • setEnabled

      public void setEnabled(boolean enabled)
      Specified by:
      setEnabled in interface HasEnabled
    • getAddon

      public <T extends TerminalAddon> T getAddon(Class<? extends T> clazz)
      Retrieves a registered server-side add-on instance of a specific type.

      Example usage:

      
       MySpecificAddon addon = terminal.getAddon(MySpecificAddon.class);
       if (addon != null) {
         addon.doSomethingSpecific();
       }
       
      Type Parameters:
      T - the type of the add-on to retrieve. This is inferred from the clazz parameter.
      Parameters:
      clazz - the Class object representing the type of the add-on to retrieve. Must not be null.
      Returns:
      the registered add-on instance that is of the specified Class<T>, or null if no such add-on is found
      Throws:
      NullPointerException - if clazz is null