public abstract class WidgetCreator<C extends WidgetCreatorContext> extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
WidgetCreator.StyleNameProcessor |
static class |
WidgetCreator.StyleProcessor |
static class |
WidgetCreator.ViewPermissionAttributeProcessor
Process viewPermission attribute
|
| Constructor and Description |
|---|
WidgetCreator() |
| 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.
|
String |
createChildWidget(AbstractProxyCreator.SourcePrinter out,
JSONObject metaElem,
String widgetId,
String widgetType,
ViewFactoryCreator.WidgetConsumer consumer,
boolean allowWrapperForCreatedWidget,
WidgetCreatorContext context)
Used by widgets that need to create new widgets as children.
|
String |
createChildWidget(AbstractProxyCreator.SourcePrinter out,
JSONObject metaElem,
ViewFactoryCreator.WidgetConsumer consumer,
boolean allowWrapperForCreatedWidget,
WidgetCreatorContext context)
Used by widgets that need to create new widgets as children.
|
String |
createChildWidget(AbstractProxyCreator.SourcePrinter out,
JSONObject metaElem,
WidgetCreatorContext context)
Used by widgets that need to create new widgets as children.
|
protected C |
createContext(AbstractProxyCreator.SourcePrinter out,
JSONObject metaElem,
String widgetId,
ViewFactoryCreator.WidgetConsumer consumer) |
protected void |
createPostProcessingScope()
Create a new post-processing scope
|
String |
createVariableName(String varName) |
String |
createWidget(AbstractProxyCreator.SourcePrinter out,
JSONObject metaElem,
String widgetId,
ViewFactoryCreator.WidgetConsumer consumer)
Generates the code for the given widget creation.
|
JSONArray |
ensureChildren(JSONObject metaElem,
boolean acceptsNoChild,
String parentWidgetId) |
JSONObject |
ensureFirstChild(JSONObject metaElem,
boolean acceptsNoChild,
String parentWidgetId) |
String |
ensureHtmlChild(JSONObject metaElem,
boolean acceptsNoChild,
String parentWidgetId) |
String |
ensureTextChild(JSONObject metaElem,
boolean acceptsNoChild,
String parentWidgetId,
boolean addQuotes) |
JSONObject |
ensureWidget(JSONObject metaElem,
String parentWidgetId) |
static String |
getChildName(JSONObject childElement)
Retrieve the widget child element name
|
Class<?> |
getChildWidgetClass(JSONObject metaElem) |
String |
getChildWidgetClassName(JSONObject metaElem) |
com.google.gwt.core.ext.GeneratorContext |
getContext() |
protected ControllerAccessHandler |
getControllerAccessorHandler()
Retrieve the object responsible for print controller access expressions on client JS
|
String |
getDeclaredMessage(String property) |
protected Map<String,String> |
getDeclaredMessages() |
DeviceAdaptive.Device |
getDevice() |
com.google.gwt.core.ext.TreeLogger |
getLogger() |
protected String |
getLoggerVariable() |
ObjectDataBinding.PropertyBindInfo |
getObjectDataBinding(String propertyValue,
String widgetPropertyPath) |
ObjectDataBinding.PropertyBindInfo |
getObjectDataBinding(String propertyValue,
String widgetClassName,
String widgetPropertyPath) |
String |
getResourceAccessExpression(String property) |
AbstractProxyCreator.SourcePrinter |
getSubTypeWriter(String subType,
String superClass,
String[] interfaces,
String[] imports) |
AbstractProxyCreator.SourcePrinter |
getSubTypeWriter(String subType,
String superClass,
String[] interfaces,
String[] imports,
boolean isInterface)
Create a new printer for a subType.
|
AbstractProxyCreator.SourcePrinter |
getSubTypeWriter(String packageName,
String subType,
String superClass,
String[] interfaces,
String[] imports,
boolean isInterface)
Create a new printer for a subType.
|
View |
getView() |
protected String |
getViewVariable() |
Class<?> |
getWidgetClass() |
Class<?> |
getWidgetClass(String widgetDeclaration) |
String |
getWidgetClassName() |
String |
getWidgetFactoryDeclaration() |
boolean |
hasChildPartialSupport(JSONObject metaElem) |
static boolean |
hasHeight(JSONObject metaElem) |
boolean |
hasPartialSupport() |
static boolean |
hasWidth(JSONObject metaElem) |
abstract C |
instantiateContext() |
void |
instantiateWidget(AbstractProxyCreator.SourcePrinter out,
C context) |
protected boolean |
isCurrentDeviceSupported(DeviceAdaptive.Device[] supported) |
static boolean |
isHtmlChild(JSONObject metaElem) |
boolean |
isResourceReference(String property) |
static boolean |
isTextChild(JSONObject metaElem) |
boolean |
isWidget(JSONObject metaElem) |
void |
postProcess(AbstractProxyCreator.SourcePrinter out,
C context)
Process element children
|
protected void |
printlnPostProcessing(String s)
Print code that will be executed after the viewFactory completes the widgets construction
|
void |
processAttributes(AbstractProxyCreator.SourcePrinter out,
C context)
Process widget attributes
|
void |
processChildren(AbstractProxyCreator.SourcePrinter out,
C context)
Process element children
|
protected void |
processDataExpressionBindings(AbstractProxyCreator.SourcePrinter out,
C context)
Process any dataObject binding expression on this widget
|
protected void |
processDataObjectBindings(AbstractProxyCreator.SourcePrinter out,
C context)
Process any dataObject binding on this widget
|
void |
processEvents(AbstractProxyCreator.SourcePrinter out,
C context)
Process widget events
|
public JSONArray ensureChildren(JSONObject metaElem, boolean acceptsNoChild, String parentWidgetId) throws CruxGeneratorException
metaElem - acceptsNoChild - CruxGeneratorExceptionpublic JSONObject ensureFirstChild(JSONObject metaElem, boolean acceptsNoChild, String parentWidgetId) throws CruxGeneratorException
metaElem - acceptsNoChild - CruxGeneratorExceptionpublic String ensureHtmlChild(JSONObject metaElem, boolean acceptsNoChild, String parentWidgetId) throws CruxGeneratorException
metaElem - acceptsNoChild - CruxGeneratorExceptionpublic String ensureTextChild(JSONObject metaElem, boolean acceptsNoChild, String parentWidgetId, boolean addQuotes) throws CruxGeneratorException
metaElem - acceptsNoChild - CruxGeneratorExceptionpublic static String getChildName(JSONObject childElement)
childElement - element representing the childpublic static boolean hasHeight(JSONObject metaElem)
metaElem - public static boolean hasWidth(JSONObject metaElem)
metaElem - public static boolean isHtmlChild(JSONObject metaElem) throws CruxGeneratorException
metaElem - CruxGeneratorExceptionpublic static boolean isTextChild(JSONObject metaElem) throws CruxGeneratorException
metaElem - CruxGeneratorExceptionpublic String createChildWidget(AbstractProxyCreator.SourcePrinter out, JSONObject metaElem, WidgetCreatorContext context) throws CruxGeneratorException
out - metaElem - context - CruxGeneratorExceptionpublic String createChildWidget(AbstractProxyCreator.SourcePrinter out, JSONObject metaElem, ViewFactoryCreator.WidgetConsumer consumer, boolean allowWrapperForCreatedWidget, WidgetCreatorContext context) throws CruxGeneratorException
out - metaElem - consumer - allowWrapperForCreatedWidget - context - CruxGeneratorExceptionpublic String createChildWidget(AbstractProxyCreator.SourcePrinter out, JSONObject metaElem, String widgetId, String widgetType, ViewFactoryCreator.WidgetConsumer consumer, boolean allowWrapperForCreatedWidget, WidgetCreatorContext context) throws CruxGeneratorException
out - metaElem - widgetId - widgetType - consumer - allowWrapperForCreatedWidget - context - CruxGeneratorExceptionpublic String createWidget(AbstractProxyCreator.SourcePrinter out, JSONObject metaElem, String widgetId, ViewFactoryCreator.WidgetConsumer consumer) throws CruxGeneratorException
out - metaElem - widgetId - consumer - CruxGeneratorExceptionpublic JSONObject ensureWidget(JSONObject metaElem, String parentWidgetId)
element - public String getChildWidgetClassName(JSONObject metaElem)
metaElem - public Class<?> getChildWidgetClass(JSONObject metaElem)
metaElem - public com.google.gwt.core.ext.GeneratorContext getContext()
public AbstractProxyCreator.SourcePrinter getSubTypeWriter(String subType, String superClass, String[] interfaces, String[] imports)
subType - superClass - interfaces - imports - public AbstractProxyCreator.SourcePrinter getSubTypeWriter(String subType, String superClass, String[] interfaces, String[] imports, boolean isInterface)
ViewFactory.subType - superClass - interfaces - imports - isInterface - public AbstractProxyCreator.SourcePrinter getSubTypeWriter(String packageName, String subType, String superClass, String[] interfaces, String[] imports, boolean isInterface)
packageName - subType - superClass - interfaces - imports - isInterface - public String getResourceAccessExpression(String property)
property - public ObjectDataBinding.PropertyBindInfo getObjectDataBinding(String propertyValue, String widgetPropertyPath)
property - public ObjectDataBinding.PropertyBindInfo getObjectDataBinding(String propertyValue, String widgetClassName, String widgetPropertyPath)
property - public boolean isResourceReference(String property)
property - public com.google.gwt.core.ext.TreeLogger getLogger()
public View getView()
public DeviceAdaptive.Device getDevice()
public Class<?> getWidgetClass()
public String getWidgetClassName()
public String getWidgetFactoryDeclaration()
public boolean hasChildPartialSupport(JSONObject metaElem)
metaElem - public boolean hasPartialSupport()
public abstract C instantiateContext()
public void instantiateWidget(AbstractProxyCreator.SourcePrinter out, C context) throws CruxGeneratorException
out - context - CruxGeneratorExceptionpublic boolean isWidget(JSONObject metaElem)
metaElem - public void postProcess(AbstractProxyCreator.SourcePrinter out, C context) throws CruxGeneratorException
out - context - CruxGeneratorExceptionprotected void processDataObjectBindings(AbstractProxyCreator.SourcePrinter out, C context)
out - context - protected void processDataExpressionBindings(AbstractProxyCreator.SourcePrinter out, C context)
out - context - public void processAttributes(AbstractProxyCreator.SourcePrinter out, C context) throws CruxGeneratorException
out - element - page DOM element representing the widget (Its <span> tag)CruxGeneratorExceptionpublic void processChildren(AbstractProxyCreator.SourcePrinter out, C context) throws CruxGeneratorException
out - context - CruxGeneratorExceptionpublic void processEvents(AbstractProxyCreator.SourcePrinter out, C context) throws CruxGeneratorException
out - context - CruxGeneratorExceptionprotected C createContext(AbstractProxyCreator.SourcePrinter out, JSONObject metaElem, String widgetId, ViewFactoryCreator.WidgetConsumer consumer) throws CruxGeneratorException
srcWriter - element - widgetId - consumer - CruxGeneratorExceptionprotected boolean isCurrentDeviceSupported(DeviceAdaptive.Device[] supported)
supported - protected void createPostProcessingScope()
protected void commitPostProcessing(AbstractProxyCreator.SourcePrinter printer)
printer - protected void printlnPostProcessing(String s)
s - code stringprotected ControllerAccessHandler getControllerAccessorHandler()
protected String getLoggerVariable()
protected String getViewVariable()
Copyright © 2015. All rights reserved.