Search in sources :

Example 1 with Section

use of org.kie.workbench.common.screens.library.client.settings.util.sections.Section 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)

Example 2 with Section

use of org.kie.workbench.common.screens.library.client.settings.util.sections.Section 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)

Aggregations

HTMLElement (elemental2.dom.HTMLElement)2 Promise (elemental2.promise.Promise)2 ArrayList (java.util.ArrayList)2 List (java.util.List)2 Supplier (java.util.function.Supplier)2 Collectors.toList (java.util.stream.Collectors.toList)2 Stream (java.util.stream.Stream)2 PostConstruct (javax.annotation.PostConstruct)2 Dependent (javax.enterprise.context.Dependent)2 Event (javax.enterprise.event.Event)2 Observes (javax.enterprise.event.Observes)2 Inject (javax.inject.Inject)2 WorkspaceProjectContext (org.guvnor.common.services.project.client.context.WorkspaceProjectContext)2 SettingsSections (org.kie.workbench.common.screens.library.client.settings.sections.SettingsSections)2 Section (org.kie.workbench.common.screens.library.client.settings.util.sections.Section)2 SectionManager (org.kie.workbench.common.screens.library.client.settings.util.sections.SectionManager)2 Promises (org.uberfire.client.promise.Promises)2 HasBusyIndicator (org.uberfire.ext.widgets.common.client.common.HasBusyIndicator)2 NotificationEvent (org.uberfire.workbench.events.NotificationEvent)2 ERROR (org.uberfire.workbench.events.NotificationEvent.NotificationType.ERROR)2