@Component(value="ui_WindowConfig")
public class WindowConfig
extends java.lang.Object
screens.xml
screens.Modifier and Type | Class and Description |
---|---|
static class |
WindowConfig.ResolvedWindowInfo |
Modifier and Type | Field and Description |
---|---|
protected org.springframework.context.ApplicationContext |
applicationContext |
protected io.jmix.core.ClassManager |
classManager |
protected java.util.List<UiControllersConfiguration> |
configurations |
static java.util.regex.Pattern |
ENTITY_SCREEN_PATTERN |
protected org.springframework.core.env.Environment |
environment |
protected io.jmix.core.ExtendedEntities |
extendedEntities |
protected boolean |
initialized |
protected java.util.concurrent.locks.ReadWriteLock |
lock |
protected static java.util.List<java.lang.String> |
LOGIN_SCREEN_IDS |
protected static java.util.List<java.lang.String> |
MAIN_SCREEN_IDS |
protected io.jmix.core.Metadata |
metadata |
protected io.jmix.core.impl.scanning.AnnotationScanMetadataReaderFactory |
metadataReaderFactory |
protected io.jmix.core.JmixModules |
modules |
protected java.util.Map<java.lang.Class,WindowInfo> |
primaryEditors |
protected java.util.Map<java.lang.Class,WindowInfo> |
primaryLookups |
protected io.jmix.core.Resources |
resources |
protected com.google.common.collect.BiMap<java.lang.String,java.lang.String> |
routes |
protected java.util.Map<java.lang.String,WindowInfo> |
screens |
protected ScreenXmlLoader |
screenXmlLoader |
protected UiProperties |
uiProperties |
static java.lang.String |
WINDOW_CONFIG_XML_PROP |
protected WindowAttributesProvider |
windowAttributesProvider |
Constructor and Description |
---|
WindowConfig() |
Modifier and Type | Method and Description |
---|---|
protected void |
checkInitialized() |
protected WindowInfo.Type |
extractWindowInfoType(WindowInfo windowInfo,
java.lang.Class<? extends FrameOwner> controllerClass) |
java.lang.String |
findRoute(java.lang.String id)
Find route by screen id.
|
WindowInfo |
findWindowInfo(java.lang.String id)
Get screen information by screen ID.
|
WindowInfo |
findWindowInfoByRoute(java.lang.String route)
Get screen information by route.
|
java.lang.String |
getAvailableLookupScreenId(io.jmix.core.metamodel.model.MetaClass metaClass) |
java.lang.String |
getBrowseScreenId(io.jmix.core.metamodel.model.MetaClass metaClass) |
WindowInfo |
getEditorScreen(java.lang.Object entity) |
java.lang.String |
getEditorScreenId(io.jmix.core.metamodel.model.MetaClass metaClass) |
WindowInfo |
getLookupScreen(java.lang.Class<?> entityClass)
Get available lookup screen by class of entity
|
java.lang.String |
getLookupScreenId(io.jmix.core.metamodel.model.MetaClass metaClass) |
java.lang.String |
getMetaClassScreenId(io.jmix.core.metamodel.model.MetaClass metaClass,
java.lang.String suffix) |
protected org.springframework.core.type.classreading.MetadataReaderFactory |
getMetadataReaderFactory() |
protected org.springframework.core.io.ResourceLoader |
getResourceLoader() |
WindowInfo |
getWindowInfo(java.lang.String id)
Get screen information by screen ID.
|
java.util.Collection<WindowInfo> |
getWindows()
All registered screens
|
boolean |
hasWindow(java.lang.String id) |
protected void |
init() |
protected org.springframework.core.type.classreading.MetadataReader |
loadClassMetadata(java.lang.String className) |
protected void |
loadConfig(org.dom4j.Element rootElem) |
protected java.lang.Class<? extends FrameOwner> |
loadDefinedScreenClass(java.lang.String className) |
protected RouteDefinition |
loadRouteDefinition(org.dom4j.Element screenElement) |
protected void |
loadScreenConfigurations() |
protected void |
loadScreensXml() |
protected void |
registerPrimaryEditor(WindowInfo windowInfo,
org.springframework.core.type.AnnotationMetadata annotationMetadata) |
protected void |
registerPrimaryLookup(WindowInfo windowInfo,
org.springframework.core.type.AnnotationMetadata annotationMetadata) |
protected void |
registerScreen(java.lang.String id,
WindowInfo windowInfo) |
protected void |
registerScreenRoute(java.lang.String screenId,
WindowInfo windowInfo) |
void |
reset()
Make the config to reload screens on next request.
|
protected WindowInfo |
resolveWindowInfo(WindowInfo windowInfo) |
protected boolean |
routeOverrideAllowed(java.lang.String newScreenId)
Have to do this check due to Login/Main Screen are registered
before legacy LoginWindow / AppMainWindow.
|
public static final java.lang.String WINDOW_CONFIG_XML_PROP
public static final java.util.regex.Pattern ENTITY_SCREEN_PATTERN
protected static final java.util.List<java.lang.String> LOGIN_SCREEN_IDS
protected static final java.util.List<java.lang.String> MAIN_SCREEN_IDS
protected java.util.Map<java.lang.String,WindowInfo> screens
protected com.google.common.collect.BiMap<java.lang.String,java.lang.String> routes
protected java.util.Map<java.lang.Class,WindowInfo> primaryEditors
protected java.util.Map<java.lang.Class,WindowInfo> primaryLookups
@Autowired(required=false) protected java.util.List<UiControllersConfiguration> configurations
@Autowired protected io.jmix.core.Resources resources
@Autowired protected io.jmix.core.ClassManager classManager
@Autowired protected io.jmix.core.Metadata metadata
@Autowired protected io.jmix.core.ExtendedEntities extendedEntities
@Autowired protected ScreenXmlLoader screenXmlLoader
@Autowired protected UiProperties uiProperties
@Autowired protected org.springframework.core.env.Environment environment
@Autowired protected org.springframework.context.ApplicationContext applicationContext
@Autowired protected io.jmix.core.impl.scanning.AnnotationScanMetadataReaderFactory metadataReaderFactory
@Autowired protected io.jmix.core.JmixModules modules
protected volatile boolean initialized
protected java.util.concurrent.locks.ReadWriteLock lock
protected WindowAttributesProvider windowAttributesProvider
protected WindowInfo resolveWindowInfo(WindowInfo windowInfo)
protected org.springframework.core.type.classreading.MetadataReaderFactory getMetadataReaderFactory()
protected org.springframework.core.io.ResourceLoader getResourceLoader()
protected WindowInfo.Type extractWindowInfoType(WindowInfo windowInfo, java.lang.Class<? extends FrameOwner> controllerClass)
protected java.lang.Class<? extends FrameOwner> loadDefinedScreenClass(java.lang.String className)
protected void checkInitialized()
protected void init()
protected void loadScreenConfigurations()
protected void loadScreensXml()
protected void loadConfig(org.dom4j.Element rootElem)
@Nullable protected RouteDefinition loadRouteDefinition(org.dom4j.Element screenElement)
protected void registerScreen(java.lang.String id, WindowInfo windowInfo)
protected void registerScreenRoute(java.lang.String screenId, WindowInfo windowInfo)
protected boolean routeOverrideAllowed(java.lang.String newScreenId)
protected void registerPrimaryEditor(WindowInfo windowInfo, org.springframework.core.type.AnnotationMetadata annotationMetadata)
protected void registerPrimaryLookup(WindowInfo windowInfo, org.springframework.core.type.AnnotationMetadata annotationMetadata)
protected org.springframework.core.type.classreading.MetadataReader loadClassMetadata(java.lang.String className)
public void reset()
@Nullable public WindowInfo findWindowInfo(java.lang.String id)
id
- screen ID as set up in screens.xml
public WindowInfo getWindowInfo(java.lang.String id)
id
- screen ID as set up in screens.xml
NoSuchScreenException
- if the screen with specified ID is not registered@Nullable public WindowInfo findWindowInfoByRoute(java.lang.String route)
route
- route@Nullable public java.lang.String findRoute(java.lang.String id)
id
- screen idpublic boolean hasWindow(java.lang.String id)
public java.util.Collection<WindowInfo> getWindows()
public java.lang.String getMetaClassScreenId(io.jmix.core.metamodel.model.MetaClass metaClass, java.lang.String suffix)
public java.lang.String getBrowseScreenId(io.jmix.core.metamodel.model.MetaClass metaClass)
public java.lang.String getLookupScreenId(io.jmix.core.metamodel.model.MetaClass metaClass)
public java.lang.String getEditorScreenId(io.jmix.core.metamodel.model.MetaClass metaClass)
public WindowInfo getEditorScreen(java.lang.Object entity)
public WindowInfo getLookupScreen(java.lang.Class<?> entityClass)
entityClass
- entity classNoSuchScreenException
- if the screen with specified ID is not registeredpublic java.lang.String getAvailableLookupScreenId(io.jmix.core.metamodel.model.MetaClass metaClass)