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 -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCreates a component instance with an element created based on theTagannotation of the sub class. -
Method Summary
Modifier and TypeMethodDescriptionvoidconnect()Connects to the specified server.voidDisconnects the connection to the server.Returns the hostname value for the NoVNCConsole.Retrieves the logging value for the NoVNCConsole.booleanReturns whether the NoVNCConsole is currently connected.booleanReturns the read-only state of the NoVNCConsole.voidTriggers the paste operation by invoking the "paste" JavaScript function associated with the element.voidSends a key event to the associated NoVNCConsole.voidsetFullscreen(boolean valueIO) Sets the fullscreen state of the NoVNCConsole.voidsetHostname(String valueIO) Sets the hostname value for the NoVNCConsole.voidsetLogging(String loggingIO) Sets the logging IO for the NoVNCConsole.voidsetPassword(String valueIO) Sets the password value for the NoVNCConsole.voidsetReadOnly(boolean valueIO) Sets the read-only state of the NoVNCConsole.voidsetUsername(String valueIO) 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, setVisibleMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.vaadin.flow.component.AttachNotifier
addAttachListenerMethods inherited from interface com.vaadin.flow.component.DetachNotifier
addDetachListenerMethods inherited from interface com.vaadin.flow.component.HasElement
getElementMethods 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, setWidthFullMethods inherited from interface com.vaadin.flow.component.HasStyle
addClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassName
-
Field Details
-
VALUE_HOSTNAME
- See Also:
-
VALUE_READONLY
- See Also:
-
VALUE_FULLSCREEN
- See Also:
-
VALUE_PASSWORD
- See Also:
-
VALUE_LOGGING
- See Also:
-
VALUE_USERNAME
- See Also:
-
VALUE_CONNECTION
- See Also:
-
EVENT_CONNECTION_CHANGED
- See Also:
-
-
Constructor Details
-
NoVNCConsole
public NoVNCConsole()Creates a component instance with an element created based on theTagannotation of the sub class.If this is invoked through
Component.from(Element, Class)orElement#as(Class), uses the element defined in those methods instead of creating a new element.
-
-
Method Details
-
getHostname
Returns the hostname value for the NoVNCConsole.- Returns:
- the hostname value, or null if not set
-
setHostname
Sets the hostname value for the NoVNCConsole.- Parameters:
valueIO- the new hostname value to be set
-
getLogging
Retrieves the logging value for the NoVNCConsole.- Returns:
- the logging value, or null if not set
-
setLogging
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
Sets the password value for the NoVNCConsole.- Parameters:
valueIO- the new password value to be set
-
setUsername
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
Sends a key event to the associated NoVNCConsole.- Parameters:
keyIO- the key to be sentstateIO- 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.
-