@Override public void destroy() { super.destroy(); ((WidgetWrapperView) getView()).clear(); diagramSupplier = null; }
/** * Clears the widget state and view. * It can be used later on again. */ @Override public void clear() { getHandler().clear(); getView().clear(); }
protected void destroyInstances() { if (getHandler() != null) { getHandler().destroy(); } getView().clear(); }
@Test @SuppressWarnings("unchecked") public void testClear() { tested.open(session, callback); tested.clear(); verify(canvasHandler, times(1)).clear(); verify(view, times(1)).clear(); }
@Test @SuppressWarnings("unchecked") public void testClear() { tested.open(session, callback); tested.clear(); verify(canvasHandler, times(1)).clear(); verify(view, times(1)).clear(); }
@Test @SuppressWarnings("unchecked") public void testDestroy() { tested.open(session, callback); tested.destroy(); assertNull(tested.getInstance()); verify(canvasHandler, never()).destroy(); verify(view, times(1)).clear(); }
@Test @SuppressWarnings("unchecked") public void testClear() { tested.open(diagram, callback); tested.clear(); assertNull(tested.getInstance()); verify(canvasHandler, times(1)).clear(); verify(view, times(1)).clear(); }
@Test @SuppressWarnings("unchecked") public void testDestroy() { tested.open(session, callback); tested.destroy(); assertNull(tested.getInstance()); verify(canvasHandler, times(1)).destroy(); verify(view, times(1)).clear(); }
@Test @SuppressWarnings("unchecked") public void testDestroy() { tested.open(diagram, callback); tested.destroy(); assertNull(tested.getInstance()); verify(zoomControl, times(1)).destroyAll(); verify(selectionControl, times(1)).destroyAll(); verify(canvases, times(1)).destroyAll(); verify(canvasHandlers, times(1)).destroyAll(); verify(view, times(1)).clear(); }