@Component(value="cuba_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 java.util.List<UiControllersConfiguration> |
configurations |
static java.util.regex.Pattern |
ENTITY_SCREEN_PATTERN |
protected boolean |
initialized |
protected java.util.concurrent.locks.ReadWriteLock |
lock |
protected Metadata |
metadata |
protected AnnotationScanMetadataReaderFactory |
metadataReaderFactory |
static java.lang.String |
NAME |
protected java.util.Map<java.lang.Class,WindowInfo> |
primaryEditors |
protected java.util.Map<java.lang.Class,WindowInfo> |
primaryLookups |
protected 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 Scripting |
scripting |
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(com.haulmont.chile.core.model.MetaClass metaClass) |
java.lang.String |
getBrowseScreenId(com.haulmont.chile.core.model.MetaClass metaClass) |
WindowInfo |
getEditorScreen(Entity entity) |
java.lang.String |
getEditorScreenId(com.haulmont.chile.core.model.MetaClass metaClass) |
WindowInfo |
getLookupScreen(java.lang.Class<? extends Entity> entityClass)
Get available lookup screen by class of entity
|
java.lang.String |
getLookupScreenId(com.haulmont.chile.core.model.MetaClass metaClass) |
java.lang.String |
getMetaClassScreenId(com.haulmont.chile.core.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) |
public static final java.lang.String NAME
public static final java.lang.String WINDOW_CONFIG_XML_PROP
public static final java.util.regex.Pattern ENTITY_SCREEN_PATTERN
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
@Inject protected Resources resources
@Inject protected Scripting scripting
@Inject protected Metadata metadata
@Inject protected ScreenXmlLoader screenXmlLoader
@Inject protected org.springframework.context.ApplicationContext applicationContext
@Inject protected AnnotationScanMetadataReaderFactory metadataReaderFactory
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)
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 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(com.haulmont.chile.core.model.MetaClass metaClass, java.lang.String suffix)
public java.lang.String getBrowseScreenId(com.haulmont.chile.core.model.MetaClass metaClass)
public java.lang.String getLookupScreenId(com.haulmont.chile.core.model.MetaClass metaClass)
public java.lang.String getEditorScreenId(com.haulmont.chile.core.model.MetaClass metaClass)
public WindowInfo getEditorScreen(Entity entity)
public WindowInfo getLookupScreen(java.lang.Class<? extends Entity> entityClass)
entityClass
- entity classNoSuchScreenException
- if the screen with specified ID is not registeredpublic java.lang.String getAvailableLookupScreenId(com.haulmont.chile.core.model.MetaClass metaClass)