use of com.vaadin.client.InitialPropertiesHandler in project flow by vaadin.
the class SimpleElementBindingStrategy method doAppendVirtualChild.
private void doAppendVirtualChild(BindingContext context, StateNode node, boolean reactivePhase, Supplier<Element> elementLookup, String id, String address) {
if (!verifyAttachRequest(context.node, node, id, address)) {
return;
}
Element element = elementLookup.get();
if (verifyAttachedElement(element, node, id, address, context)) {
if (!reactivePhase) {
InitialPropertiesHandler initialPropertiesHandler = node.getTree().getRegistry().getInitialPropertiesHandler();
initialPropertiesHandler.nodeRegistered(node);
initialPropertiesHandler.flushPropertyUpdates();
}
node.setDomNode(element);
context.binderContext.createAndBind(node);
}
if (!reactivePhase) {
// Correct binding requires reactive involvement which doesn't
// happen automatically when we are out of the phase. So we
// should
// call <code>flush()</code> explicitly.
Reactive.flush();
}
}
use of com.vaadin.client.InitialPropertiesHandler in project flow by vaadin.
the class GwtStateTreeTest method gwtSetUp.
@Override
protected void gwtSetUp() throws Exception {
super.gwtSetUp();
registry = new Registry() {
{
set(ServerConnector.class, new TestServerConnector(this));
set(InitialPropertiesHandler.class, new InitialPropertiesHandler(this));
}
};
tree = new StateTree(registry);
}
use of com.vaadin.client.InitialPropertiesHandler in project flow by vaadin.
the class GwtTemplateBinderTest method gwtSetUp.
@Override
protected void gwtSetUp() throws Exception {
super.gwtSetUp();
registry = new Registry() {
{
set(TemplateRegistry.class, new TemplateRegistry());
set(ConstantPool.class, new ConstantPool());
set(ExistingElementMap.class, new ExistingElementMap());
set(InitialPropertiesHandler.class, new InitialPropertiesHandler(this));
set(StateTree.class, new StateTree(this) {
@Override
public void sendTemplateEventToServer(StateNode node, String methodName, JsArray<?> argValues) {
serverMethods.put(methodName, argValues);
serverRpcNodes.put(methodName, node);
}
});
}
};
tree = registry.getStateTree();
/**
* This state node is ALWAYS a template !!!
*/
stateNode = new StateNode(0, tree) {
@Override
public boolean hasFeature(int id) {
if (id == NodeFeatures.TEMPLATE) {
return true;
}
return super.hasFeature(id);
}
};
// Use the most common model structure by default
JsonObject modelType = Json.createObject();
modelType.put(MODEL_KEY, "String");
setModelType(stateNode, modelType);
}
Aggregations