@Test public void testRenderExistingNode() { RenderMode renderMode = RenderMode.EDIT_MODE; NodeImpl<Definition<?>> firstNode = getNode(FIRST_ELEMENT_UUID); FormDisplayer firstDisplayer = testRender(firstNode, 1, 1, renderMode); NodeImpl secondNode = getNode(SECOND_ELEMENT_UUID); FormDisplayer secondDisplayer = testRender(secondNode, 2, 1, renderMode); formsContainer.render(GRAPH_UUID, firstNode.getUUID(), firstNode.getContent().getDefinition(), path, fieldChangeHandler, renderMode); verify(displayersInstance, times(2)).get(); verify(secondDisplayer, times(2)).hide(); verify(firstDisplayer, times(2)).show(); verify(firstDisplayer, times(2)).render(firstNode.getUUID(), firstNode.getContent().getDefinition(), path, fieldChangeHandler, renderMode); }
public void render(final String graphUuid, final String domainObjectUUID, final Object domainObject, final Path diagramPath, final FieldChangeHandler changeHandler, final RenderMode renderMode) { FormDisplayer displayer = getDisplayer(graphUuid, domainObjectUUID); displayer.render(domainObjectUUID, domainObject, diagramPath, changeHandler, renderMode); if (null != currentDisplayer && !displayer.equals(currentDisplayer)) { currentDisplayer.hide(); } displayer.show(); currentDisplayer = displayer; currentDisplayer.getRenderer().addFieldChangeHandler((name, value) -> { formFieldChangedEvent.fire(new FormFieldChanged(name, value, domainObjectUUID)); }); }
FormsContainer implements IsElement { public void render(final String graphUuid, final String domainObjectUUID, final Object domainObject, final Path diagramPath, final FieldChangeHandler changeHandler, final RenderMode renderMode) { FormDisplayer displayer = getDisplayer(graphUuid, domainObjectUUID); displayer.render(domainObjectUUID, domainObject, diagramPath, changeHandler, renderMode); if (null != currentDisplayer && !displayer.equals(currentDisplayer)) { currentDisplayer.hide(); } displayer.show(); currentDisplayer = displayer; currentDisplayer.getRenderer().addFieldChangeHandler((name, value) -> { formFieldChangedEvent.fire(new FormFieldChanged(name, value, domainObjectUUID)); }); } }
FormsContainer implements IsElement { public void render(final String graphUuid, final String domainObjectUUID, final Object domainObject, final Path diagramPath, final FieldChangeHandler changeHandler, final RenderMode renderMode) { FormDisplayer displayer = getDisplayer(graphUuid, domainObjectUUID); displayer.render(domainObjectUUID, domainObject, diagramPath, changeHandler, renderMode); if (null != currentDisplayer && !displayer.equals(currentDisplayer)) { currentDisplayer.hide(); } displayer.show(); currentDisplayer = displayer; currentDisplayer.getRenderer().addFieldChangeHandler((name, value) -> { formFieldChangedEvent.fire(new FormFieldChanged(name, value, domainObjectUUID)); }); } @Inject  FormsContainer(final FormsContainerView view,
                          final @Any ManagedInstance<FormDisplayer> displayersInstance,
                          final Event<FormFieldChanged> formFieldChangedEvent); }
FormsContainer implements IsElement { public void render(final String graphUuid, final String domainObjectUUID, final Object domainObject, final Path diagramPath, final FieldChangeHandler changeHandler, final RenderMode renderMode) { FormDisplayer displayer = getDisplayer(graphUuid, domainObjectUUID); displayer.render(domainObjectUUID, domainObject, diagramPath, changeHandler, renderMode); if (null != currentDisplayer && !displayer.equals(currentDisplayer)) { currentDisplayer.hide(); } displayer.show(); currentDisplayer = displayer; currentDisplayer.getRenderer().addFieldChangeHandler((name, value) -> { formFieldChangedEvent.fire(new FormFieldChanged(name, value, domainObjectUUID)); }); } @Inject  FormsContainer(final FormsContainerView view,
                          final @Any ManagedInstance<FormDisplayer> displayersInstance,
                          final Event<FormFieldChanged> formFieldChangedEvent); void render(final String graphUuid,
                       final String domainObjectUUID,
                       final Object domainObject,
                       final Path diagramPath,
                       final FieldChangeHandler changeHandler,
                       final RenderMode renderMode); void clearDiagramDisplayers(final String graphUuid); void clearFormDisplayer(final String graphUuid,
                                   final String elementUid); void flush(String graphUUID, String elementUUID); @Override HTMLElement getElement(); @PreDestroy void destroyAll(); }
FormsContainer implements IsElement { public void render(final String graphUuid, final String domainObjectUUID, final Object domainObject, final Path diagramPath, final FieldChangeHandler changeHandler, final RenderMode renderMode) { FormDisplayer displayer = getDisplayer(graphUuid, domainObjectUUID); displayer.render(domainObjectUUID, domainObject, diagramPath, changeHandler, renderMode); if (null != currentDisplayer && !displayer.equals(currentDisplayer)) { currentDisplayer.hide(); } displayer.show(); currentDisplayer = displayer; currentDisplayer.getRenderer().addFieldChangeHandler((name, value) -> { formFieldChangedEvent.fire(new FormFieldChanged(name, value, domainObjectUUID)); }); } @Inject  FormsContainer(final FormsContainerView view,
                          final @Any ManagedInstance<FormDisplayer> displayersInstance,
                          final Event<FormFieldChanged> formFieldChangedEvent); void render(final String graphUuid,
                       final String domainObjectUUID,
                       final Object domainObject,
                       final Path diagramPath,
                       final FieldChangeHandler changeHandler,
                       final RenderMode renderMode); void clearDiagramDisplayers(final String graphUuid); void clearFormDisplayer(final String graphUuid,
                                   final String elementUid); void flush(String graphUUID, String elementUUID); @Override HTMLElement getElement(); @PreDestroy void destroyAll();  }