Class FragmentsImpl

java.lang.Object
io.jmix.flowui.impl.FragmentsImpl
All Implemented Interfaces:
Fragments

@Component("flowui_Fragments") public class FragmentsImpl extends Object implements Fragments
Implementation of the Fragments interface responsible for the creation and initialization of fragments within the UI flow. This class provides utilities for programmatic fragment creation, descriptor processing, and lifecycle initialization of fragments.
  • Field Details

    • applicationContext

      protected final org.springframework.context.ApplicationContext applicationContext
    • fragmentDescriptorLoader

      protected final FragmentDescriptorLoader fragmentDescriptorLoader
    • uiComponents

      protected final UiComponents uiComponents
    • viewRegistry

      protected final ViewRegistry viewRegistry
    • autowireManager

      protected final AutowireManager autowireManager
  • Constructor Details

  • Method Details

    • create

      public <F extends Fragment<?>> F create(FragmentOwner parent, Class<F> fragmentClass)
      Description copied from interface: Fragments
      Creates a fragment instance by its controller class.

      For example:

      
          AddressFragment addressFragment = fragments.create(this, AddressFragment.class);
          getContent().add(addressFragment);
       
      Specified by:
      create in interface Fragments
      Type Parameters:
      F - fragment type
      Parameters:
      parent - parent UI controller
      fragmentClass - fragment controller class
      Returns:
      fully initialized fragment instance
    • init

      public void init(ComponentLoader.Context hostContext, Fragment<?> fragment)
      Description copied from interface: Fragments
      Initializes passed fragment by processing FragmentDescriptor.
      Specified by:
      init in interface Fragments
      Parameters:
      hostContext - parent controller loader context. Used to get additional data that is needed for correct initialization. For example, provided data components
      fragment - fragment to initialize
    • getFullOriginId

      protected String getFullOriginId(ComponentLoader.Context hostContext, Fragment<?> fragment)
    • postInit

      protected void postInit(Fragment<?> fragment, @Nullable FragmentLoaderContext context)
    • autowireFragment

      protected void autowireFragment(Fragment<?> fragment)
    • findHostLoaderContext

      @Nullable protected ComponentLoader.Context findHostLoaderContext(ComponentLoader.Context hostContext)
    • processFragmentDescriptor

      protected void processFragmentDescriptor(FragmentLoaderContext context, String descriptorPath)
    • createHostLoaderContext

      protected ComponentLoader.Context createHostLoaderContext(FragmentOwner parent)
    • createHostViewLoaderContext

      protected ComponentLoaderContext createHostViewLoaderContext(View<?> view)
    • createHostFragmentLoaderContext

      protected FragmentLoaderContext createHostFragmentLoaderContext(Fragment<?> fragment)