class NewContainerFormPresenter implements WizardPage {

    public boolean isValid() {
        if (mode.equals(Mode.OPTIONAL) && isEmpty()) {
            view.noErrors();
            return true;
        }
        boolean hasError = false;
        if (isContainerNameValid()) {
            view.noErrorOnContainerName();
        } else {
            view.errorOnContainerName();
            hasError = true;
        }

        if (isGroupIdValid()) {
            view.noErrorOnGroupId();
        } else {
            view.errorOnGroupId();
            hasError = true;
        }

        if (isArtifactIdValid()) {
            view.noErrorOnArtifactId();
        } else {
            view.errorOnArtifactId();
            hasError = true;
        }

        if (isVersionValid()) {
            if (isArtifactSupportedByServer()) {
                view.noErrorOnVersion();
            } else {
                view.errorOnVersion();

                view.errorProductionModeSupportsDoesntSnapshots();

                hasError = true;
            }
        } else {
            view.errorOnVersion();
            hasError = true;
        }

        return !hasError;
    }

    @Inject public  NewContainerFormPresenter(final Logger logger,
                                     final View view,
                                     final ManagedInstance<ArtifactListWidgetPresenter> artifactListWidgetPresenterProvider,
                                     final Caller<M2RepoService> m2RepoService,
                                     final Caller<SpecManagementService> specManagementService,
                                     final Event<WizardPageStatusChangeEvent> wizardPageStatusChangeEvent);

}