use of org.ovirt.engine.ui.uicommonweb.validation.NonNegativeLongNumberValidation in project ovirt-engine by oVirt.
the class EditDiskModel method validate.
@Override
public boolean validate() {
StorageType storageType = getStorageDomain().getSelectedItem() == null ? StorageType.UNKNOWN : getStorageDomain().getSelectedItem().getStorageType();
IntegerValidation sizeValidation = new IntegerValidation();
if (storageType.isBlockDomain()) {
Integer maxBlockDiskSize = (Integer) AsyncDataProvider.getInstance().getConfigValuePreConverted(ConfigValues.MaxBlockDiskSize);
sizeValidation.setMaximum(maxBlockDiskSize - getSize().getEntity());
}
getSizeExtend().validateEntity(new IValidation[] { new NotEmptyValidation(), new NonNegativeLongNumberValidation(), sizeValidation });
return super.validate() && getSizeExtend().getIsValid();
}
Aggregations