@Test public void testSetup() { dependenciesPresenter.setup(mock(ProjectScreenModel.class)); verify(view).init(eq(dependenciesPresenter)); verify(dependencySelectorPopup).addSelectionHandler(any()); verify(enhancedDependenciesManager).init(any(), any()); }
@Override public Promise<Void> setup(final ProjectScreenModel model) { this.model = model; view.init(this); dependencySelectorPopup.addSelectionHandler(gav -> { final Dependency dependency = new Dependency(gav); dependency.setScope("compile"); add(dependency); }); return promises.create((resolve, reject) -> { enhancedDependenciesManager.init(model.getPOM(), dependencies -> { updateHashCode(dependencies); view.setItems(buildDependencyViews(model, dependencies)); resolve.onInvoke(promises.resolve()); fireChangeEvent(); }); enhancedDependenciesManager.update(); }); }
DependenciesPresenter extends Section<ProjectScreenModel> { @Override public Promise<Void> setup(final ProjectScreenModel model) { this.model = model; view.init(this); dependencySelectorPopup.addSelectionHandler(gav -> { final Dependency dependency = new Dependency(gav); dependency.setScope("compile"); add(dependency); }); return promises.create((resolve, reject) -> { enhancedDependenciesManager.init(model.getPOM(), dependencies -> { updateHashCode(dependencies); view.setItems(buildDependencyViews(model, dependencies)); resolve.onInvoke(promises.resolve()); fireChangeEvent(); }); enhancedDependenciesManager.update(); }); } }
DependenciesPresenter extends Section<ProjectScreenModel> { @Override public Promise<Void> setup(final ProjectScreenModel model) { this.model = model; view.init(this); dependencySelectorPopup.addSelectionHandler(gav -> { final Dependency dependency = new Dependency(gav); dependency.setScope("compile"); add(dependency); }); return promises.create((resolve, reject) -> { enhancedDependenciesManager.init(model.getPOM(), dependencies -> { updateHashCode(dependencies); view.setItems(buildDependencyViews(model, dependencies)); resolve.onInvoke(promises.resolve()); fireChangeEvent(); }); enhancedDependenciesManager.update(); }); } @Inject  DependenciesPresenter(final View view,
                                 final Promises promises,
                                 final MenuItem<ProjectScreenModel> menuItem,
                                 final DependencySelectorPopup dependencySelectorPopup,
                                 final Event<SettingsSectionChange<ProjectScreenModel>> settingsSectionChangeEvent,
                                 final EnhancedDependenciesManager enhancedDependenciesManager,
                                 final ManagedInstance<DependenciesItemPresenter> presenters); }
DependenciesPresenter extends Section<ProjectScreenModel> { @Override public Promise<Void> setup(final ProjectScreenModel model) { this.model = model; view.init(this); dependencySelectorPopup.addSelectionHandler(gav -> { final Dependency dependency = new Dependency(gav); dependency.setScope("compile"); add(dependency); }); return promises.create((resolve, reject) -> { enhancedDependenciesManager.init(model.getPOM(), dependencies -> { updateHashCode(dependencies); view.setItems(buildDependencyViews(model, dependencies)); resolve.onInvoke(promises.resolve()); fireChangeEvent(); }); enhancedDependenciesManager.update(); }); } @Inject  DependenciesPresenter(final View view,
                                 final Promises promises,
                                 final MenuItem<ProjectScreenModel> menuItem,
                                 final DependencySelectorPopup dependencySelectorPopup,
                                 final Event<SettingsSectionChange<ProjectScreenModel>> settingsSectionChangeEvent,
                                 final EnhancedDependenciesManager enhancedDependenciesManager,
                                 final ManagedInstance<DependenciesItemPresenter> presenters); @Override Promise<Void> setup(final ProjectScreenModel model); @Override Promise<Object> validate(); void addNewDependency(); void addAllToWhiteList(final Set<String> packages); void removeAllFromWhiteList(final Set<String> packages); void addFromRepository(); void remove(final EnhancedDependency enhancedDependency); @Override int currentHashCode(); @Override SectionView<?> getView(); }
DependenciesPresenter extends Section<ProjectScreenModel> { @Override public Promise<Void> setup(final ProjectScreenModel model) { this.model = model; view.init(this); dependencySelectorPopup.addSelectionHandler(gav -> { final Dependency dependency = new Dependency(gav); dependency.setScope("compile"); add(dependency); }); return promises.create((resolve, reject) -> { enhancedDependenciesManager.init(model.getPOM(), dependencies -> { updateHashCode(dependencies); view.setItems(buildDependencyViews(model, dependencies)); resolve.onInvoke(promises.resolve()); fireChangeEvent(); }); enhancedDependenciesManager.update(); }); } @Inject  DependenciesPresenter(final View view,
                                 final Promises promises,
                                 final MenuItem<ProjectScreenModel> menuItem,
                                 final DependencySelectorPopup dependencySelectorPopup,
                                 final Event<SettingsSectionChange<ProjectScreenModel>> settingsSectionChangeEvent,
                                 final EnhancedDependenciesManager enhancedDependenciesManager,
                                 final ManagedInstance<DependenciesItemPresenter> presenters); @Override Promise<Void> setup(final ProjectScreenModel model); @Override Promise<Object> validate(); void addNewDependency(); void addAllToWhiteList(final Set<String> packages); void removeAllFromWhiteList(final Set<String> packages); void addFromRepository(); void remove(final EnhancedDependency enhancedDependency); @Override int currentHashCode(); @Override SectionView<?> getView();  }