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:
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiondefault booleanhasViewOrFragmentSchema(org.dom4j.Element element) booleanisSupported(org.dom4j.Element element) Define the element that this loader can load.@Nullable com.vaadin.flow.component.Componentload(org.dom4j.Element componentElement, org.dom4j.Element viewElement) Create vaadin component from component xml element.default @Nullable com.vaadin.flow.component.Componentload(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.loadBoolean(org.dom4j.Element element, String attributeName) default voidloadBoolean(org.dom4j.Element element, String attributeName, Consumer<Boolean> setter) default voidloadClassNames(com.vaadin.flow.component.HasStyle component, org.dom4j.Element element) default voidloadComponentBaseAttributes(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 thecomponent.loadDouble(org.dom4j.Element element, String attributeName) default voidloadDouble(org.dom4j.Element element, String attributeName, Consumer<Double> setter) default voidloadEnabled(com.vaadin.flow.component.HasEnabled component, org.dom4j.Element element) default <T extends Enum<T>>
voiddefault voidloadFieldAttributes(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 thecomponentimplements:label(falling back to the entity property caption for data-bound fields),placeholder,helperText,readOnly,requiredand the<tooltip>sub-element.default voidloadHeight(com.vaadin.flow.component.HasSize component, org.dom4j.Element element) loadInteger(org.dom4j.Element element, String attributeName) default voidloadInteger(org.dom4j.Element element, String attributeName, Consumer<Integer> setter) default voidloadLocalizedString(org.dom4j.Element element, String attributeName, StudioPreviewEnvironment environment, Consumer<String> setter) default voidloadMaxHeight(com.vaadin.flow.component.HasSize component, org.dom4j.Element element) default voidloadMaxWidth(com.vaadin.flow.component.HasSize component, org.dom4j.Element element) default voidloadMinHeight(com.vaadin.flow.component.HasSize component, org.dom4j.Element element) default voidloadMinWidth(com.vaadin.flow.component.HasSize component, org.dom4j.Element element) default voidloadSizeAttributes(com.vaadin.flow.component.HasSize component, org.dom4j.Element element) loadString(org.dom4j.Element element, String attributeName) loadString(org.dom4j.Element element, String attributeName, boolean emptyToNull) default voidloadString(org.dom4j.Element element, String attributeName, Consumer<String> setter) default voidloadThemeNames(com.vaadin.flow.component.HasTheme component, org.dom4j.Element element) default voidloadTooltip(com.vaadin.flow.component.shared.HasTooltip component, org.dom4j.Element element, StudioPreviewEnvironment environment) default voidloadWidth(com.vaadin.flow.component.HasSize component, org.dom4j.Element element) propertyCaption(org.dom4j.Element element, StudioPreviewEnvironment environment) Resolves the display caption of a data-bound component (one with apropertyattribute) viaStudioPreviewEnvironment.propertyCaption(java.lang.String, java.lang.String, java.lang.String).default void
-
Field Details
-
MAIN_VIEW_SCHEMA
- See Also:
-
MAIN_VIEW_TAB_MODE_SCHEMA
- See Also:
-
VIEW_SCHEMA
- See Also:
-
FRAGMENT_SCHEMA
- See Also:
-
VIEW_OR_FRAGMENT_SCHEMAS
-
-
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 componentviewElement- xml element of view containingcomponentElement- See Also:
-
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 componentviewElement- xml element of view containingcomponentElementenvironment- Studio-side environment;StudioPreviewEnvironment.NOOPwhen unavailable- See Also:
-
loadString
-
loadString
-
loadBoolean
-
loadInteger
-
loadDouble
-
loadEnum
-
loadString
-
loadBoolean
-
loadInteger
-
loadDouble
-
loadLocalizedString
default void loadLocalizedString(org.dom4j.Element element, String attributeName, StudioPreviewEnvironment environment, Consumer<String> setter) -
loadEnum
-
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
-
split
-
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 thecomponent. -
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 thecomponentimplements:label(falling back to the entity property caption for data-bound fields),placeholder,helperText,readOnly,requiredand the<tooltip>sub-element. -
propertyCaption
default Optional<String> propertyCaption(org.dom4j.Element element, StudioPreviewEnvironment environment) Resolves the display caption of a data-bound component (one with apropertyattribute) viaStudioPreviewEnvironment.propertyCaption(java.lang.String, java.lang.String, java.lang.String). ThedataContaineris looked up on the element itself and then up the ancestor chain, mirroring how the runtime inherits it (e.g. from an enclosingformLayout).
-