use of elemental2.dom.Text in project kie-wb-common by kiegroup.
the class DecisionNavigatorTreeViewTest method testTreeItemUpdateLabel.
@Test
public void testTreeItemUpdateLabel() {
final DecisionNavigatorItem item = mock(DecisionNavigatorItem.class);
final Text textNode = mock(Text.class);
final String label = "label";
doReturn(item).when(treeItem).getItem();
doReturn(textNode).when(treeItem).getTextNode(label);
when(item.getLabel()).thenReturn(label);
treeItem.updateLabel();
assertEquals(label, inputText.value);
verify(textContent).appendChild(textNode);
}
use of elemental2.dom.Text in project vue-gwt by Axellience.
the class VueGWTObserverManager method makeStaticallyInitializedPropertiesReactive.
/**
* Due to GWT optimizations, properties on java object defined like this are not observable in
* Vue.js when not running in dev mode:
* <br>
* private String myText = "Default text";
* private int myInt = 0;
* <br>
* This is because GWT define the default value on the prototype and don't define it on the
* object.
* Therefore Vue.js don't see those properties when initializing it's observer.
* To fix the issue, we manually look for those properties and set them explicitly on the
* object.
* @param object The Java object to observe
* @param className The Java class name to observe
*/
private void makeStaticallyInitializedPropertiesReactive(JsObject object, String className) {
Map<String, Object> cache = classesPropertyCaches.get(className);
if (cache == null) {
cache = initClassPropertiesCache(object, className);
}
JsPropertyMap javaObjectPropertyMap = ((JsPropertyMap) object);
cache.forEach((key, value) -> {
if (!object.hasOwnProperty(key))
javaObjectPropertyMap.set(key, value);
});
}
Aggregations