@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 |
protected Dom4jTools |
dom4JTools |
static java.util.regex.Pattern |
ENTITY_SCREEN_PATTERN |
protected boolean |
initialized |
protected java.util.concurrent.locks.ReadWriteLock |
lock |
protected static java.util.List<java.lang.String> |
LOGIN_SCREEN_IDS |
protected static java.lang.String |
LOGIN_SCREEN_PROP |
protected static java.util.List<java.lang.String> |
MAIN_SCREEN_IDS |
protected static java.lang.String |
MAIN_SCREEN_PROP |
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 |
protected UiControllerMetaProvider |
uiControllerMetaProvider |
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(MetaClass metaClass) |
java.lang.String |
getBrowseScreenId(MetaClass metaClass) |
WindowInfo |
getEditorScreen(Entity entity) |
java.lang.String |
getEditorScreenId(MetaClass metaClass) |
WindowInfo |
getLookupScreen(java.lang.Class<? extends Entity> entityClass)
Get available lookup screen by class of entity
|
java.lang.String |
getLookupScreenId(MetaClass metaClass) |
java.lang.String |
getMetaClassScreenId(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) |
void |
loadScreenClass(java.lang.String className)
Loads hot-deployed
UiController screens and registers
UiControllersConfiguration containing new UiControllerDefinition . |
protected void |
loadScreenConfigurations() |
protected void |
loadScreensXml() |
protected void |
registerPrimaryEditor(WindowInfo windowInfo,
org.springframework.core.type.AnnotationMetadata annotationMetadata) |
protected void |
registerPrimaryEditor(WindowInfo windowInfo,
java.util.Map<java.lang.String,java.lang.Object> primaryEditorAnnotation) |
protected void |
registerPrimaryEditor(WindowInfo windowInfo,
UiControllerDefinition controllerDefinition) |
protected void |
registerPrimaryLookup(WindowInfo windowInfo,
org.springframework.core.type.AnnotationMetadata annotationMetadata) |
protected void |
registerPrimaryLookup(WindowInfo windowInfo,
java.util.Map<java.lang.String,java.lang.Object> primaryEditorAnnotation) |
protected void |
registerPrimaryLookup(WindowInfo windowInfo,
UiControllerDefinition controllerDefinition) |
protected void |
registerScreen(java.lang.String id,
WindowInfo windowInfo) |
protected void |
registerScreen(UiControllerDefinition controllerDefinition,
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 NAME
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 static final java.lang.String LOGIN_SCREEN_PROP
protected static final java.lang.String MAIN_SCREEN_PROP
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 Dom4jTools dom4JTools
@Inject protected org.springframework.context.ApplicationContext applicationContext
@Inject protected AnnotationScanMetadataReaderFactory metadataReaderFactory
@Inject protected UiControllerMetaProvider uiControllerMetaProvider
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(UiControllerDefinition controllerDefinition, WindowInfo windowInfo)
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 registerPrimaryEditor(WindowInfo windowInfo, UiControllerDefinition controllerDefinition)
protected void registerPrimaryEditor(WindowInfo windowInfo, @Nullable java.util.Map<java.lang.String,java.lang.Object> primaryEditorAnnotation)
protected void registerPrimaryLookup(WindowInfo windowInfo, org.springframework.core.type.AnnotationMetadata annotationMetadata)
protected void registerPrimaryLookup(WindowInfo windowInfo, UiControllerDefinition controllerDefinition)
protected void registerPrimaryLookup(WindowInfo windowInfo, @Nullable java.util.Map<java.lang.String,java.lang.Object> primaryEditorAnnotation)
protected org.springframework.core.type.classreading.MetadataReader loadClassMetadata(java.lang.String className)
public void loadScreenClass(java.lang.String className)
UiController
screens and registers
UiControllersConfiguration
containing new UiControllerDefinition
.className
- the fully qualified name of the screen class to loadpublic 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(MetaClass metaClass, java.lang.String suffix)
public java.lang.String getBrowseScreenId(MetaClass metaClass)
public java.lang.String getLookupScreenId(MetaClass metaClass)
public java.lang.String getEditorScreenId(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(MetaClass metaClass)