Search in sources :

Example 1 with ElementStylePropertyMap

use of com.vaadin.flow.internal.nodefeature.ElementStylePropertyMap in project flow by vaadin.

the class ElementTest method assertClientStyleKey.

private void assertClientStyleKey(String sentToClient, String setUsingStyleApi) {
    Element element = ElementFactory.createDiv();
    StateNode stateNode = element.getNode();
    ElementStylePropertyMap map = stateNode.getFeature(ElementStylePropertyMap.class);
    Style style = element.getStyle();
    style.set(setUsingStyleApi, "foo");
    Assert.assertEquals("foo", style.get(setUsingStyleApi));
    Assert.assertEquals(sentToClient, map.getPropertyNames().toArray()[0]);
    Assert.assertEquals("foo", map.getProperty(sentToClient));
}
Also used : ElementStylePropertyMap(com.vaadin.flow.internal.nodefeature.ElementStylePropertyMap) Element(com.vaadin.flow.dom.Element) StateNode(com.vaadin.flow.internal.StateNode) Style(com.vaadin.flow.dom.Style)

Aggregations

Element (com.vaadin.flow.dom.Element)1 Style (com.vaadin.flow.dom.Style)1 StateNode (com.vaadin.flow.internal.StateNode)1 ElementStylePropertyMap (com.vaadin.flow.internal.nodefeature.ElementStylePropertyMap)1