use of com.vaadin.client.flow.nodefeature.NodeMap in project flow by vaadin.
the class GwtMultipleBindingTest method testBindShadowRootDoubleBind.
public void testBindShadowRootDoubleBind() {
Binder.bind(node, element);
NodeMap shadow = node.getMap(NodeFeatures.SHADOW_ROOT_DATA);
shadow.getProperty(NodeProperties.SHADOW_ROOT).setValue(createChild(1));
Reactive.flush();
node.setBound();
Binder.bind(node, element);
}
use of com.vaadin.client.flow.nodefeature.NodeMap in project flow by vaadin.
the class GwtMultipleBindingTest method assertMapPropertiesDoubleBind.
private void assertMapPropertiesDoubleBind(int featureId) {
Binder.bind(node, element);
NodeMap props = node.getMap(featureId);
props.getProperty("foo").setValue("bar");
Reactive.flush();
node.setBound();
Binder.bind(node, element);
}
use of com.vaadin.client.flow.nodefeature.NodeMap in project flow by vaadin.
the class StateNodeTest method testGetMapFeature.
@Test
public void testGetMapFeature() {
NodeMap map = node.getMap(1);
Assert.assertEquals(1, map.getId());
List<NodeFeature> features = collectFeatures();
Assert.assertEquals(Arrays.asList(map), features);
NodeMap anotherMap = node.getMap(1);
Assert.assertSame(anotherMap, map);
}
use of com.vaadin.client.flow.nodefeature.NodeMap in project flow by vaadin.
the class StateTreeTest method sendNodePropertySyncToServer_initialProperty_propertyIsNoSent.
@Test
public void sendNodePropertySyncToServer_initialProperty_propertyIsNoSent() {
tree.registerNode(node);
NodeMap map = node.getMap(NodeFeatures.ELEMENT_PROPERTIES);
MapProperty property = new MapProperty("foo", map);
property.setValue("bar");
Mockito.when(propertyHandler.handlePropertyUpdate(property)).thenReturn(true);
connector.clear();
tree.sendNodePropertySyncToServer(property);
connector.assertMessage(null, null, null);
}
use of com.vaadin.client.flow.nodefeature.NodeMap in project flow by vaadin.
the class PollConfigurator method observe.
/**
* Observes the given node for poll configuration changes and configures the
* given poller accordingly.
*
* @param node
* the node containing the poll configuration
* @param poller
* the poller to configure
*/
public static void observe(StateNode node, Poller poller) {
NodeMap configurationMap = node.getMap(NodeFeatures.POLL_CONFIGURATION);
MapProperty pollIntervalProperty = configurationMap.getProperty(PollConfigurationMap.POLL_INTERVAL_KEY);
pollIntervalProperty.addChangeListener(e -> {
int interval = (int) (double) e.getNewValue();
poller.setInterval(interval);
});
}
Aggregations