Search in sources :

Example 1 with WARNING

use of org.uberfire.workbench.events.NotificationEvent.NotificationType.WARNING in project kie-wb-common by kiegroup.

the class SettingsPresenter method setupSection.

Promise<Object> setupSection(final ProjectScreenModel model, final Section section) {
    return promises.resolve().then(ignore -> section.setup(model)).catch_(e -> {
        sections.remove(section);
        notificationEvent.fire(new NotificationEvent(getSectionSetupErrorMessage(section), WARNING));
        return promises.reject(e);
    }).then(i -> {
        section.getMenuItem().setup(section, this);
        resetDirtyIndicator(section);
        return promises.resolve();
    }).catch_(e -> {
        DomGlobal.console.info(e);
        return promises.resolve();
    });
}
Also used : ConcurrentChangePopup.newConcurrentUpdate(org.uberfire.ext.widgets.common.client.common.ConcurrentChangePopup.newConcurrentUpdate) HasBusyIndicator(org.uberfire.ext.widgets.common.client.common.HasBusyIndicator) Promises(org.uberfire.client.promise.Promises) ManagedInstance(org.jboss.errai.ioc.client.api.ManagedInstance) ListPresenter(org.kie.workbench.common.screens.library.client.settings.util.ListPresenter) HashMap(java.util.HashMap) SavePopUpPresenter(org.uberfire.ext.editor.commons.client.file.popups.SavePopUpPresenter) NotificationEvent(org.uberfire.workbench.events.NotificationEvent) Promise(elemental2.promise.Promise) Supplier(java.util.function.Supplier) ArrayList(java.util.ArrayList) Inject(javax.inject.Inject) UberElementalListItem(org.kie.workbench.common.screens.library.client.settings.util.UberElementalListItem) IsElement(org.jboss.errai.ui.client.local.api.elemental2.IsElement) ERROR(org.uberfire.workbench.events.NotificationEvent.NotificationType.ERROR) HTMLElement(elemental2.dom.HTMLElement) Map(java.util.Map) Observes(javax.enterprise.event.Observes) ProjectScreenService(org.kie.workbench.common.screens.projecteditor.service.ProjectScreenService) Customizable(org.uberfire.annotations.Customizable) DefaultErrorCallback(org.uberfire.ext.widgets.common.client.callbacks.DefaultErrorCallback) Event(javax.enterprise.event.Event) ListItemPresenter(org.kie.workbench.common.screens.library.client.settings.util.ListItemPresenter) DomGlobal(elemental2.dom.DomGlobal) ProjectScreenModel(org.kie.workbench.common.screens.projecteditor.model.ProjectScreenModel) WARNING(org.uberfire.workbench.events.NotificationEvent.NotificationType.WARNING) WorkspaceProjectContext(org.guvnor.common.services.project.client.context.WorkspaceProjectContext) List(java.util.List) DeploymentMode(org.guvnor.common.services.project.service.DeploymentMode) Message(org.jboss.errai.bus.client.api.messaging.Message) Collectors.toList(java.util.stream.Collectors.toList) Stream(java.util.stream.Stream) GAVAlreadyExistsException(org.guvnor.common.services.project.service.GAVAlreadyExistsException) OnOpen(org.uberfire.lifecycle.OnOpen) Dependent(javax.enterprise.context.Dependent) ConflictingRepositoriesPopup(org.guvnor.common.services.project.client.repositories.ConflictingRepositoriesPopup) ObservablePath(org.uberfire.backend.vfs.ObservablePath) SUCCESS(org.uberfire.workbench.events.NotificationEvent.NotificationType.SUCCESS) Caller(org.jboss.errai.common.client.api.Caller) PostConstruct(javax.annotation.PostConstruct) Optional(java.util.Optional) ApplicationScoped(javax.enterprise.context.ApplicationScoped) UberElemental(org.uberfire.client.mvp.UberElemental) NotificationEvent(org.uberfire.workbench.events.NotificationEvent)

