@Test public void testSetDocuments() { final SelectableDocumentView selectableDocumentBean = makeSelectableDocument( "default: final List<Path> documents = new ArrayList<Path>() {{ add( selectableDocumentBean.getPath() ); }}; presenter.setDocuments( documents ); final ArgumentCaptor<SelectableDocumentView> selectableDocumentArgumentCaptor = ArgumentCaptor.forClass( SelectableDocumentView.class ); verify( presenter, times( 1 ) ).dispose(); verify( view, times( 1 ) ).addDocument( selectableDocumentArgumentCaptor.capture() ); final SelectableDocumentView selectableDocument = selectableDocumentArgumentCaptor.getValue(); assertNotNull( selectableDocument ); assertEquals( documents.get( 0 ).toURI(), selectableDocument.getPath().toURI() ); verify( view, times( 1 ) ).enableOKButton( eq( false ) ); }
@Override public void setDocuments(final List<Path> paths) { PortablePreconditions.checkNotNull("paths", paths); dispose(); for (Path path : paths) { final SelectableDocumentView document = makeSelectableDocument(path); selectableDocuments.add(document); view.addDocument(document); } view.enableOKButton(false); }
SelectDocumentPopup implements SelectDocumentPopupPresenter { @Override public void setDocuments(final List<Path> paths) { PortablePreconditions.checkNotNull("paths", paths); dispose(); for (Path path : paths) { final SelectableDocumentView document = makeSelectableDocument(path); selectableDocuments.add(document); view.addDocument(document); } view.enableOKButton(false); } }
SelectDocumentPopup implements SelectDocumentPopupPresenter { @Override public void setDocuments(final List<Path> paths) { PortablePreconditions.checkNotNull("paths", paths); dispose(); for (Path path : paths) { final SelectableDocumentView document = makeSelectableDocument(path); selectableDocuments.add(document); view.addDocument(document); } view.enableOKButton(false); } @Inject  SelectDocumentPopup(final SelectDocumentPopupView view,
                               final ManagedInstance<SelectableDocumentView> selectableDocumentProvider); }
SelectDocumentPopup implements SelectDocumentPopupPresenter { @Override public void setDocuments(final List<Path> paths) { PortablePreconditions.checkNotNull("paths", paths); dispose(); for (Path path : paths) { final SelectableDocumentView document = makeSelectableDocument(path); selectableDocuments.add(document); view.addDocument(document); } view.enableOKButton(false); } @Inject  SelectDocumentPopup(final SelectDocumentPopupView view,
                               final ManagedInstance<SelectableDocumentView> selectableDocumentProvider); @Override @PreDestroy void dispose(); @Override void setEditorPresenter(final KieMultipleDocumentEditorPresenter presenter); @Override void setDocuments(final List<Path> paths); @Override void show(); @Override void onOK(); @Override void onCancel(); }
SelectDocumentPopup implements SelectDocumentPopupPresenter { @Override public void setDocuments(final List<Path> paths) { PortablePreconditions.checkNotNull("paths", paths); dispose(); for (Path path : paths) { final SelectableDocumentView document = makeSelectableDocument(path); selectableDocuments.add(document); view.addDocument(document); } view.enableOKButton(false); } @Inject  SelectDocumentPopup(final SelectDocumentPopupView view,
                               final ManagedInstance<SelectableDocumentView> selectableDocumentProvider); @Override @PreDestroy void dispose(); @Override void setEditorPresenter(final KieMultipleDocumentEditorPresenter presenter); @Override void setDocuments(final List<Path> paths); @Override void show(); @Override void onOK(); @Override void onCancel();  }