class SettingsPresenter {

    public Promise<Void> setupUsingCurrentSection() {
        view.init(this);

        if (!projectContext.getActiveModule().isPresent()) {
            return promises.resolve();
        }

        view.showBusyIndicator();

        projectController.canUpdateProject(projectContext.getActiveWorkspaceProject().get()).then(userCanUpdateProject -> {
            if (!userCanUpdateProject) {
                view.disableActions();
            }

            return promises.resolve();
        });

        if (pathToPom != null) {
            pathToPom.dispose();
        }

        concurrentPomUpdateInfo = null;

        pathToPom = observablePaths.get().wrap(
                projectContext.getActiveModule().orElseThrow(() -> new RuntimeException("Can't get active module")).getPomXMLPath());

        pathToPom.onConcurrentUpdate(info -> concurrentPomUpdateInfo = info);

        return promises.promisify(projectScreenService, s -> {
            return s.load(pathToPom);
        }).then(model -> {
            this.model = model;
            return setupSections(model);
        }).then(i -> {
            view.hideBusyIndicator();
            if (sectionManager.manages(sectionManager.getCurrentSection())) {
                return sectionManager.goToCurrentSection();
            } else {
                return sectionManager.goToFirstAvailable();
            }
        }).catch_(o -> promises.catchOrExecute(o, e -> {
            view.hideBusyIndicator();
            return promises.reject(e);
        }, i -> {
            notificationEvent.fire(new NotificationEvent(view.getLoadErrorMessage(), ERROR));
            view.hideBusyIndicator();
            return promises.resolve();
        }));
    }

    @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);

}