@Test public void testSetMaxElements() { documentUpload.setMaxDocuments(5); verify(translationService).format(eq(Constants.DocumentUploadViewImplMaxDocuments), eq(5)); verify(view).setMaxDocuments(anyString()); documentUpload.setMaxDocuments(0); verify(view).setMaxDocuments(eq("")); }
public void setMaxDocuments(int maxDocuments) { this.maxDocuments = maxDocuments; if (maxDocuments > 0) { view.setMaxDocuments(translationService.format(Constants.DocumentUploadViewImplMaxDocuments, maxDocuments)); } else { view.setMaxDocuments(""); } }
DocumentUpload implements DocumentUploadView.Presenter,
                                       IsWidget { public void setMaxDocuments(int maxDocuments) { this.maxDocuments = maxDocuments; if (maxDocuments > 0) { view.setMaxDocuments(translationService.format(Constants.DocumentUploadViewImplMaxDocuments, maxDocuments)); } else { view.setMaxDocuments(""); } } }
DocumentUpload implements DocumentUploadView.Presenter,
                                       IsWidget { public void setMaxDocuments(int maxDocuments) { this.maxDocuments = maxDocuments; if (maxDocuments > 0) { view.setMaxDocuments(translationService.format(Constants.DocumentUploadViewImplMaxDocuments, maxDocuments)); } else { view.setMaxDocuments(""); } } @Inject  DocumentUpload(final DocumentUploadManager uploader, final DocumentUploadView view, final ManagedInstance<DocumentPreview> instance, final TranslationService translationService); }
DocumentUpload implements DocumentUploadView.Presenter,
                                       IsWidget { public void setMaxDocuments(int maxDocuments) { this.maxDocuments = maxDocuments; if (maxDocuments > 0) { view.setMaxDocuments(translationService.format(Constants.DocumentUploadViewImplMaxDocuments, maxDocuments)); } else { view.setMaxDocuments(""); } } @Inject  DocumentUpload(final DocumentUploadManager uploader, final DocumentUploadView view, final ManagedInstance<DocumentPreview> instance, final TranslationService translationService); @PostConstruct void init(); @Override Collection<DocumentPreview> getCurrentPreviews(); @Override void doUpload(final Document document, File file); @Override List<DocumentData> getValue(); @Override void setValue(List<DocumentData> value); void setEnabled(boolean enabled); void setMaxDocuments(int maxDocuments); @Override void setValue(List<DocumentData> value, boolean fireEvents); @Override HandlerRegistration addValueChangeHandler(ValueChangeHandler<List<DocumentData>> valueChangeHandler); @Override void fireEvent(GwtEvent<?> event); @Override Widget asWidget(); }
DocumentUpload implements DocumentUploadView.Presenter,
                                       IsWidget { public void setMaxDocuments(int maxDocuments) { this.maxDocuments = maxDocuments; if (maxDocuments > 0) { view.setMaxDocuments(translationService.format(Constants.DocumentUploadViewImplMaxDocuments, maxDocuments)); } else { view.setMaxDocuments(""); } } @Inject  DocumentUpload(final DocumentUploadManager uploader, final DocumentUploadView view, final ManagedInstance<DocumentPreview> instance, final TranslationService translationService); @PostConstruct void init(); @Override Collection<DocumentPreview> getCurrentPreviews(); @Override void doUpload(final Document document, File file); @Override List<DocumentData> getValue(); @Override void setValue(List<DocumentData> value); void setEnabled(boolean enabled); void setMaxDocuments(int maxDocuments); @Override void setValue(List<DocumentData> value, boolean fireEvents); @Override HandlerRegistration addValueChangeHandler(ValueChangeHandler<List<DocumentData>> valueChangeHandler); @Override void fireEvent(GwtEvent<?> event); @Override Widget asWidget();  }