@Test public void checkSizeIsSetBeforeUriWhenShowing() { final InOrder inOrder = inOrder(view, view); final SafeUri uri = mock(SafeUri.class); final DiagramRepresentation diagramRepresentation = mock(DiagramRepresentation.class); when(diagramRepresentation.getDefinitionSetId()).thenReturn("defId"); when(shapeManager.getThumbnail(eq("defId"))).thenReturn(uri); when(diagramRepresentation.getThumbImageData()).thenReturn(null); diagramNavigatorItem.show(diagramRepresentation, 100, 200, () -> { }); inOrder.verify(view).setItemPxSize(eq(100), eq(200)); inOrder.verify(view).setThumbUri(eq(uri)); }
public void show(final DiagramRepresentation diagramRepresentation, final int widthInPx, final int heightInPx, final Command callback) { this.callback = callback; this.name = diagramRepresentation.getName(); view.setUUID(name); view.setItemTitle(diagramRepresentation.getTitle()); view.setItemPxSize(widthInPx, heightInPx); final String thumbData = diagramRepresentation.getThumbImageData(); if (isEmpty(thumbData)) { final String defSetId = diagramRepresentation.getDefinitionSetId(); final SafeUri thumbUri = shapeManager.getThumbnail(defSetId); view.setThumbUri(thumbUri); } else { view.setThumbData(thumbData); } }
DiagramNavigatorItemImpl implements IsWidget,
                                                 DiagramNavigatorItem { public void show(final DiagramRepresentation diagramRepresentation, final int widthInPx, final int heightInPx, final Command callback) { this.callback = callback; this.name = diagramRepresentation.getName(); view.setUUID(name); view.setItemTitle(diagramRepresentation.getTitle()); view.setItemPxSize(widthInPx, heightInPx); final String thumbData = diagramRepresentation.getThumbImageData(); if (isEmpty(thumbData)) { final String defSetId = diagramRepresentation.getDefinitionSetId(); final SafeUri thumbUri = shapeManager.getThumbnail(defSetId); view.setThumbUri(thumbUri); } else { view.setThumbData(thumbData); } } }
DiagramNavigatorItemImpl implements IsWidget,
                                                 DiagramNavigatorItem { public void show(final DiagramRepresentation diagramRepresentation, final int widthInPx, final int heightInPx, final Command callback) { this.callback = callback; this.name = diagramRepresentation.getName(); view.setUUID(name); view.setItemTitle(diagramRepresentation.getTitle()); view.setItemPxSize(widthInPx, heightInPx); final String thumbData = diagramRepresentation.getThumbImageData(); if (isEmpty(thumbData)) { final String defSetId = diagramRepresentation.getDefinitionSetId(); final SafeUri thumbUri = shapeManager.getThumbnail(defSetId); view.setThumbUri(thumbUri); } else { view.setThumbData(thumbData); } } @Inject  DiagramNavigatorItemImpl(final ShapeManager shapeManager,
                                    final NavigatorItemView<NavigatorItem> view); }
DiagramNavigatorItemImpl implements IsWidget,
                                                 DiagramNavigatorItem { public void show(final DiagramRepresentation diagramRepresentation, final int widthInPx, final int heightInPx, final Command callback) { this.callback = callback; this.name = diagramRepresentation.getName(); view.setUUID(name); view.setItemTitle(diagramRepresentation.getTitle()); view.setItemPxSize(widthInPx, heightInPx); final String thumbData = diagramRepresentation.getThumbImageData(); if (isEmpty(thumbData)) { final String defSetId = diagramRepresentation.getDefinitionSetId(); final SafeUri thumbUri = shapeManager.getThumbnail(defSetId); view.setThumbUri(thumbUri); } else { view.setThumbData(thumbData); } } @Inject  DiagramNavigatorItemImpl(final ShapeManager shapeManager,
                                    final NavigatorItemView<NavigatorItem> view); @PostConstruct void init(); @Override Widget asWidget(); void show(final DiagramRepresentation diagramRepresentation,
                     final int widthInPx,
                     final int heightInPx,
                     final Command callback); @Override String getName(); @Override NavigatorItemView getView(); @Override void onItemSelected(); @PreDestroy void destroy(); @Override boolean equals(final Object o); @Override int hashCode(); }
DiagramNavigatorItemImpl implements IsWidget,
                                                 DiagramNavigatorItem { public void show(final DiagramRepresentation diagramRepresentation, final int widthInPx, final int heightInPx, final Command callback) { this.callback = callback; this.name = diagramRepresentation.getName(); view.setUUID(name); view.setItemTitle(diagramRepresentation.getTitle()); view.setItemPxSize(widthInPx, heightInPx); final String thumbData = diagramRepresentation.getThumbImageData(); if (isEmpty(thumbData)) { final String defSetId = diagramRepresentation.getDefinitionSetId(); final SafeUri thumbUri = shapeManager.getThumbnail(defSetId); view.setThumbUri(thumbUri); } else { view.setThumbData(thumbData); } } @Inject  DiagramNavigatorItemImpl(final ShapeManager shapeManager,
                                    final NavigatorItemView<NavigatorItem> view); @PostConstruct void init(); @Override Widget asWidget(); void show(final DiagramRepresentation diagramRepresentation,
                     final int widthInPx,
                     final int heightInPx,
                     final Command callback); @Override String getName(); @Override NavigatorItemView getView(); @Override void onItemSelected(); @PreDestroy void destroy(); @Override boolean equals(final Object o); @Override int hashCode();  }