Package io.jmix.ui

Class WindowConfig

java.lang.Object
io.jmix.ui.WindowConfig

@Component("ui_WindowConfig") public class WindowConfig extends Object
GenericUI class holding information about all registered in screens.xml screens.
  • Field Details

  • Constructor Details

    • WindowConfig

      public WindowConfig()
  • Method Details

    • setConfigurations

      @Autowired public void setConfigurations(List<UiControllersConfiguration> configurations)
    • resolveWindowInfo

      protected WindowInfo resolveWindowInfo(WindowInfo windowInfo)
    • getMetadataReaderFactory

      protected org.springframework.core.type.classreading.MetadataReaderFactory getMetadataReaderFactory()
    • getResourceLoader

      protected org.springframework.core.io.ResourceLoader getResourceLoader()
    • extractWindowInfoType

      protected WindowInfo.Type extractWindowInfoType(WindowInfo windowInfo, Class<? extends FrameOwner> controllerClass)
    • loadDefinedScreenClass

      protected Class<? extends FrameOwner> loadDefinedScreenClass(String className)
    • checkInitialized

      protected void checkInitialized()
    • init

      protected void init()
    • loadScreenConfigurations

      protected void loadScreenConfigurations()
    • loadScreensXml

      protected void loadScreensXml()
    • loadConfig

      protected void loadConfig(org.dom4j.Element rootElem)
    • loadRouteDefinition

      @Nullable protected RouteDefinition loadRouteDefinition(org.dom4j.Element screenElement)
    • registerScreen

      protected void registerScreen(String id, WindowInfo windowInfo)
    • registerScreenRoute

      protected void registerScreenRoute(String screenId, WindowInfo windowInfo)
    • routeOverrideAllowed

      protected boolean routeOverrideAllowed(String newScreenId)
      Have to do this check due to Login/Main Screen are registered before legacy LoginWindow / AppMainWindow.
    • registerPrimaryEditor

      protected void registerPrimaryEditor(WindowInfo windowInfo, org.springframework.core.type.AnnotationMetadata annotationMetadata)
    • registerPrimaryLookup

      protected void registerPrimaryLookup(WindowInfo windowInfo, org.springframework.core.type.AnnotationMetadata annotationMetadata)
    • loadClassMetadata

      protected org.springframework.core.type.classreading.MetadataReader loadClassMetadata(String className)
    • loadScreenClass

      public void loadScreenClass(String className)
      Loads hot-deployed UiController screens and registers UiControllersConfiguration containing new UiControllerDefinition.
      Parameters:
      className - the fully qualified name of the screen class to load
    • reset

      public void reset()
      Make the config to reload screens on next request.
    • findWindowInfo

      @Nullable public WindowInfo findWindowInfo(String id)
      Get screen information by screen ID.
      Parameters:
      id - screen ID as set up in screens.xml
      Returns:
      screen's registration information or null if not found
    • getWindowInfo

      public WindowInfo getWindowInfo(String id)
      Get screen information by screen ID.
      Parameters:
      id - screen ID as set up in screens.xml
      Returns:
      screen's registration information
      Throws:
      NoSuchScreenException - if the screen with specified ID is not registered
    • findWindowInfoByRoute

      @Nullable public WindowInfo findWindowInfoByRoute(String route)
      Get screen information by route.
      Parameters:
      route - route
      Returns:
      screen's registration information or null if not found
    • findRoute

      @Nullable public String findRoute(String id)
      Find route by screen id.
      Parameters:
      id - screen id
      Returns:
      registered route or null if no route for screen
    • hasWindow

      public boolean hasWindow(String id)
      Returns:
      true if the configuration contains a screen with provided ID
    • getWindows

      public Collection<WindowInfo> getWindows()
      All registered screens
    • getMetaClassScreenId

      public String getMetaClassScreenId(MetaClass metaClass, String suffix)
    • getBrowseScreenId

      public String getBrowseScreenId(MetaClass metaClass)
    • getLookupScreenId

      public String getLookupScreenId(MetaClass metaClass)
    • getEditorScreenId

      public String getEditorScreenId(MetaClass metaClass)
    • getEditorScreen

      public WindowInfo getEditorScreen(Object entity)
    • getLookupScreen

      public WindowInfo getLookupScreen(Class<?> entityClass)
      Get available lookup screen by class of entity
      Parameters:
      entityClass - entity class
      Returns:
      id of lookup screen
      Throws:
      NoSuchScreenException - if the screen with specified ID is not registered
    • getAvailableLookupScreenId

      public String getAvailableLookupScreenId(MetaClass metaClass)