com.vaadin.copilot.
Class Copilot
All Implemented Interfaces:
This is the entry point for copilot.
It is a singleton with the main purpose to forward messages to the correct CopilotSession instance, based on which session the message is related to.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
static final String
static final Supplier<IllegalStateException>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
handleConnect
(DevToolsInterface devToolsInterface) Called when a browser connects.
boolean
handleMessage
(String command, elemental.json.JsonObject data, DevToolsInterface devToolsInterface) Called when a message from the browser arrives.
static boolean
Check if copilot is running in development mode i.e.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.vaadin.base.devserver.DevToolsMessageHandler
handleDisconnect
-
Field Details
-
PREFIX
See Also:
-
ISSUE_TRACKER
See Also:
-
sourceNotFound
-
-
Constructor Details
-
Copilot
public Copilot()
-
-
Method Details
-
handleConnect
Description copied from interface:
DevToolsMessageHandler
Called when a browser connects.
This happens on each refresh but also when the application is opened in a new browser tab or window.
Specified by:
handleConnect
in interfaceDevToolsMessageHandler
Parameters:
devToolsInterface
- for interaction with the development tools, e.g. sending a message -
handleMessage
public boolean handleMessage(String command, elemental.json.JsonObject data, DevToolsInterface devToolsInterface) Description copied from interface:
DevToolsMessageHandler
Called when a message from the browser arrives.
Specified by:
handleMessage
in interfaceDevToolsMessageHandler
Parameters:
command
- the command receiveddata
- the data receiveddevToolsInterface
- for interaction with the development tools, e.g. sending a messageReturns:
true
if the message was handled and should not be passed on to further handlers -
isDevelopmentMode
public static boolean isDevelopmentMode()Check if copilot is running in development mode i.e. is being developed.
Unrelated to Vaadin's production mode.
Returns:
true if copilot is running in development mode
-