Class StudioSearchComponentsPreviewLoader

java.lang.Object
io.jmix.searchflowui.kit.meta.loader.StudioSearchComponentsPreviewLoader
All Implemented Interfaces:
StudioPreviewComponentLoader

public class StudioSearchComponentsPreviewLoader extends Object implements StudioPreviewComponentLoader
Studio preview loader for the search add-on's search:searchField and search:fullTextFilter components. Neither has a spring-free kit-level counterpart: the runtime SearchField is ApplicationContextAware and the runtime FullTextFilter extends SingleFilterComponentBase, both needing a live Spring context that isn't available to a kit-only preview loader. This loader instead builds the plain Vaadin component that StudioSearchComponents already declares as the kit-meta return type for each: a TextField for searchField, a HorizontalLayout for fullTextFilter.

fullTextFilter's runtime shape (a label + text field inside its root HorizontalLayout) has no equivalent slot on a bare HorizontalLayout: there's no label component to bind label to. The preview approximates it with a Span for the resolved label text, followed by a placeholder TextField, added as plain children of the layout - close enough to show the visible shape, not a faithful reproduction. labelPosition/labelWidth act on that missing label slot so they're skipped, along with the data-bound dataLoader/autoApply/searchStrategy/ parameterName attributes that need a runtime data context.

  • Field Details

  • Constructor Details

    • StudioSearchComponentsPreviewLoader

      public StudioSearchComponentsPreviewLoader()
  • Method Details

    • isSupported

      public boolean isSupported(org.dom4j.Element element)
      Description copied from interface: StudioPreviewComponentLoader
      Define the element that this loader can load.
      Specified by:
      isSupported in interface StudioPreviewComponentLoader
    • load

      public @Nullable com.vaadin.flow.component.Component load(org.dom4j.Element componentElement, org.dom4j.Element viewElement)
      Description copied from interface: StudioPreviewComponentLoader
      Create vaadin component from component xml element.
      Specified by:
      load in interface StudioPreviewComponentLoader
      Parameters:
      componentElement - xml element of component
      viewElement - xml element of view containing componentElement
      See Also:
      • Element
    • load

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

      protected com.vaadin.flow.component.textfield.TextField loadSearchField(org.dom4j.Element componentElement, StudioPreviewEnvironment environment)
    • loadFullTextFilter

      protected com.vaadin.flow.component.orderedlayout.HorizontalLayout loadFullTextFilter(org.dom4j.Element componentElement, StudioPreviewEnvironment environment)