Example 2 with WARNING

use of org.uberfire.workbench.events.NotificationEvent.NotificationType.WARNING in project kie-wb-common by kiegroup.

the class SettingsPresenter method setupSection.

Promise<Object> setupSection(final ProjectScreenModel model, final Section<ProjectScreenModel> section) {
    return section.setup(model).then(i -> {
        sectionManager.resetDirtyIndicator(section);
        return promises.resolve();
    }).catch_(e -> {
        sectionManager.remove(section);
        notificationEvent.fire(new NotificationEvent(getSectionSetupErrorMessage(section), WARNING));
        return promises.resolve();
    });
}
Also used : ConcurrentChangePopup.newConcurrentUpdate(org.uberfire.ext.widgets.common.client.common.ConcurrentChangePopup.newConcurrentUpdate) HasBusyIndicator(org.uberfire.ext.widgets.common.client.common.HasBusyIndicator) SectionManager(org.kie.workbench.common.screens.library.client.settings.util.sections.SectionManager) Promises(org.uberfire.client.promise.Promises) ManagedInstance(org.jboss.errai.ioc.client.api.ManagedInstance) SavePopUpPresenter(org.uberfire.ext.editor.commons.client.file.popups.SavePopUpPresenter) NotificationEvent(org.uberfire.workbench.events.NotificationEvent) Promise(elemental2.promise.Promise) Supplier(java.util.function.Supplier) ArrayList(java.util.ArrayList) Inject(javax.inject.Inject) ERROR(org.uberfire.workbench.events.NotificationEvent.NotificationType.ERROR) HTMLElement(elemental2.dom.HTMLElement) Observes(javax.enterprise.event.Observes) SettingsSections(org.kie.workbench.common.screens.library.client.settings.sections.SettingsSections) ProjectScreenService(org.kie.workbench.common.screens.projecteditor.service.ProjectScreenService) Customizable(org.uberfire.annotations.Customizable) Event(javax.enterprise.event.Event) ProjectScreenModel(org.kie.workbench.common.screens.projecteditor.model.ProjectScreenModel) WARNING(org.uberfire.workbench.events.NotificationEvent.NotificationType.WARNING) WorkspaceProjectContext(org.guvnor.common.services.project.client.context.WorkspaceProjectContext) List(java.util.List) DeploymentMode(org.guvnor.common.services.project.service.DeploymentMode) Collectors.toList(java.util.stream.Collectors.toList) Stream(java.util.stream.Stream) GAVAlreadyExistsException(org.guvnor.common.services.project.service.GAVAlreadyExistsException) Dependent(javax.enterprise.context.Dependent) ConflictingRepositoriesPopup(org.guvnor.common.services.project.client.repositories.ConflictingRepositoriesPopup) ObservablePath(org.uberfire.backend.vfs.ObservablePath) SUCCESS(org.uberfire.workbench.events.NotificationEvent.NotificationType.SUCCESS) Caller(org.jboss.errai.common.client.api.Caller) PostConstruct(javax.annotation.PostConstruct) ProjectController(org.guvnor.common.services.project.client.security.ProjectController) Section(org.kie.workbench.common.screens.library.client.settings.util.sections.Section) UberElemental(org.uberfire.client.mvp.UberElemental) NotificationEvent(org.uberfire.workbench.events.NotificationEvent)

Example 3 with WARNING

use of org.uberfire.workbench.events.NotificationEvent.NotificationType.WARNING in project kie-wb-common by kiegroup.

the class SettingsScreenPresenter method setupSection.

