use of org.uberfire.ext.editor.commons.client.validation.ValidatorCallback in project kie-wb-common by kiegroup.
the class ContainerConfigPresenter method onContainerNameChange.
protected void onContainerNameChange() {
view.clearContainerNameHelpText();
view.clearFormError();
validationService.isValidContainerName(getContainerName(), new ValidatorCallback() {
@Override
public void onSuccess() {
view.setContainerNameStatus(FormStatus.VALID);
containerNameValid = true;
if (isAlreadyInUse(getContainerName())) {
containerNameValid = false;
view.setContainerNameHelpText(translationService.getTranslation(ContainerConfigPresenter_ContainerNameAlreadyInUseErrorMessage));
view.setContainerNameStatus(FormStatus.ERROR);
}
}
@Override
public void onFailure() {
view.setContainerNameStatus(FormStatus.ERROR);
containerNameValid = false;
view.setContainerNameHelpText(translationService.getTranslation(ContainerConfigPresenter_InvalidContainerNameErrorMessage));
}
});
}
use of org.uberfire.ext.editor.commons.client.validation.ValidatorCallback in project kie-wb-common by kiegroup.
the class BaseViewPresenter method renameItem.
public void renameItem(final FolderItem folderItem) {
final Path path = getFolderItemPath(folderItem);
renamePopUpPresenter.show(path, new Validator() {
@Override
public void validate(final String value, final ValidatorCallback callback) {
validationService.call(new RemoteCallback<Object>() {
@Override
public void callback(Object response) {
if (Boolean.TRUE.equals(response)) {
callback.onSuccess();
} else {
callback.onFailure();
}
}
}).isFileNameValid(path, value);
}
}, new CommandWithFileNameAndCommitMessage() {
@Override
public void execute(final FileNameAndCommitMessage details) {
baseView.showBusyIndicator(CommonConstants.INSTANCE.Renaming());
explorerService.call(getRenameSuccessCallback(getRenameView()), getRenameErrorCallback(getRenameView())).renameItem(folderItem, details.getNewFileName(), details.getCommitMessage());
}
});
}
use of org.uberfire.ext.editor.commons.client.validation.ValidatorCallback in project kie-wb-common by kiegroup.
the class DataSourceDefEditorHelper method onPasswordChange.
public void onPasswordChange() {
final String newValue = mainPanel.getPassword().trim();
validationService.isNotEmpty(newValue, new ValidatorCallback() {
@Override
public void onSuccess() {
onPasswordChange(newValue, true);
}
@Override
public void onFailure() {
onPasswordChange(newValue, false);
}
});
}
use of org.uberfire.ext.editor.commons.client.validation.ValidatorCallback in project kie-wb-common by kiegroup.
the class DataSourceDefEditorHelper method onUserChange.
public void onUserChange() {
final String newValue = mainPanel.getUser().trim();
validationService.isNotEmpty(newValue, new ValidatorCallback() {
@Override
public void onSuccess() {
onUserChange(newValue, true);
}
@Override
public void onFailure() {
onUserChange(newValue, false);
}
});
}
use of org.uberfire.ext.editor.commons.client.validation.ValidatorCallback in project kie-wb-common by kiegroup.
the class DataSourceDefEditorHelper method onNameChange.
public void onNameChange() {
final String newValue = mainPanel.getName().trim();
validationService.isValidDataSourceName(newValue, new ValidatorCallback() {
@Override
public void onSuccess() {
onNameChange(newValue, true);
}
@Override
public void onFailure() {
onNameChange(newValue, false);
}
});
}
Aggregations