use of org.ovirt.engine.ui.uicommonweb.validation.SelectedQuotaValidation in project ovirt-engine by oVirt.
the class MoveOrCopyDiskModel method validate.
public boolean validate() {
boolean quotaValidated = true;
if (getQuotaEnforcementType() == QuotaEnforcementTypeEnum.DISABLED || getQuotaEnforcementType() == QuotaEnforcementTypeEnum.SOFT_ENFORCEMENT) {
quotaValidated = false;
}
boolean isValid = true;
for (DiskModel diskModel : getDisks()) {
if (quotaValidated) {
diskModel.getQuota().validateSelectedItem(new IValidation[] { new SelectedQuotaValidation() });
isValid &= diskModel.getQuota().getIsValid();
}
diskModel.getAlias().validateEntity(new IValidation[] { new NotEmptyValidation(), new I18NNameValidation() });
isValid &= diskModel.getAlias().getIsValid();
}
return isValid;
}
Aggregations