use of org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation in project ovirt-engine by oVirt.
the class StorageModel method validateListItems.
private void validateListItems(ListModel<?> listModel) {
ValidationResult result = new NotEmptyValidation().validate(listModel.getSelectedItem());
listModel.setIsValid(result.getSuccess());
listModel.getInvalidityReasons().addAll(result.getReasons());
}
use of org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation 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();
}
use of org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation in project ovirt-engine by oVirt.
the class ExportOvaModel method validate.
public boolean validate() {
getPath().validateEntity(new IValidation[] { new NotEmptyValidation() });
getName().validateEntity(new IValidation[] { new NotEmptyValidation() });
return getPath().getIsValid() && getName().getIsValid();
}
use of org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation in project ovirt-engine by oVirt.
the class DataCenterModel method validate.
public boolean validate() {
getName().validateEntity(new IValidation[] { new NotEmptyValidation(), new LengthValidation(40), new LengthValidation(getMaxNameLength()), new AsciiNameValidation() });
getVersion().validateSelectedItem(new IValidation[] { new NotEmptyValidation() });
getDescription().validateEntity(new IValidation[] { new AsciiOrNoneValidation() });
getComment().validateEntity(new IValidation[] { new SpecialAsciiI18NOrNoneValidation() });
boolean validationResult = getName().getIsValid() && getDescription().getIsValid() && getComment().getIsValid() && getVersion().getIsValid();
return validationResult;
}
use of org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation in project ovirt-engine by oVirt.
the class IscsiBondModel method validate.
private boolean validate() {
getName().validateEntity(new IValidation[] { new NotEmptyValidation(), new I18NNameValidation(), new LengthValidation(50) });
getDescription().validateEntity(new IValidation[] { new SpecialAsciiI18NOrNoneValidation(), new LengthValidation(4000) });
if (getNetworks().getSelectedItems() == null || getNetworks().getSelectedItems().isEmpty()) {
getInvalidityReasons().add(constants.noNetworksSelected());
setIsValid(false);
} else {
setIsValid(true);
}
return getName().getIsValid() && getDescription().getIsValid() && getIsValid();
}
Aggregations