@Test public void testInitialize() { this.widget.initialize(newResourceHandler); verify(view, times(1)).setDescription(eq(MODEL)); verify(view, times(1)).setTitle(eq(TITLE)); verify(view, times(1)).setCommand(any()); }
public void initialize(NewResourceHandler resourceHandler) { ResourceTypeDefinition resourceType = resourceHandler.getResourceType(); this.view.init(this); this.view.setTitle(resourceHandler.getDescription()); if (resourceType.getCategory() != null) { this.view.setDescription(ts.getTranslation(resourceType.getCategory().getName())); } if (resourceHandler.getIcon() != null) { this.view.setIcon(elemental2DomUtil.asHTMLElement(resourceHandler.getIcon().asWidget().getElement())); } this.view.setCommand(resourceHandler.getCommand(newResourcePresenter)); }
NewAssetHandlerCardWidget { public void initialize(NewResourceHandler resourceHandler) { ResourceTypeDefinition resourceType = resourceHandler.getResourceType(); this.view.init(this); this.view.setTitle(resourceHandler.getDescription()); if (resourceType.getCategory() != null) { this.view.setDescription(ts.getTranslation(resourceType.getCategory().getName())); } if (resourceHandler.getIcon() != null) { this.view.setIcon(elemental2DomUtil.asHTMLElement(resourceHandler.getIcon().asWidget().getElement())); } this.view.setCommand(resourceHandler.getCommand(newResourcePresenter)); } }
NewAssetHandlerCardWidget { public void initialize(NewResourceHandler resourceHandler) { ResourceTypeDefinition resourceType = resourceHandler.getResourceType(); this.view.init(this); this.view.setTitle(resourceHandler.getDescription()); if (resourceType.getCategory() != null) { this.view.setDescription(ts.getTranslation(resourceType.getCategory().getName())); } if (resourceHandler.getIcon() != null) { this.view.setIcon(elemental2DomUtil.asHTMLElement(resourceHandler.getIcon().asWidget().getElement())); } this.view.setCommand(resourceHandler.getCommand(newResourcePresenter)); } @Inject  NewAssetHandlerCardWidget(final NewAssetHandlerCardWidget.View view,
                                     final NewResourcePresenter newResourcePresenter,
                                     final TranslationService ts); }
NewAssetHandlerCardWidget { public void initialize(NewResourceHandler resourceHandler) { ResourceTypeDefinition resourceType = resourceHandler.getResourceType(); this.view.init(this); this.view.setTitle(resourceHandler.getDescription()); if (resourceType.getCategory() != null) { this.view.setDescription(ts.getTranslation(resourceType.getCategory().getName())); } if (resourceHandler.getIcon() != null) { this.view.setIcon(elemental2DomUtil.asHTMLElement(resourceHandler.getIcon().asWidget().getElement())); } this.view.setCommand(resourceHandler.getCommand(newResourcePresenter)); } @Inject  NewAssetHandlerCardWidget(final NewAssetHandlerCardWidget.View view,
                                     final NewResourcePresenter newResourcePresenter,
                                     final TranslationService ts); void initialize(NewResourceHandler resourceHandler); HTMLElement getView(); }
NewAssetHandlerCardWidget { public void initialize(NewResourceHandler resourceHandler) { ResourceTypeDefinition resourceType = resourceHandler.getResourceType(); this.view.init(this); this.view.setTitle(resourceHandler.getDescription()); if (resourceType.getCategory() != null) { this.view.setDescription(ts.getTranslation(resourceType.getCategory().getName())); } if (resourceHandler.getIcon() != null) { this.view.setIcon(elemental2DomUtil.asHTMLElement(resourceHandler.getIcon().asWidget().getElement())); } this.view.setCommand(resourceHandler.getCommand(newResourcePresenter)); } @Inject  NewAssetHandlerCardWidget(final NewAssetHandlerCardWidget.View view,
                                     final NewResourcePresenter newResourcePresenter,
                                     final TranslationService ts); void initialize(NewResourceHandler resourceHandler); HTMLElement getView();  }