Class ThemeEditorMessageHandler
java.lang.Object
com.vaadin.copilot.CopilotCommand
com.vaadin.copilot.plugins.themeeditor.ThemeEditorMessageHandler
- All Implemented Interfaces:
HasSourceModifier,HasThemeModifier
public class ThemeEditorMessageHandler
extends CopilotCommand
implements HasSourceModifier, HasThemeModifier
Handler for ThemeEditor debug window communication messages. Responsible for
preparing data for
ThemeModifier and
JavaSourceModifier.-
Field Summary
Fields inherited from class com.vaadin.copilot.CopilotCommand
currentSession, KEY_CANCEL_REQ_ID, KEY_REQ_ID -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancanBeParallelCommand(String command) Checks if given command can be handled asynchronously.booleanChecks if given command can be handled by ThemeEditor.handleDebugMessageData(String command, tools.jackson.databind.JsonNode data) Handles debug message command and performs given action.booleanhandleMessage(String command, tools.jackson.databind.JsonNode data, com.vaadin.base.devserver.DevToolsInterface devToolsInterface) Called whenever there is a message from the browser.protected voidMethods inherited from class com.vaadin.copilot.CopilotCommand
getProjectFileManager, getVaadinContext, getVaadinSession, handleConnect
-
Constructor Details
-
ThemeEditorMessageHandler
public ThemeEditorMessageHandler()
-
-
Method Details
-
getSourceModifier
- Specified by:
getSourceModifierin interfaceHasSourceModifier
-
getThemeModifier
- Specified by:
getThemeModifierin interfaceHasThemeModifier
-
canHandle
Checks if given command can be handled by ThemeEditor.- Parameters:
command- command to be verified if supporteddata- data object to be verified if is of proper structure- Returns:
- true if it can be handled, false otherwise
-
handleDebugMessageData
Handles debug message command and performs given action.- Parameters:
command- Command namedata- Command data- Returns:
- response in form of JsonNode
-
registerHandlers
protected void registerHandlers() -
handleMessage
public boolean handleMessage(String command, tools.jackson.databind.JsonNode data, com.vaadin.base.devserver.DevToolsInterface devToolsInterface) Description copied from class:CopilotCommandCalled whenever there is a message from the browser. Implementations should check if the command is for them, handle it and return true if the command was handled.- Specified by:
handleMessagein classCopilotCommand- Parameters:
command- the command to handledata- the data for the commanddevToolsInterface- the devtools interface for the connection- Returns:
- true if the command was handled, false otherwise
-
canBeParallelCommand
Description copied from class:CopilotCommandChecks if given command can be handled asynchronously. If the handler can't be asynchronous at all, it can return false always. But if you want to handle one or more commands asynchronously, you should specify the exact command to prevent handling commands that are not part of the handler as asynchronous.- Overrides:
canBeParallelCommandin classCopilotCommand- Parameters:
command- the command to check- Returns:
- true if the command can be handled by this command handler
-