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

    • WINDOW_CONFIG_XML_PROP

      public static final String WINDOW_CONFIG_XML_PROP
      See Also:
    • ENTITY_SCREEN_PATTERN

      public static final Pattern ENTITY_SCREEN_PATTERN
    • LOGIN_SCREEN_IDS

      protected static final List<String> LOGIN_SCREEN_IDS
    • MAIN_SCREEN_IDS

      protected static final List<String> MAIN_SCREEN_IDS
    • screens

      protected Map<String,WindowInfo> screens
    • routes

      protected com.google.common.collect.BiMap<String,String> routes
    • primaryEditors

      protected Map<Class,WindowInfo> primaryEditors
    • primaryLookups

      protected Map<Class,WindowInfo> primaryLookups
    • configurations

      @Autowired(required=false) protected List<UiControllersConfiguration> configurations
    • resources

      @Autowired protected Resources resources
    • classManager

      @Autowired protected ClassManager classManager
    • metadata

      @Autowired protected Metadata metadata
    • extendedEntities

      @Autowired protected ExtendedEntities extendedEntities
    • screenXmlLoader

      @Autowired protected ScreenXmlLoader screenXmlLoader
    • uiProperties

      @Autowired protected UiProperties uiProperties
    • environment

      @Autowired protected org.springframework.core.env.Environment environment
    • applicationContext

      @Autowired protected org.springframework.context.ApplicationContext applicationContext
    • metadataReaderFactory

      @Autowired protected AnnotationScanMetadataReaderFactory metadataReaderFactory
    • modules

      @Autowired protected JmixModules modules
    • initialized

      protected volatile boolean initialized
    • lock

      protected ReadWriteLock lock
    • windowAttributesProvider

      protected WindowAttributesProvider windowAttributesProvider
  • Constructor Details

    • WindowConfig

      public WindowConfig()
  • Method Details

    • 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)