Interface StudioPreviewComponentLoader

All Known Implementing Classes:
StudioAiChatPreviewLoader, StudioChartsPreviewLoader, StudioDashboardPreviewLoader, StudioDashboardSectionPreviewLoader, StudioDashboardWidgetPreviewLoader, StudioDynamicAttributesPanelPreviewLoader, StudioFullCalendarPreviewLoader, StudioGeoMapComponentPreviewLoader, StudioGrapesJsPreviewLoader, StudioGroupGridPreviewLoader, StudioKanbanComponentPreviewLoader, StudioNotificationsIndicatorPreviewLoader, StudioPivotTablePreviewLoader, StudioSearchComponentsPreviewLoader, StudioSpreadsheetPreviewLoader, StudioSupersetDashboardPreviewLoader, StudioTabbedModeMainViewPreviewLoader

public interface StudioPreviewComponentLoader
Vaadin component loader for Studio view designer preview.

Register new loaders via SPI in META-INF/services/io.jmix.flowui.kit.meta.component.preview.StudioPreviewComponentLoader

See Also:
  • StudioPreviewComponentProvider
  • Field Details

  • Method Details

    • hasViewOrFragmentSchema

      default boolean hasViewOrFragmentSchema(org.dom4j.Element element)
    • isSupported

      boolean isSupported(org.dom4j.Element element)
      Define the element that this loader can load.
    • load

      @Nullable com.vaadin.flow.component.Component load(org.dom4j.Element componentElement, org.dom4j.Element viewElement)
      Create vaadin component from component xml element.
      Parameters:
      componentElement - xml element of component
      viewElement - xml element of view containing componentElement
      See Also:
      • Element
    • load

      default @Nullable com.vaadin.flow.component.Component load(org.dom4j.Element componentElement, org.dom4j.Element viewElement, StudioPreviewEnvironment environment)
      Create vaadin component from component xml element, with access to Studio-resolved context (e.g. localized messages, entity property captions).
      Parameters:
      componentElement - xml element of component
      viewElement - xml element of view containing componentElement
      environment - Studio-side environment; StudioPreviewEnvironment.NOOP when unavailable
      See Also:
      • Element
    • loadString

      default Optional<String> loadString(org.dom4j.Element element, String attributeName)
    • loadString

      default Optional<String> loadString(org.dom4j.Element element, String attributeName, boolean emptyToNull)
    • loadBoolean

      default Optional<Boolean> loadBoolean(org.dom4j.Element element, String attributeName)
    • loadInteger

      default Optional<Integer> loadInteger(org.dom4j.Element element, String attributeName)
    • loadDouble

      default Optional<Double> loadDouble(org.dom4j.Element element, String attributeName)
    • loadEnum

      default <T extends Enum<T>> Optional<T> loadEnum(org.dom4j.Element element, Class<T> type, String attributeName)
    • loadString

      default void loadString(org.dom4j.Element element, String attributeName, Consumer<String> setter)
    • loadBoolean

      default void loadBoolean(org.dom4j.Element element, String attributeName, Consumer<Boolean> setter)
    • loadInteger

      default void loadInteger(org.dom4j.Element element, String attributeName, Consumer<Integer> setter)
    • loadDouble

      default void loadDouble(org.dom4j.Element element, String attributeName, Consumer<Double> setter)
    • loadLocalizedString

      default void loadLocalizedString(org.dom4j.Element element, String attributeName, StudioPreviewEnvironment environment, Consumer<String> setter)
    • loadEnum

      default <T extends Enum<T>> void loadEnum(org.dom4j.Element element, Class<T> type, String attributeName, Consumer<T> setter)
    • loadWidth

      default void loadWidth(com.vaadin.flow.component.HasSize component, org.dom4j.Element element)
    • loadMaxWidth

      default void loadMaxWidth(com.vaadin.flow.component.HasSize component, org.dom4j.Element element)
    • loadMinWidth

      default void loadMinWidth(com.vaadin.flow.component.HasSize component, org.dom4j.Element element)
    • loadHeight

      default void loadHeight(com.vaadin.flow.component.HasSize component, org.dom4j.Element element)
    • loadMaxHeight

      default void loadMaxHeight(com.vaadin.flow.component.HasSize component, org.dom4j.Element element)
    • loadMinHeight

      default void loadMinHeight(com.vaadin.flow.component.HasSize component, org.dom4j.Element element)
    • loadSizeAttributes

      default void loadSizeAttributes(com.vaadin.flow.component.HasSize component, org.dom4j.Element element)
    • loadEnabled

      default void loadEnabled(com.vaadin.flow.component.HasEnabled component, org.dom4j.Element element)
    • loadClassNames

      default void loadClassNames(com.vaadin.flow.component.HasStyle component, org.dom4j.Element element)
    • loadThemeNames

      default void loadThemeNames(com.vaadin.flow.component.HasTheme component, org.dom4j.Element element)
    • split

      default void split(String names, Consumer<String> setter)
    • split

      default List<String> split(String names)
    • loadComponentBaseAttributes

      default void loadComponentBaseAttributes(com.vaadin.flow.component.Component component, org.dom4j.Element element)
      Applies the attributes that are common to all preview components, based on the interfaces implemented by the component.
    • loadFieldAttributes

      default void loadFieldAttributes(com.vaadin.flow.component.Component component, org.dom4j.Element element, StudioPreviewEnvironment environment)
      Applies the input-field attributes shared by all field-like components, based on the interfaces the component implements: label (falling back to the entity property caption for data-bound fields), placeholder, helperText, readOnly, required and the <tooltip> sub-element.
    • loadTooltip

      default void loadTooltip(com.vaadin.flow.component.shared.HasTooltip component, org.dom4j.Element element, StudioPreviewEnvironment environment)
    • propertyCaption

      default Optional<String> propertyCaption(org.dom4j.Element element, StudioPreviewEnvironment environment)
      Resolves the display caption of a data-bound component (one with a property attribute) via StudioPreviewEnvironment.propertyCaption(java.lang.String, java.lang.String, java.lang.String). The dataContainer is looked up on the element itself and then up the ancestor chain, mirroring how the runtime inherits it (e.g. from an enclosing formLayout).