class 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 public  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);

}