|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.cruxframework.crux.core.rebind.screen.widget.WidgetCreator<C>
public abstract class WidgetCreator<C extends WidgetCreatorContext>
Generate code for gwt widgets creation. Generates code based on a JSON meta data array containing the information declared on crux pages.
| Nested Class Summary | |
|---|---|
static class |
WidgetCreator.StyleNameProcessor
|
static class |
WidgetCreator.StyleProcessor
|
static class |
WidgetCreator.ViewPermissionAttributeProcessor
Process viewPermission attribute |
| Constructor Summary | |
|---|---|
WidgetCreator()
|
|
| Method Summary | |
|---|---|
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()
|
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 |
void |
processEvents(AbstractProxyCreator.SourcePrinter out,
C context)
Process widget events |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public WidgetCreator()
| Method Detail |
|---|
public JSONArray ensureChildren(JSONObject metaElem,
boolean acceptsNoChild,
String parentWidgetId)
throws CruxGeneratorException
metaElem - acceptsNoChild -
CruxGeneratorException
public JSONObject ensureFirstChild(JSONObject metaElem,
boolean acceptsNoChild,
String parentWidgetId)
throws CruxGeneratorException
metaElem - acceptsNoChild -
CruxGeneratorException
public String ensureHtmlChild(JSONObject metaElem,
boolean acceptsNoChild,
String parentWidgetId)
throws CruxGeneratorException
metaElem - acceptsNoChild -
CruxGeneratorException
public String ensureTextChild(JSONObject metaElem,
boolean acceptsNoChild,
String parentWidgetId,
boolean addQuotes)
throws CruxGeneratorException
metaElem - acceptsNoChild -
CruxGeneratorExceptionpublic static String getChildName(JSONObject childElement)
childElement - element representing the child
public static boolean hasHeight(JSONObject metaElem)
metaElem -
public static boolean hasWidth(JSONObject metaElem)
metaElem -
public static boolean isHtmlChild(JSONObject metaElem)
throws CruxGeneratorException
metaElem -
CruxGeneratorException
public static boolean isTextChild(JSONObject metaElem)
throws CruxGeneratorException
metaElem -
CruxGeneratorException
public String createChildWidget(AbstractProxyCreator.SourcePrinter out,
JSONObject metaElem,
WidgetCreatorContext context)
throws CruxGeneratorException
out - metaElem - context -
CruxGeneratorException
public String createChildWidget(AbstractProxyCreator.SourcePrinter out,
JSONObject metaElem,
ViewFactoryCreator.WidgetConsumer consumer,
boolean allowWrapperForCreatedWidget,
WidgetCreatorContext context)
throws CruxGeneratorException
out - metaElem - consumer - allowWrapperForCreatedWidget - context -
CruxGeneratorException
public 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 createVariableName(String varName)
varName -
public String createWidget(AbstractProxyCreator.SourcePrinter out,
JSONObject metaElem,
String widgetId,
ViewFactoryCreator.WidgetConsumer consumer)
throws CruxGeneratorException
out - metaElem - widgetId - consumer -
CruxGeneratorException
public 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 getDeclaredMessage(String property)
property -
public String getResourceAccessExpression(String property)
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 Class<?> getWidgetClass(String widgetDeclaration)
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 -
CruxGeneratorException
public void processAttributes(AbstractProxyCreator.SourcePrinter out,
C context)
throws CruxGeneratorException
out - element - page DOM element representing the widget (Its <span> tag)
CruxGeneratorException
public void processChildren(AbstractProxyCreator.SourcePrinter out,
C context)
throws CruxGeneratorException
out - context -
CruxGeneratorException
public void processEvents(AbstractProxyCreator.SourcePrinter out,
C context)
throws CruxGeneratorException
out - context -
CruxGeneratorException
protected 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()
protected Map<String,String> getDeclaredMessages()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||