@Test public void testShowNullElement() { tested.init(); verify(formsCanvasSessionHandler).setRenderer(formRendererArgumentCaptor.capture()); final FormsCanvasSessionHandler.FormRenderer formRenderer = formRendererArgumentCaptor.getValue(); final Command command = mock(Command.class); formRenderer.render(GRAPH_UUID, (Element) null, command); verify(formsContainer, never()).render(any(), any(), any(), any(), any(), any()); verify(propertiesOpenedEvent, never()).fire(formPropertiesOpenedArgumentCaptor.capture()); verify(command, never()).execute(); }
@PostConstruct @SuppressWarnings("unchecked") public void init() { log(Level.INFO, "FormPropertiesWidget instance build."); formsFlushManager.setCurrentContainer(formsContainer); formSessionHandler.setRenderer(new FormsCanvasSessionHandler.FormRenderer() { @Override public void render(String graphUuid, Element element, Command callback) { show(graphUuid, element, callback); } @Override public void render(String graphUuid, DomainObject domainObject, Command callback) { show(graphUuid, domainObject, callback); } @Override public void clear(String graphUuid, Element element) { formsContainer.clearFormDisplayer(graphUuid, element.getUUID()); } @Override public void clearAll(String graphUuid) { formsContainer.clearDiagramDisplayers(graphUuid); } @Override public void resetCache() { resetLastElementRenderedCache(); } @Override public boolean areLastPositionsSameForElement(final Element element) { return areLastPositionsForSameElementSame(element); } }); view.init(this); }
FormPropertiesWidget implements IsElement,
                                             FormPropertiesWidgetView.Presenter { @PostConstruct @SuppressWarnings("unchecked") public void init() { log(Level.INFO, "FormPropertiesWidget instance build."); formsFlushManager.setCurrentContainer(formsContainer); formSessionHandler.setRenderer(new FormsCanvasSessionHandler.FormRenderer() { @Override public void render(String graphUuid, Element element, Command callback) { show(graphUuid, element, callback); } @Override public void render(String graphUuid, DomainObject domainObject, Command callback) { show(graphUuid, domainObject, callback); } @Override public void clear(String graphUuid, Element element) { formsContainer.clearFormDisplayer(graphUuid, element.getUUID()); } @Override public void clearAll(String graphUuid) { formsContainer.clearDiagramDisplayers(graphUuid); } @Override public void resetCache() { resetLastElementRenderedCache(); } @Override public boolean areLastPositionsSameForElement(final Element element) { return areLastPositionsForSameElementSame(element); } }); view.init(this); } }
FormPropertiesWidget implements IsElement,
                                             FormPropertiesWidgetView.Presenter { @PostConstruct @SuppressWarnings("unchecked") public void init() { log(Level.INFO, "FormPropertiesWidget instance build."); formsFlushManager.setCurrentContainer(formsContainer); formSessionHandler.setRenderer(new FormsCanvasSessionHandler.FormRenderer() { @Override public void render(String graphUuid, Element element, Command callback) { show(graphUuid, element, callback); } @Override public void render(String graphUuid, DomainObject domainObject, Command callback) { show(graphUuid, domainObject, callback); } @Override public void clear(String graphUuid, Element element) { formsContainer.clearFormDisplayer(graphUuid, element.getUUID()); } @Override public void clearAll(String graphUuid) { formsContainer.clearDiagramDisplayers(graphUuid); } @Override public void resetCache() { resetLastElementRenderedCache(); } @Override public boolean areLastPositionsSameForElement(final Element element) { return areLastPositionsForSameElementSame(element); } }); view.init(this); } @Inject  FormPropertiesWidget(final FormPropertiesWidgetView view,
                                final DefinitionUtils definitionUtils,
                                final FormsCanvasSessionHandler formSessionHandler,
                                final Event<FormPropertiesOpened> propertiesOpenedEvent,
                                final FormsContainer formsContainer,
                                final FormsFlushManager formsFlushManager,
                                final TranslationService translationService); }
