Class NoVNCConsole

java.lang.Object
com.vaadin.flow.component.Component
de.bytestore.hostinger.components.novnc.NoVNCConsole
All Implemented Interfaces:
com.vaadin.flow.component.AttachNotifier, com.vaadin.flow.component.DetachNotifier, com.vaadin.flow.component.HasElement, com.vaadin.flow.component.HasSize, com.vaadin.flow.component.HasStyle, Serializable

@Tag("novnc-console") @NpmPackage(value="jquery",version="1.9.1") @NpmPackage(value="@novnc/novnc",version="1.5.0") @CssImport("./src/novnc-console/novnc-console.css") @JsModule("./src/novnc-console/novnc-console.js") public class NoVNCConsole extends com.vaadin.flow.component.Component implements com.vaadin.flow.component.HasSize
See Also:
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
     
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
    static final String
     
    static final String
     
    static final String
     
    static final String
     
    static final String
     
    static final String
     
    static final String
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a component instance with an element created based on the Tag annotation of the sub class.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Connects to the specified server.
    void
    Disconnects the connection to the server.
    Returns the hostname value for the NoVNCConsole.
    Retrieves the logging value for the NoVNCConsole.
    boolean
    Returns whether the NoVNCConsole is currently connected.
    boolean
    Returns the read-only state of the NoVNCConsole.
    void
    Triggers the paste operation by invoking the "paste" JavaScript function associated with the element.
    void
    sendKey(int keyIO, Boolean stateIO)
    Sends a key event to the associated NoVNCConsole.
    void
    setFullscreen(boolean valueIO)
    Sets the fullscreen state of the NoVNCConsole.
    void
    Sets the hostname value for the NoVNCConsole.
    void
    setLogging(String loggingIO)
    Sets the logging IO for the NoVNCConsole.
    void
    Sets the password value for the NoVNCConsole.
    void
    setReadOnly(boolean valueIO)
    Sets the read-only state of the NoVNCConsole.
    void
    Sets the username value for the NoVNCConsole.

    Methods inherited from class com.vaadin.flow.component.Component

    findAncestor, from, getChildren, getElement, getId, getParent, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getUI, isAttached, isVisible, onEnabledStateChanged, removeFromParent, scrollIntoView, scrollIntoView, setId, setVisible

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface com.vaadin.flow.component.AttachNotifier

    addAttachListener

    Methods inherited from interface com.vaadin.flow.component.DetachNotifier

    addDetachListener

    Methods inherited from interface com.vaadin.flow.component.HasElement

    getElement

    Methods inherited from interface com.vaadin.flow.component.HasSize

    getHeight, getHeightUnit, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getWidth, getWidthUnit, setHeight, setHeight, setHeightFull, setMaxHeight, setMaxHeight, setMaxWidth, setMaxWidth, setMinHeight, setMinHeight, setMinWidth, setMinWidth, setSizeFull, setSizeUndefined, setWidth, setWidth, setWidthFull

    Methods inherited from interface com.vaadin.flow.component.HasStyle

    addClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassName
  • Field Details

  • Constructor Details

    • NoVNCConsole

      public NoVNCConsole()
      Creates a component instance with an element created based on the Tag annotation of the sub class.

      If this is invoked through Component.from(Element, Class) or Element#as(Class), uses the element defined in those methods instead of creating a new element.

  • Method Details

    • getHostname

      public String getHostname()
      Returns the hostname value for the NoVNCConsole.
      Returns:
      the hostname value, or null if not set
    • setHostname

      public void setHostname(String valueIO)
      Sets the hostname value for the NoVNCConsole.
      Parameters:
      valueIO - the new hostname value to be set
    • getLogging

      public String getLogging()
      Retrieves the logging value for the NoVNCConsole.
      Returns:
      the logging value, or null if not set
    • setLogging

      public void setLogging(String loggingIO)
      Sets the logging IO for the NoVNCConsole.
      Parameters:
      loggingIO - the new logging IO to be set
    • isConnected

      @Synchronize(property="connection", value="novnc-connection-changed") public boolean isConnected()
      Returns whether the NoVNCConsole is currently connected.
      Returns:
      true if the NoVNCConsole is connected, false if not connected
    • setPassword

      public void setPassword(String valueIO)
      Sets the password value for the NoVNCConsole.
      Parameters:
      valueIO - the new password value to be set
    • setUsername

      public void setUsername(String valueIO)
      Sets the username value for the NoVNCConsole.
      Parameters:
      valueIO - the new username value to be set
    • isReadOnly

      public boolean isReadOnly()
      Returns the read-only state of the NoVNCConsole.
      Returns:
      true if the NoVNCConsole is read-only, false otherwise
    • setReadOnly

      public void setReadOnly(boolean valueIO)
      Sets the read-only state of the NoVNCConsole.
      Parameters:
      valueIO - the boolean value indicating whether the NoVNCConsole should be set as read-only
    • setFullscreen

      public void setFullscreen(boolean valueIO)
      Sets the fullscreen state of the NoVNCConsole.
      Parameters:
      valueIO - the boolean value indicating whether the NoVNCConsole should be set as fullscreen
    • connect

      public void connect()
      Connects to the specified server.
    • sendKey

      public void sendKey(int keyIO, Boolean stateIO)
      Sends a key event to the associated NoVNCConsole.
      Parameters:
      keyIO - the key to be sent
      stateIO - the state of the key, where true represents key press and false represents key release
    • pasteClipboard

      public void pasteClipboard()
      Triggers the paste operation by invoking the "paste" JavaScript function associated with the element. This method allows pasting content from the system clipboard into the appropriate context within the NoVNCConsole component.
    • disconnect

      public void disconnect()
      Disconnects the connection to the server. This method calls the "disconnect" JavaScript function of the associated element.