@Test public void testDestroyOneDisplayer() { RenderMode renderMode = RenderMode.EDIT_MODE; NodeImpl 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.clearFormDisplayer(GRAPH_UUID, FIRST_ELEMENT_UUID); verify(firstDisplayer, times(3)).hide(); verify(view, times(1)).removeDisplayer(firstDisplayer); verify(displayersInstance, times(1)).destroy(firstDisplayer); verify(secondDisplayer, times(1)).hide(); verify(view, never()).removeDisplayer(secondDisplayer); verify(displayersInstance, never()).destroy(secondDisplayer); formsContainer.clearFormDisplayer(GRAPH_UUID, SECOND_ELEMENT_UUID); verify(secondDisplayer, times(2)).hide(); verify(view, times(1)).removeDisplayer(secondDisplayer); verify(displayersInstance, times(1)).destroy(secondDisplayer); }
public void clearFormDisplayer(final String graphUuid, final String elementUid) { formDisplayers.keySet() .stream() .filter(key -> key.getGraphUuid().equals(graphUuid) && key.getElementUid().equals(elementUid)) .findAny() .ifPresent(this::clearDisplayer); }
FormsContainer implements IsElement { public void clearFormDisplayer(final String graphUuid, final String elementUid) { formDisplayers.keySet() .stream() .filter(key -> key.getGraphUuid().equals(graphUuid) && key.getElementUid().equals(elementUid)) .findAny() .ifPresent(this::clearDisplayer); } }
FormsContainer implements IsElement { public void clearFormDisplayer(final String graphUuid, final String elementUid) { formDisplayers.keySet() .stream() .filter(key -> key.getGraphUuid().equals(graphUuid) && key.getElementUid().equals(elementUid)) .findAny() .ifPresent(this::clearDisplayer); } @Inject  FormsContainer(final FormsContainerView view,
                          final @Any ManagedInstance<FormDisplayer> displayersInstance,
                          final Event<FormFieldChanged> formFieldChangedEvent); }
FormsContainer implements IsElement { public void clearFormDisplayer(final String graphUuid, final String elementUid) { formDisplayers.keySet() .stream() .filter(key -> key.getGraphUuid().equals(graphUuid) && key.getElementUid().equals(elementUid)) .findAny() .ifPresent(this::clearDisplayer); } @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 clearFormDisplayer(final String graphUuid, final String elementUid) { formDisplayers.keySet() .stream() .filter(key -> key.getGraphUuid().equals(graphUuid) && key.getElementUid().equals(elementUid)) .findAny() .ifPresent(this::clearDisplayer); } @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();  }