FormPropertiesWidget implements IsElement,
                                             FormPropertiesWidgetView.Presenter { @PostConstruct @SuppressWarnings("unchecked") public void init() { log(Level.INFO, "FormPropertiesWidget instance build."); formsFlushManager.setCurrentContainer(formsContainer); formSessionHandler.setRenderer(new FormsCanvasSessionHandler.FormRenderer() { @Override public void render(String graphUuid, Element element, Command callback) { show(graphUuid, element, callback); } @Override public void render(String graphUuid, DomainObject domainObject, Command callback) { show(graphUuid, domainObject, callback); } @Override public void clear(String graphUuid, Element element) { formsContainer.clearFormDisplayer(graphUuid, element.getUUID()); } @Override public void clearAll(String graphUuid) { formsContainer.clearDiagramDisplayers(graphUuid); } @Override public void resetCache() { resetLastElementRenderedCache(); } @Override public boolean areLastPositionsSameForElement(final Element element) { return areLastPositionsForSameElementSame(element); } }); view.init(this); } @Inject  FormPropertiesWidget(final FormPropertiesWidgetView view,
                                final DefinitionUtils definitionUtils,
                                final FormsCanvasSessionHandler formSessionHandler,
                                final Event<FormPropertiesOpened> propertiesOpenedEvent,
                                final FormsContainer formsContainer,
                                final FormsFlushManager formsFlushManager,
                                final TranslationService translationService); @PostConstruct @SuppressWarnings("unchecked") void init(); @Override HTMLElement getElement(); @Override HTMLElement getDisplayerElement(); FormsCanvasSessionHandler getFormSessionHandler(); @SuppressWarnings("unchecked") FormPropertiesWidget bind(final ClientSession session); @SuppressWarnings("unchecked") FormPropertiesWidget unbind(); @PreDestroy void destroy(); void show(); @SuppressWarnings("unchecked") void show(final Command callback); void resetLastElementRenderedCache(); boolean areLastPositionsForSameElementSame(final Element element); }
FormPropertiesWidget implements IsElement,
                                             FormPropertiesWidgetView.Presenter { @PostConstruct @SuppressWarnings("unchecked") public void init() { log(Level.INFO, "FormPropertiesWidget instance build."); formsFlushManager.setCurrentContainer(formsContainer); formSessionHandler.setRenderer(new FormsCanvasSessionHandler.FormRenderer() { @Override public void render(String graphUuid, Element element, Command callback) { show(graphUuid, element, callback); } @Override public void render(String graphUuid, DomainObject domainObject, Command callback) { show(graphUuid, domainObject, callback); } @Override public void clear(String graphUuid, Element element) { formsContainer.clearFormDisplayer(graphUuid, element.getUUID()); } @Override public void clearAll(String graphUuid) { formsContainer.clearDiagramDisplayers(graphUuid); } @Override public void resetCache() { resetLastElementRenderedCache(); } @Override public boolean areLastPositionsSameForElement(final Element element) { return areLastPositionsForSameElementSame(element); } }); view.init(this); } @Inject  FormPropertiesWidget(final FormPropertiesWidgetView view,
                                final DefinitionUtils definitionUtils,
                                final FormsCanvasSessionHandler formSessionHandler,
                                final Event<FormPropertiesOpened> propertiesOpenedEvent,
                                final FormsContainer formsContainer,
                                final FormsFlushManager formsFlushManager,
                                final TranslationService translationService); @PostConstruct @SuppressWarnings("unchecked") void init(); @Override HTMLElement getElement(); @Override HTMLElement getDisplayerElement(); FormsCanvasSessionHandler getFormSessionHandler(); @SuppressWarnings("unchecked") FormPropertiesWidget bind(final ClientSession session); @SuppressWarnings("unchecked") FormPropertiesWidget unbind(); @PreDestroy void destroy(); void show(); @SuppressWarnings("unchecked") void show(final Command callback); void resetLastElementRenderedCache(); boolean areLastPositionsForSameElementSame(final Element element);  }