use of org.uberfire.ext.editor.commons.client.validation.Validator 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.Validator in project kie-wb-common by kiegroup.
the class KieEditorTest method testGetRenameValidator.
@Test
public void testGetRenameValidator() {
final Validator renameValidator = presenter.getRenameValidator();
assertEquals(assetUpdateValidator, renameValidator);
}
Aggregations