Class CustomComponentHelper
java.lang.Object
com.vaadin.copilot.customcomponent.CustomComponentHelper
Helper class for custom components
-
Method Summary
Modifier and TypeMethodDescriptionstatic CustomComponentResponseDatagenerateResponse(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 UIstatic booleanisDrilledDownComponent(com.vaadin.flow.server.VaadinSession vaadinSession, elemental.json.JsonObject data, int uiId, int nodeId) Checks if the given component is drilled down.static booleanisDrilledDownComponent(com.vaadin.flow.server.VaadinSession vaadinSession, elemental.json.JsonObject data, elemental.json.JsonObject component) Checks if the given component is drilled down
-
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 UIcomponentsInProject- 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 componentdata- Sent data from client. It requiresACTIVE_CLASS_JSON_KEYandACTIVE_NODE_ID_JSON_KEYcomponent- 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 componentdata- Sent data from client. It requiresACTIVE_CLASS_JSON_KEYandACTIVE_NODE_ID_JSON_KEYuiId- uiIdnodeId- nodeId of the given component- Returns:
- true if drilled down component, false otherwise
-