Promise<Object> setupSection(final SpaceScreenModel model, final Section<SpaceScreenModel> section) {
    return section.setup(model).then(i -> {
        sectionManager.resetDirtyIndicator(section);
        return promises.resolve();
    }).catch_(e -> {
        sectionManager.remove(section);
        notificationEvent.fire(new NotificationEvent(getSectionSetupErrorMessage(section), WARNING));
        return promises.resolve();
    });
}
Also used : HasBusyIndicator(org.uberfire.ext.widgets.common.client.common.HasBusyIndicator) SectionManager(org.kie.workbench.common.screens.library.client.settings.util.sections.SectionManager) Promises(org.uberfire.client.promise.Promises) SpaceSettings(org.kie.workbench.common.screens.library.client.screens.organizationalunit.settings.annotation.SpaceSettings) NotificationEvent(org.uberfire.workbench.events.NotificationEvent) Promise(elemental2.promise.Promise) Supplier(java.util.function.Supplier) SettingsSectionChange(org.kie.workbench.common.screens.library.client.settings.SettingsSectionChange) ArrayList(java.util.ArrayList) SettingsSectionChangeType(org.kie.workbench.common.screens.library.client.settings.SettingsSectionChangeType) Inject(javax.inject.Inject) ERROR(org.uberfire.workbench.events.NotificationEvent.NotificationType.ERROR) HTMLElement(elemental2.dom.HTMLElement) Observes(javax.enterprise.event.Observes) SettingsSections(org.kie.workbench.common.screens.library.client.settings.sections.SettingsSections) OrganizationalUnitController(org.guvnor.structure.client.security.OrganizationalUnitController) Event(javax.enterprise.event.Event) OrganizationalUnit(org.guvnor.structure.organizationalunit.OrganizationalUnit) LibraryConstants(org.kie.workbench.common.screens.library.client.resources.i18n.LibraryConstants) BusyIndicatorView(org.uberfire.ext.widgets.common.client.common.BusyIndicatorView) TranslationService(org.jboss.errai.ui.client.local.spi.TranslationService) WARNING(org.uberfire.workbench.events.NotificationEvent.NotificationType.WARNING) WorkspaceProjectContext(org.guvnor.common.services.project.client.context.WorkspaceProjectContext) SpaceScreenModel(org.kie.workbench.common.screens.library.api.settings.SpaceScreenModel) List(java.util.List) Collectors.toList(java.util.stream.Collectors.toList) Stream(java.util.stream.Stream) Dependent(javax.enterprise.context.Dependent) SUCCESS(org.uberfire.workbench.events.NotificationEvent.NotificationType.SUCCESS) PostConstruct(javax.annotation.PostConstruct) Section(org.kie.workbench.common.screens.library.client.settings.util.sections.Section) UberElement(org.uberfire.client.mvp.UberElement) NotificationEvent(org.uberfire.workbench.events.NotificationEvent)

Aggregations

HTMLElement (elemental2.dom.HTMLElement)3 Promise (elemental2.promise.Promise)3 ArrayList (java.util.ArrayList)3 List (java.util.List)3 Supplier (java.util.function.Supplier)3 Collectors.toList (java.util.stream.Collectors.toList)3 Stream (java.util.stream.Stream)3 PostConstruct (javax.annotation.PostConstruct)3 Dependent (javax.enterprise.context.Dependent)3 Event (javax.enterprise.event.Event)3 Observes (javax.enterprise.event.Observes)3 Inject (javax.inject.Inject)3 WorkspaceProjectContext (org.guvnor.common.services.project.client.context.WorkspaceProjectContext)3 Promises (org.uberfire.client.promise.Promises)3 HasBusyIndicator (org.uberfire.ext.widgets.common.client.common.HasBusyIndicator)3 NotificationEvent (org.uberfire.workbench.events.NotificationEvent)3 ERROR (org.uberfire.workbench.events.NotificationEvent.NotificationType.ERROR)3 SUCCESS (org.uberfire.workbench.events.NotificationEvent.NotificationType.SUCCESS)3 WARNING (org.uberfire.workbench.events.NotificationEvent.NotificationType.WARNING)3 ConflictingRepositoriesPopup (org.guvnor.common.services.project.client.repositories.ConflictingRepositoriesPopup)2