Class ThemeEditorMessageHandler
java.lang.Object
com.vaadin.copilot.plugins.themeeditor.ThemeEditorMessageHandler
- All Implemented Interfaces:
DevToolsMessageHandler,HasSourceModifier,HasThemeModifier
public class ThemeEditorMessageHandler
extends Object
implements HasSourceModifier, HasThemeModifier, DevToolsMessageHandler
Handler for ThemeEditor debug window communication messages. Responsible for
preparing data for
ThemeModifier and
JavaSourceModifier.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanChecks if given command can be handled by ThemeEditor.voidhandleConnect(DevToolsInterface devToolsInterface) Called when a browser connects.handleDebugMessageData(String command, elemental.json.JsonObject data) Handles debug message command and performs given action.booleanhandleMessage(String command, elemental.json.JsonObject data, DevToolsInterface devToolsInterface) Called when a message from the browser arrives.booleanprotected voidMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.vaadin.base.devserver.DevToolsMessageHandler
handleDisconnect
-
Constructor Details
-
ThemeEditorMessageHandler
public ThemeEditorMessageHandler()
-
-
Method Details
-
isEnabled
public boolean isEnabled() -
getStateMessage
-
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 JsonObject
-
registerHandlers
protected void registerHandlers() -
handleConnect
Description copied from interface:DevToolsMessageHandlerCalled 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:
handleConnectin 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:DevToolsMessageHandlerCalled when a message from the browser arrives.- Specified by:
handleMessagein interfaceDevToolsMessageHandler- Parameters:
command- the command receiveddata- the data receiveddevToolsInterface- for interaction with the development tools, e.g. sending a message- Returns:
trueif the message was handled and should not be passed on to further handlers
-