Class ThemeEditorMessageHandler

java.lang.Object
com.vaadin.copilot.plugins.themeeditor.ThemeEditorMessageHandler
All Implemented Interfaces:
CopilotCommand, HasSourceModifier, HasThemeModifier

public class ThemeEditorMessageHandler extends Object implements HasSourceModifier, HasThemeModifier, CopilotCommand
Handler for ThemeEditor debug window communication messages. Responsible for preparing data for ThemeModifier and JavaSourceModifier.
  • Field Details

  • Constructor Details

    • ThemeEditorMessageHandler

      public ThemeEditorMessageHandler(ProjectManager projectManager)
  • Method Details

    • getSourceModifier

      public JavaSourceModifier getSourceModifier()
      Specified by:
      getSourceModifier in interface HasSourceModifier
    • getThemeModifier

      public ThemeModifier getThemeModifier()
      Specified by:
      getThemeModifier in interface HasThemeModifier
    • canHandle

      public boolean canHandle(String command, elemental.json.JsonObject data)
      Checks if given command can be handled by ThemeEditor.
      Parameters:
      command - command to be verified if supported
      data - data object to be verified if is of proper structure
      Returns:
      true if it can be handled, false otherwise
    • handleDebugMessageData

      public BaseResponse handleDebugMessageData(String command, elemental.json.JsonObject data)
      Handles debug message command and performs given action.
      Parameters:
      command - Command name
      data - Command data
      Returns:
      response in form of JsonObject
    • registerHandlers

      protected void registerHandlers()
    • handleMessage

      public boolean handleMessage(String command, elemental.json.JsonObject data, DevToolsInterface devToolsInterface)
      Specified by:
      handleMessage in interface CopilotCommand
    • canBeParallelCommand

      public boolean canBeParallelCommand(String command)
      Description copied from interface: CopilotCommand
      Checks 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.
      Specified by:
      canBeParallelCommand in interface CopilotCommand
      Returns:
      true if the command can be handled by this command handler