Class CustomComponentHelper

java.lang.Object
com.vaadin.copilot.customcomponent.CustomComponentHelper

public class CustomComponentHelper extends Object
Helper class for custom components
  • Method Details

    • generateResponse

      public static CustomComponentResponseData generateResponse(com.vaadin.flow.server.VaadinSession vaadinSession, Map<com.vaadin.flow.component.Component,ComponentTypeAndSourceLocation> allComponents, List<com.vaadin.flow.component.Component> componentsInProject)
      Generates the response that is used in the UI
      Parameters:
      allComponents - Component and source location of all components that are found in the UI
      componentsInProject - Components that have source in the project.
      Returns:
      response that contains required metadata for the custom component feature
    • isDrilledDownComponent

      public static boolean isDrilledDownComponent(com.vaadin.flow.server.VaadinSession vaadinSession, elemental.json.JsonObject data, elemental.json.JsonObject component)
      Checks if the given component is drilled down
      Parameters:
      vaadinSession - Vaadin session to access component
      data - Sent data from client. It requires ACTIVE_CLASS_JSON_KEY and ACTIVE_NODE_ID_JSON_KEY
      component - JSON data that contains uiId and nodeId
      Returns:
      true if drilled down component, false otherwise
    • isDrilledDownComponent

      public static boolean isDrilledDownComponent(com.vaadin.flow.server.VaadinSession vaadinSession, elemental.json.JsonObject data, int uiId, int nodeId)
      Checks if the given component is drilled down.
      Parameters:
      vaadinSession - Vaadin session to access component
      data - Sent data from client. It requires ACTIVE_CLASS_JSON_KEY and ACTIVE_NODE_ID_JSON_KEY
      uiId - uiId
      nodeId - nodeId of the given component
      Returns:
      true if drilled down component, false otherwise