use of org.kie.workbench.common.widgets.client.handlers.NewResourcePresenter in project kie-wb-common by kiegroup.
the class NewFormDefinitionlHandler method create.
@Override
public void create(org.guvnor.common.services.project.model.Package pkg, String baseFileName, final NewResourcePresenter presenter) {
BusyPopup.showMessage(translationService.getTranslation(FormEditorConstants.NewFormDefinitionlHandlerSelectFormUse));
modelerService.call(path -> {
BusyPopup.close();
presenter.complete();
notifySuccess();
PlaceRequest place = new PathPlaceRequest((Path) path, "FormEditor");
placeManager.goTo(place);
}, (message, throwable) -> {
BusyPopup.close();
ErrorPopup.showMessage(CommonConstants.INSTANCE.SorryAnItemOfThatNameAlreadyExistsInTheRepositoryPleaseChooseAnother());
return false;
}).createForm(pkg.getPackageMainResourcesPath(), buildFileName(baseFileName, resourceType), formModelsPresenter.getFormModel());
}
Aggregations