Search in sources :

Example 6 with HasBusyIndicatorDefaultErrorCallback

use of org.uberfire.ext.widgets.common.client.callbacks.HasBusyIndicatorDefaultErrorCallback in project drools-wb by kiegroup.

the class NewGuidedRuleHandler method create.

@Override
public void create(final Package pkg, final String baseFileName, final NewResourcePresenter presenter) {
    final RuleModel ruleModel = new RuleModel();
    final boolean useDSL = useDSLCheckbox.getValue();
    final ClientResourceType resourceType = (useDSL ? resourceTypeDSLR : resourceTypeDRL);
    ruleModel.name = baseFileName;
    busyIndicatorView.showBusyIndicator(CommonConstants.INSTANCE.Saving());
    service.call(getSuccessCallback(presenter), new HasBusyIndicatorDefaultErrorCallback(busyIndicatorView)).create(pkg.getPackageMainResourcesPath(), buildFileName(baseFileName, resourceType), ruleModel, "");
}
Also used : HasBusyIndicatorDefaultErrorCallback(org.uberfire.ext.widgets.common.client.callbacks.HasBusyIndicatorDefaultErrorCallback) ClientResourceType(org.uberfire.client.workbench.type.ClientResourceType) RuleModel(org.drools.workbench.models.datamodel.rule.RuleModel)

Example 7 with HasBusyIndicatorDefaultErrorCallback

use of org.uberfire.ext.widgets.common.client.callbacks.HasBusyIndicatorDefaultErrorCallback in project drools-wb by kiegroup.

the class NewGuidedScoreCardHandler method create.

@Override
public void create(final Package pkg, final String baseFileName, final NewResourcePresenter presenter) {
    final ScoreCardModel model = new ScoreCardModel();
    model.setName(baseFileName);
    model.setPackageName(pkg.getPackageName());
    busyIndicatorView.showBusyIndicator(CommonConstants.INSTANCE.Saving());
    scoreCardService.call(getSuccessCallback(presenter), new HasBusyIndicatorDefaultErrorCallback(busyIndicatorView)).create(pkg.getPackageMainResourcesPath(), buildFileName(baseFileName, resourceType), model, "");
}
Also used : ScoreCardModel(org.drools.workbench.models.guided.scorecard.shared.ScoreCardModel) HasBusyIndicatorDefaultErrorCallback(org.uberfire.ext.widgets.common.client.callbacks.HasBusyIndicatorDefaultErrorCallback)

Example 8 with HasBusyIndicatorDefaultErrorCallback

use of org.uberfire.ext.widgets.common.client.callbacks.HasBusyIndicatorDefaultErrorCallback in project kie-wb-common by kiegroup.

the class OrganizationalUnitPopUpPresenter method saveCreation.

void saveCreation(final String name, final String defaultGroupId, final String owner) {
    final Command saveCommand = () -> {
        final Collection<Repository> repositories = new ArrayList<>();
        final List<String> contributors = contributorsManagementPresenter.getSelectedContributorsUserNames();
        final RemoteCallback<OrganizationalUnit> successCallback = (OrganizationalUnit newOrganizationalUnit) -> {
            afterCreateOrganizationalUnitEvent.fire(new AfterCreateOrganizationalUnitEvent(newOrganizationalUnit));
            view.hideBusyIndicator();
            notificationEvent.fire(new NotificationEvent(view.getSaveSuccessMessage(), NotificationEvent.NotificationType.SUCCESS));
            view.hide();
        };
        final HasBusyIndicatorDefaultErrorCallback errorCallback = new HasBusyIndicatorDefaultErrorCallback(view);
        organizationalUnitService.call(successCallback, errorCallback).createOrganizationalUnit(name, owner, defaultGroupId, repositories, contributors);
    };
    validateDuplicatedOrganizationalUnit(name, saveCommand);
}
Also used : OrganizationalUnit(org.guvnor.structure.organizationalunit.OrganizationalUnit) Command(org.uberfire.mvp.Command) AfterCreateOrganizationalUnitEvent(org.guvnor.structure.events.AfterCreateOrganizationalUnitEvent) HasBusyIndicatorDefaultErrorCallback(org.uberfire.ext.widgets.common.client.callbacks.HasBusyIndicatorDefaultErrorCallback) Collection(java.util.Collection) ArrayList(java.util.ArrayList) List(java.util.List) NotificationEvent(org.uberfire.workbench.events.NotificationEvent) RemoteCallback(org.jboss.errai.common.client.api.RemoteCallback)

