public class SimpleBindingProcessor extends Object implements AdvancedWidgetProcessor<com.google.gwt.user.client.ui.Widget,GwtMetawidget>
Constructor and Description |
---|
SimpleBindingProcessor() |
SimpleBindingProcessor(SimpleBindingProcessorConfig config) |
Modifier and Type | Method and Description |
---|---|
protected <T extends SimpleBindingProcessorAdapter<?>> |
getAdapter(Class<?> classToBindTo)
Gets the Adapter for the given class (if any).
|
void |
onEndBuild(GwtMetawidget metawidget)
Event called at the end of widget building, after all widgets have been built and added to
the
Layout . |
void |
onStartBuild(GwtMetawidget metawidget)
Event called at the start of the widget building process, before the
WidgetBuilder is called. |
com.google.gwt.user.client.ui.Widget |
processWidget(com.google.gwt.user.client.ui.Widget widget,
String elementName,
Map<String,String> attributes,
GwtMetawidget metawidget)
Process the given widget.
|
void |
rebind(Object toRebind,
GwtMetawidget metawidget)
Rebinds the Metawidget to the given Object.
|
void |
save(GwtMetawidget metawidget) |
public SimpleBindingProcessor()
public SimpleBindingProcessor(SimpleBindingProcessorConfig config)
public void onStartBuild(GwtMetawidget metawidget)
AdvancedWidgetProcessor
WidgetBuilder
is called. WidgetProcessor
s may wish to act on this
event to initialize themselves ready for processing. This event is only called once per
inspection, not once per widget built.onStartBuild
in interface AdvancedWidgetProcessor<com.google.gwt.user.client.ui.Widget,GwtMetawidget>
metawidget
- the parent Metawidget. Never nullpublic com.google.gwt.user.client.ui.Widget processWidget(com.google.gwt.user.client.ui.Widget widget, String elementName, Map<String,String> attributes, GwtMetawidget metawidget)
WidgetProcessor
WidgetBuilder
, and before it is added to the Layout
.processWidget
in interface WidgetProcessor<com.google.gwt.user.client.ui.Widget,GwtMetawidget>
widget
- the widget to process. Never nullelementName
- XML node name of the business field. Typically 'entity', 'property' or 'action'.
Never nullattributes
- attributes of the widget to process. Never null. This Map is modifiable - changes
will be passed to subsequent WidgetProcessors and Layoutsmetawidget
- the parent Metawidget. Never nullpublic void rebind(Object toRebind, GwtMetawidget metawidget)
This method is an optimization that allows clients to load a new object into the binding without calling setToInspect, and therefore without reinspecting the object or recreating the components. It is the client's responsbility to ensure the rebound object is compatible with the original setToInspect.
public void save(GwtMetawidget metawidget)
public void onEndBuild(GwtMetawidget metawidget)
AdvancedWidgetProcessor
Layout
. WidgetProcessor
s may wish to act on this event to clean
themselves up after processing. This event is only called once per inspection, not once per
widget built.onEndBuild
in interface AdvancedWidgetProcessor<com.google.gwt.user.client.ui.Widget,GwtMetawidget>
metawidget
- the parent Metawidget. Never nullprotected <T extends SimpleBindingProcessorAdapter<?>> T getAdapter(Class<?> classToBindTo)
Includes traversing superclasses of the given classToBindTo
for a suitable
Adapter, so for example registering an Adapter for Contact.class
will match
PersonalContact.class
, BusinessContact.class
etc., unless a more
subclass-specific Adapter is also registered.
Copyright © 2015. All Rights Reserved.