use of org.uberfire.workbench.events.NotificationEvent in project kie-wb-common by kiegroup.
the class IntegrationHandlerImpl method migrateFinished.
private void migrateFinished(MigrateResult result, PlaceRequest place) {
if (result.hasError()) {
errorPopup.showMessage(getErrorMessage(result));
} else {
notification.fire(new NotificationEvent(translationService.getValue(IntegrationClientConstants.MigrateDiagramSuccessfullyMigratedMessage), NotificationEvent.NotificationType.SUCCESS));
placeManager.forceClosePlace(place);
placeManager.goTo(createTargetPlace(result.getPath()));
}
}
use of org.uberfire.workbench.events.NotificationEvent in project kie-wb-common by kiegroup.
the class AbstractProjectDiagramEditor method initializeStunnerEditor.
void initializeStunnerEditor() {
stunnerEditor.setOnResetContentHashProcessor(h -> this.originalHash = h);
stunnerEditor.setParsingExceptionProcessor(e -> {
ProjectMetadata pm = (ProjectMetadata) e.getMetadata();
updateTitle(pm.getTitle());
resetEditorPagesOnLoadError(pm.getOverview());
menuSessionItems.setEnabled(false);
notification.fire(new NotificationEvent(translationService.getValue(StunnerWidgetsConstants.DiagramParsingError, Objects.toString(e.getMessage(), "")), NotificationEvent.NotificationType.ERROR));
});
stunnerEditor.setExceptionProcessor(e -> {
// close editor in case of error when opening the editor
placeManager.forceClosePlace(new PathPlaceRequest(versionRecordManager.getCurrentPath(), getEditorIdentifier()));
});
}
use of org.uberfire.workbench.events.NotificationEvent in project kie-wb-common by kiegroup.
the class AssignmentListItemWidgetViewImpl method init.
@PostConstruct
public void init() {
name.setRegExp(ALLOWED_CHARS, StunnerFormsClientFieldsConstants.CONSTANTS.Removed_invalid_characters_from_name(), StunnerFormsClientFieldsConstants.CONSTANTS.Invalid_character_in_name());
name.addChangeHandler(event -> {
String value = name.getText();
String notifyMessage = null;
if (isMultipleInstanceVariable(value)) {
notifyMessage = StunnerFormsClientFieldsConstants.CONSTANTS.AssignmentNameAlreadyInUseAsMultipleInstanceInputOutputVariable(value);
} else if (!allowDuplicateNames && isDuplicateName(value)) {
notifyMessage = duplicateNameErrorMessage;
}
if (notifyMessage != null) {
notification.fire(new NotificationEvent(notifyMessage, NotificationEvent.NotificationType.ERROR));
name.setValue(EMPTY_VALUE);
ValueChangeEvent.fire(name, EMPTY_VALUE);
}
});
customDataType.setRegExp(StringUtils.ALPHA_NUM_UNDERSCORE_DOT_REGEXP, StunnerFormsClientFieldsConstants.CONSTANTS.Removed_invalid_characters_from_name(), StunnerFormsClientFieldsConstants.CONSTANTS.Invalid_character_in_name());
customDataType.addKeyDownHandler(event -> {
int iChar = event.getNativeKeyCode();
if (iChar == ' ') {
event.preventDefault();
}
});
dataTypeComboBox.init(this, false, dataType, customDataType, false, true, CUSTOM_PROMPT, ENTER_TYPE_PROMPT);
processVarComboBox.init(this, false, processVar, expression, true, true, EXPRESSION_PROMPT, ENTER_EXPRESSION_PROMPT);
}
use of org.uberfire.workbench.events.NotificationEvent in project kie-wb-common by kiegroup.
the class RolesListItemWidgetViewImpl method handleValueChanged.
private void handleValueChanged() {
final String currentRole = row.getModel().getKey();
final String currentCardinality = row.getModel().getValue();
if (StringUtils.isEmpty(currentRole)) {
notification.fire(new NotificationEvent(EMPTY_ERROR_MESSAGE, NotificationEvent.NotificationType.ERROR));
row.getModel().setKey(previousRole);
return;
}
if (!allowDuplicateNames && isDuplicateName(currentRole)) {
notification.fire(new NotificationEvent(DUPLICATE_NAME_ERROR_MESSAGE, NotificationEvent.NotificationType.ERROR));
row.getModel().setKey(previousRole);
return;
}
// skip in case not modified values
if ((Objects.equals(previousRole, currentRole) && Objects.equals(previousCardinality, currentCardinality))) {
return;
}
previousRole = currentRole;
previousCardinality = currentCardinality;
notifyModelChanged();
}
use of org.uberfire.workbench.events.NotificationEvent in project kie-wb-common by kiegroup.
the class DefaultImportsEditorWidget method loadServerDataTypes.
protected void loadServerDataTypes() {
final Diagram diagram = sessionManager.getCurrentSession().getCanvasHandler().getDiagram();
final Path path = diagram.getMetadata().getPath();
dataTypeNamesService.call(path).then(serverDataTypes -> {
addDataTypes(serverDataTypes, true);
return null;
}).catch_(exception -> {
notification.fire(new NotificationEvent(StunnerFormsClientFieldsConstants.CONSTANTS.Error_retrieving_datatypes(), NotificationEvent.NotificationType.ERROR));
return null;
});
}
Aggregations