class SettingsPresenter {

    Promise<Void> saveProjectScreenModel(final String comment,
                                         final DeploymentMode mode,
                                         final Supplier<Promise<Void>> chain) {

        if (concurrentPomUpdateInfo != null) {
            handlePomConcurrentUpdate(comment, chain);
            return promises.reject(sectionManager.getCurrentSection());
        }

        return promises.promisify(projectScreenService, s -> {
            return s.save(pathToPom, model, comment, mode);
        }).then(workspaceProject -> {
            projectContext.updateProjectModule(workspaceProject.getMainModule());
            return promises.resolve();
        }).catch_(o -> promises.catchOrExecute(o, e -> {
            if (e instanceof GAVAlreadyExistsException) {
                return handlePomConcurrentUpdate(comment, chain, (GAVAlreadyExistsException) e);
            } else {
                view.hideBusyIndicator();
                return promises.resolve();
            }
        }, x -> {
            view.hideBusyIndicator();
            return promises.reject(x);
        }));
    }

    @Inject public  SettingsPresenter(final View view,
                             final Promises promises,
                             final Event<NotificationEvent> notificationEvent,
                             final @Customizable SettingsSections<ProjectScreenModel> settingsSections,
                             final SavePopUpPresenter savePopUpPresenter,
                             final Caller<ProjectScreenService> projectScreenService,
                             final WorkspaceProjectContext projectContext,
                             final ManagedInstance<ObservablePath> observablePaths,
                             final ConflictingRepositoriesPopup conflictingRepositoriesPopup,
                             final SectionManager<ProjectScreenModel> sectionManager,
                             final ProjectController projectController);

}