@Test public void testSetup() { presenter.setup(pipelines); verify(view, times(1)).clear(); assertEquals(pipelines.size(), presenter.getItemPresenters().size()); verify(itemPresenterInstance, times(pipelines.size())).get(); for (int i = 0; i < presenter.getItemPresenters().size(); i++) { PipelineItemPresenter itemPresenter = presenter.getItemPresenters().get(i); verify(itemPresenter, times(1)).setup(pipelines.get(i)); verify(itemPresenter, times(1)).addContentChangeHandler(any(ContentChangeHandler.class)); verify(view, times(1)).addPipelineItem(itemPresenter.getView()); verify(itemPresenter, times(1)).addOthers(presenter.getItemPresenters()); } }
public void setup(final Collection<PipelineKey> pipelines) { clear(); pipelines.forEach(pipeline -> { final PipelineItemPresenter presenter = newItemPresenter(); presenter.setup(pipeline); presenter.addContentChangeHandler(this::onContentChange); itemPresenters.add(presenter); view.addPipelineItem(presenter.getView()); }); itemPresenters.forEach(item -> item.addOthers(itemPresenters)); }
SelectPipelinePagePresenter implements WizardPage { public void setup(final Collection<PipelineKey> pipelines) { clear(); pipelines.forEach(pipeline -> { final PipelineItemPresenter presenter = newItemPresenter(); presenter.setup(pipeline); presenter.addContentChangeHandler(this::onContentChange); itemPresenters.add(presenter); view.addPipelineItem(presenter.getView()); }); itemPresenters.forEach(item -> item.addOthers(itemPresenters)); } }
SelectPipelinePagePresenter implements WizardPage { public void setup(final Collection<PipelineKey> pipelines) { clear(); pipelines.forEach(pipeline -> { final PipelineItemPresenter presenter = newItemPresenter(); presenter.setup(pipeline); presenter.addContentChangeHandler(this::onContentChange); itemPresenters.add(presenter); view.addPipelineItem(presenter.getView()); }); itemPresenters.forEach(item -> item.addOthers(itemPresenters)); } @Inject  SelectPipelinePagePresenter(final View view,
                                       final Event<WizardPageStatusChangeEvent> wizardPageStatusChangeEvent,
                                       final ManagedInstance<PipelineItemPresenter> itemPresenterInstance); }
SelectPipelinePagePresenter implements WizardPage { public void setup(final Collection<PipelineKey> pipelines) { clear(); pipelines.forEach(pipeline -> { final PipelineItemPresenter presenter = newItemPresenter(); presenter.setup(pipeline); presenter.addContentChangeHandler(this::onContentChange); itemPresenters.add(presenter); view.addPipelineItem(presenter.getView()); }); itemPresenters.forEach(item -> item.addOthers(itemPresenters)); } @Inject  SelectPipelinePagePresenter(final View view,
                                       final Event<WizardPageStatusChangeEvent> wizardPageStatusChangeEvent,
                                       final ManagedInstance<PipelineItemPresenter> itemPresenterInstance); @PostConstruct void init(); void setup(final Collection<PipelineKey> pipelines); @Override void initialise(); @Override void prepareView(); @Override void isComplete(final Callback<Boolean> callback); void clear(); @Override String getTitle(); @Override Widget asWidget(); PipelineKey getPipeline(); }
SelectPipelinePagePresenter implements WizardPage { public void setup(final Collection<PipelineKey> pipelines) { clear(); pipelines.forEach(pipeline -> { final PipelineItemPresenter presenter = newItemPresenter(); presenter.setup(pipeline); presenter.addContentChangeHandler(this::onContentChange); itemPresenters.add(presenter); view.addPipelineItem(presenter.getView()); }); itemPresenters.forEach(item -> item.addOthers(itemPresenters)); } @Inject  SelectPipelinePagePresenter(final View view,
                                       final Event<WizardPageStatusChangeEvent> wizardPageStatusChangeEvent,
                                       final ManagedInstance<PipelineItemPresenter> itemPresenterInstance); @PostConstruct void init(); void setup(final Collection<PipelineKey> pipelines); @Override void initialise(); @Override void prepareView(); @Override void isComplete(final Callback<Boolean> callback); void clear(); @Override String getTitle(); @Override Widget asWidget(); PipelineKey getPipeline();  }