class DeleteOrganizationalUnitPopUpPresenter {

    public void delete() {
        final String confirmedName = view.getConfirmedName();
        if (!organizationalUnit.getName().equals(confirmedName)) {
            view.showError(view.getWrongConfirmedNameValidationMessage());
            return;
        }

        view.showBusyIndicator(view.getDeletingMessage());
        organizationalUnitService.call(v -> {
                                           view.hideBusyIndicator();
                                           notificationEvent.fire(new NotificationEvent(view.getDeleteSuccessMessage(),
                                                                                        NotificationEvent.NotificationType.SUCCESS));
                                           view.hide();
                                           libraryPlaces.goToOrganizationalUnits();
                                       },
                                       new HasBusyIndicatorDefaultErrorCallback(view)).removeOrganizationalUnit(organizationalUnit.getName());
    }

    @Inject public  DeleteOrganizationalUnitPopUpPresenter(final View view,
                                                  final Caller<OrganizationalUnitService> organizationalUnitService,
                                                  final OrganizationalUnitController organizationalUnitController,
                                                  final Event<NotificationEvent> notificationEvent,
                                                  final LibraryPlaces libraryPlaces);

}