public class ViewFactoryCreator extends AbstractProxyCreator
| Modifier and Type | Class and Description |
|---|---|
static class |
ViewFactoryCreator.EmptyWidgetConsumer |
static interface |
ViewFactoryCreator.LazyCompatibleWidgetConsumer |
static interface |
ViewFactoryCreator.WidgetConsumer |
AbstractProxyCreator.SourcePrinter| Modifier and Type | Field and Description |
|---|---|
protected ViewBindHandler |
bindHandler |
protected ControllerAccessHandler |
controllerAccessHandler |
protected String |
iocContainerClassName |
protected String |
module |
protected View |
view |
protected ViewFactoryCreator.WidgetConsumer |
widgetConsumer |
cacheable, cacheableVersionFound, context, logger| Constructor and Description |
|---|
ViewFactoryCreator(com.google.gwt.core.ext.GeneratorContext context,
com.google.gwt.core.ext.TreeLogger logger,
View view,
String device,
String module)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
commitPostProcessing(AbstractProxyCreator.SourcePrinter printer)
Close the current postProcessing scope and schedule the execution of all scope commands.
|
protected void |
createPostProcessingScope()
Create a new scope for the post processing commands.
|
static String |
createVariableName(String varName)
Creates a new unique name based off of
varName and adds it to
the list of known names. |
protected void |
generateCreateDataObjectMethod(AbstractProxyCreator.SourcePrinter printer) |
protected void |
generateGetIocContainerMethod(AbstractProxyCreator.SourcePrinter printer) |
protected void |
generateGetViewPanelMethod(AbstractProxyCreator.SourcePrinter printer) |
protected void |
generateProxyContructor(AbstractProxyCreator.SourcePrinter printer)
Generate the View Constructor
|
protected void |
generateProxyFields(AbstractProxyCreator.SourcePrinter printer)
Generate the View fields
|
protected void |
generateProxyMethods(AbstractProxyCreator.SourcePrinter printer)
Generate the View methods.
|
protected void |
generateRegisterDataObjectBindersMethod(AbstractProxyCreator.SourcePrinter printer) |
protected void |
generateResources(AbstractProxyCreator.SourcePrinter printer)
Create ClientBundles for the declared resources on View
|
protected void |
generateSubTypes(AbstractProxyCreator.SourcePrinter srcWriter)
Override this method to generate any nested type required by the proxy
|
protected com.google.gwt.core.ext.GeneratorContext |
getContext() |
protected ControllerAccessHandler |
getControllerAccessHandler()
Retrieve the object responsible for print controller access expressions on client JS
|
protected static String[] |
getDataObjectParts(String text)
Split the dataBindReference and separate the DataObject Class alias from the requested property and converters
|
protected String |
getDeclaredMessage(String property)
Gets the code necessary to access a i18n declared property or the own property, if
it is not in declarative i18n format.
|
protected Map<String,String> |
getDeclaredMessages()
Gets all messages declared on this screen
|
protected String |
getDevice() |
protected static String[] |
getKeyMessageParts(String text)
Split the i18n message and separate the messageClass alias from the message method
|
protected com.google.gwt.core.ext.TreeLogger |
getLogger() |
protected String |
getLoggerVariable()
Retrieves the logger variable name
|
protected String |
getMetaElementType(JSONObject cruxMetaElement)
Return the type of a given crux meta tag.
|
ObjectDataBinding.PropertyBindInfo |
getObjectDataBinding(String propertyValue,
String widgetClassName,
String widgetPropertyPath) |
String |
getProxyQualifiedName()
Return the qualified name of the ViewFactory class created for the associated screen
|
String |
getProxySimpleName()
Return the simple name of the ViewFactory class created for the associated screen
|
protected String |
getResourceAccessExpression(String property)
Gets the code necessary to access a resource property or the own property, if
it is not in a resource reference format.
|
protected static String[] |
getResourceParts(String text)
Split the resourceReference and separate the resourceClass alias from the requested property
|
protected AbstractProxyCreator.SourcePrinter |
getSourcePrinter()
Creates and returns a new
SourceWriter |
protected AbstractProxyCreator.SourcePrinter |
getSubTypeWriter(String subType,
String superClass,
String[] interfaces,
String[] imports)
Create a new printer for a subType.
|
protected AbstractProxyCreator.SourcePrinter |
getSubTypeWriter(String subType,
String superClass,
String[] interfaces,
String[] imports,
boolean isInterface)
Create a new printer for a subType.
|
protected AbstractProxyCreator.SourcePrinter |
getSubTypeWriter(String packageName,
String subType,
String superClass,
String[] interfaces,
String[] imports)
Create a new printer for a subType.
|
protected AbstractProxyCreator.SourcePrinter |
getSubTypeWriter(String packageName,
String subType,
String superClass,
String[] interfaces,
String[] imports,
boolean isInterface)
Create a new printer for a subType.
|
protected View |
getView() |
String |
getViewSuperClassName() |
static String |
getViewVariable()
Retrieves the view variable name
|
protected WidgetCreator<?> |
getWidgetCreator(String widgetType)
Returns the creator of the widgets of the given type.
|
protected WidgetCreatorHelper |
getWidgetCreatorHelper(String widgetType)
Returns a helper object to create the code of the widgets of the given type.
|
protected boolean |
isBindableView() |
protected boolean |
isKeyReference(String text)
Returns
true if the given text is an internationalization key. |
protected boolean |
isResourceReference(String text)
Returns
true if the given text is a reference to a resource. |
protected boolean |
isValidWidget(JSONObject metaElem)
Check if the given metaElement refers to a valid widget
|
protected String |
newWidget(AbstractProxyCreator.SourcePrinter printer,
JSONObject metaElem,
String widgetId,
String widgetType)
Creates a new widget based on its meta-data element.
|
protected String |
newWidget(AbstractProxyCreator.SourcePrinter printer,
JSONObject metaElem,
String widgetId,
String widgetType,
ViewFactoryCreator.WidgetConsumer consumer,
boolean allowWrapperForCreatedWidget)
Creates a new widget based on its meta-data element.
|
protected void |
prepare(com.google.gwt.core.ext.GeneratorContext context,
com.google.gwt.core.ext.TreeLogger logger,
String device) |
protected void |
printlnPostProcessing(String s)
Print code that will be executed after the viewFactory completes the widgets construction.
|
protected void |
processViewEvents(AbstractProxyCreator.SourcePrinter printer)
Generate the code for the View events creation
|
cacheableVersionFound, create, findCacheableImplementationAndMarkForReuseIfAvailable, findCacheableImplementationAndMarkForReuseIfAvailable, generateLoggerField, generateMethodParameters, generateMethodTrhowsClause, generateProxyWrapperMethodDeclaration, getJsniSimpleSignature, isAlreadyGenerated, isCacheable, isCrux2OldInterfacesCompatibilityEnabled, logDebugMessageprotected final String module
protected final View view
protected ControllerAccessHandler controllerAccessHandler
protected ViewFactoryCreator.WidgetConsumer widgetConsumer
protected String iocContainerClassName
protected ViewBindHandler bindHandler
public static String createVariableName(String varName)
varName and adds it to
the list of known names.varName - protected ControllerAccessHandler getControllerAccessHandler()
protected void generateProxyFields(AbstractProxyCreator.SourcePrinter printer)
generateProxyFields in class AbstractProxyCreatorprinter - protected void generateProxyContructor(AbstractProxyCreator.SourcePrinter printer) throws CruxGeneratorException
generateProxyContructor in class AbstractProxyCreatorCruxGeneratorExceptionprotected void generateResources(AbstractProxyCreator.SourcePrinter printer)
printer - protected void generateProxyMethods(AbstractProxyCreator.SourcePrinter printer)
generateProxyMethods in class AbstractProxyCreatorprinter - protected void generateGetViewPanelMethod(AbstractProxyCreator.SourcePrinter printer)
protected void generateRegisterDataObjectBindersMethod(AbstractProxyCreator.SourcePrinter printer)
protected void generateCreateDataObjectMethod(AbstractProxyCreator.SourcePrinter printer)
protected void generateGetIocContainerMethod(AbstractProxyCreator.SourcePrinter printer)
protected void generateSubTypes(AbstractProxyCreator.SourcePrinter srcWriter) throws CruxGeneratorException
AbstractProxyCreatorgenerateSubTypes in class AbstractProxyCreatorCruxGeneratorExceptionprotected String getMetaElementType(JSONObject cruxMetaElement)
"screen"
or another string referencing a registered WidgetFactory.cruxMetaElement - protected WidgetCreator<?> getWidgetCreator(String widgetType)
widgetType - protected WidgetCreatorHelper getWidgetCreatorHelper(String widgetType)
widgetType - protected String newWidget(AbstractProxyCreator.SourcePrinter printer, JSONObject metaElem, String widgetId, String widgetType) throws CruxGeneratorException
printer - metaElem - widgetId - CruxGeneratorExceptionprotected String newWidget(AbstractProxyCreator.SourcePrinter printer, JSONObject metaElem, String widgetId, String widgetType, ViewFactoryCreator.WidgetConsumer consumer, boolean allowWrapperForCreatedWidget) throws CruxGeneratorException
printer - metaElem - widgetId - consumer - allowWrapperForCreatedWidget - CruxGeneratorExceptionprotected void commitPostProcessing(AbstractProxyCreator.SourcePrinter printer)
printer - protected void createPostProcessingScope()
printlnPostProcessing method will be added to this same scope, what means
that they will be fired together. When commitPostProcessing method is called,
the scope is closed and all scope commands are programmed for execution.protected com.google.gwt.core.ext.TreeLogger getLogger()
public static String getViewVariable()
public String getViewSuperClassName()
protected String getLoggerVariable()
protected View getView()
protected String getDeclaredMessage(String property)
property - protected String getResourceAccessExpression(String property)
property - public ObjectDataBinding.PropertyBindInfo getObjectDataBinding(String propertyValue, String widgetClassName, String widgetPropertyPath)
propertyValue - widgetPropertyPath - protected boolean isKeyReference(String text)
true if the given text is an internationalization key.text - true if the given text is an internationalization key.protected boolean isResourceReference(String text)
true if the given text is a reference to a resource.text - true if the given text is a reference to a resource.protected Map<String,String> getDeclaredMessages()
protected com.google.gwt.core.ext.GeneratorContext getContext()
protected AbstractProxyCreator.SourcePrinter getSubTypeWriter(String subType, String superClass, String[] interfaces, String[] imports)
ViewFactory.subType - superClass - interfaces - imports - protected AbstractProxyCreator.SourcePrinter getSubTypeWriter(String packageName, String subType, String superClass, String[] interfaces, String[] imports)
ViewFactory.packageName - subType - superClass - interfaces - imports - isInterface - protected AbstractProxyCreator.SourcePrinter getSubTypeWriter(String subType, String superClass, String[] interfaces, String[] imports, boolean isInterface)
ViewFactory.subType - superClass - interfaces - imports - isInterface - protected AbstractProxyCreator.SourcePrinter getSubTypeWriter(String packageName, String subType, String superClass, String[] interfaces, String[] imports, boolean isInterface)
packageName - subType - superClass - interfaces - imports - isInterface - protected boolean isValidWidget(JSONObject metaElem)
element - protected void prepare(com.google.gwt.core.ext.GeneratorContext context,
com.google.gwt.core.ext.TreeLogger logger,
String device)
context - logger - device - protected String getDevice()
protected void printlnPostProcessing(String s)
s - code stringprotected void processViewEvents(AbstractProxyCreator.SourcePrinter printer)
printer - protected static String[] getKeyMessageParts(String text)
text - protected static String[] getResourceParts(String text)
text - protected static String[] getDataObjectParts(String text)
text - public String getProxyQualifiedName()
getProxyQualifiedName in class AbstractProxyCreatorpublic String getProxySimpleName()
getProxySimpleName in class AbstractProxyCreatorprotected AbstractProxyCreator.SourcePrinter getSourcePrinter()
SourceWritergetSourcePrinter in class AbstractProxyCreatorSourceWriterprotected boolean isBindableView()
Copyright © 2015. All rights reserved.