Example 9 with HasBusyIndicatorDefaultErrorCallback

use of org.uberfire.ext.widgets.common.client.callbacks.HasBusyIndicatorDefaultErrorCallback in project kie-wb-common by kiegroup.

the class DataSourceDefEditor method _save.

/**
 * Performs the formal save of the data source.
 */
protected void _save() {
    savePopUpPresenter.show(versionRecordManager.getCurrentPath(), new ParameterizedCommand<String>() {

        @Override
        public void execute(final String commitMessage) {
            editorService.call(getSaveSuccessCallback(getContent().hashCode()), new HasBusyIndicatorDefaultErrorCallback(view)).save(versionRecordManager.getCurrentPath(), getContent(), commitMessage);
        }
    });
    concurrentUpdateSessionInfo = null;
}
Also used : HasBusyIndicatorDefaultErrorCallback(org.uberfire.ext.widgets.common.client.callbacks.HasBusyIndicatorDefaultErrorCallback)

Example 10 with HasBusyIndicatorDefaultErrorCallback

use of org.uberfire.ext.widgets.common.client.callbacks.HasBusyIndicatorDefaultErrorCallback in project kie-wb-common by kiegroup.

the class DriverDefEditor method _save.

/**
 * Performs the formal save of the driver.
 */
protected void _save() {
    savePopUpPresenter.show(versionRecordManager.getCurrentPath(), new ParameterizedCommand<String>() {

        @Override
        public void execute(final String commitMessage) {
            editorService.call(getSaveSuccessCallback(getContent().hashCode()), new HasBusyIndicatorDefaultErrorCallback(view)).save(versionRecordManager.getCurrentPath(), getContent(), commitMessage);
        }
    });
    concurrentUpdateSessionInfo = null;
}
Also used : HasBusyIndicatorDefaultErrorCallback(org.uberfire.ext.widgets.common.client.callbacks.HasBusyIndicatorDefaultErrorCallback)

Aggregations

HasBusyIndicatorDefaultErrorCallback (org.uberfire.ext.widgets.common.client.callbacks.HasBusyIndicatorDefaultErrorCallback)17 GuidedDecisionTable52 (org.drools.workbench.models.guided.dtable.shared.model.GuidedDecisionTable52)3 RemoteCallback (org.jboss.errai.common.client.api.RemoteCallback)3 HashMap (java.util.HashMap)2 ObservablePath (org.uberfire.backend.vfs.ObservablePath)2 Path (org.uberfire.backend.vfs.Path)2 ClientResourceType (org.uberfire.client.workbench.type.ClientResourceType)2 NotificationEvent (org.uberfire.workbench.events.NotificationEvent)2 ArrayList (java.util.ArrayList)1 Collection (java.util.Collection)1 List (java.util.List)1 Map (java.util.Map)1 RuleModel (org.drools.workbench.models.datamodel.rule.RuleModel)1 MetadataCol52 (org.drools.workbench.models.guided.dtable.shared.model.MetadataCol52)1 GuidedDecisionTree (org.drools.workbench.models.guided.dtree.shared.model.GuidedDecisionTree)1 ScoreCardModel (org.drools.workbench.models.guided.scorecard.shared.ScoreCardModel)1 TemplateModel (org.drools.workbench.models.guided.template.shared.TemplateModel)1 Scenario (org.drools.workbench.models.testscenarios.shared.Scenario)1 GlobalsModel (org.drools.workbench.screens.globals.model.GlobalsModel)1 GuidedDecisionTableView (org.drools.workbench.screens.guided.dtable.client.widget.table.GuidedDecisionTableView)1