use of org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation in project ovirt-engine by oVirt.
the class NetworkAttachmentModel method validate.
public boolean validate() {
getIpv4Address().setIsValid(true);
getIpv4Subnet().setIsValid(true);
getIpv4Gateway().setIsValid(true);
if (getIsStaticIpv4Address()) {
getIpv4Address().validateEntity(new IValidation[] { new NotEmptyValidation(), new Ipv4AddressValidation() });
getIpv4Subnet().validateEntity(new IValidation[] { new NotEmptyValidation(), new SubnetMaskValidation(true) });
getIpv4Gateway().validateEntity(new IValidation[] { new Ipv4AddressValidation(true) });
}
getIpv6Address().setIsValid(true);
getIpv6Prefix().setIsValid(true);
getIpv6Gateway().setIsValid(true);
if (getIsStaticIpv6Address()) {
getIpv6Address().validateEntity(new IValidation[] { new NotEmptyValidation(), new Ipv6AddressValidation() });
getIpv6Prefix().validateEntity(new IValidation[] { new NotEmptyValidation(), new IntegerValidation(0, 128) });
getIpv6Gateway().validateEntity(new IValidation[] { new Ipv6AddressValidation(true) });
}
getQosModel().validate();
getDnsConfigurationModel().validate();
getCustomPropertiesModel().validate();
setValidTab(TabName.IPV4_TAB, getIpv4Address().getIsValid() && getIpv4Gateway().getIsValid() && getIpv4Subnet().getIsValid());
setValidTab(TabName.IPV6_TAB, getIpv6Address().getIsValid() && getIpv6Gateway().getIsValid() && getIpv6Prefix().getIsValid());
setValidTab(TabName.QOS_TAB, getQosModel().getIsValid());
setValidTab(TabName.CUSTOM_PROPERTIES_TAB, getCustomPropertiesModel().getIsValid());
setValidTab(TabName.DNS_CONFIGURATION_TAB, getDnsConfigurationModel().getIsValid());
return allTabsValid();
}
use of org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation in project ovirt-engine by oVirt.
the class SetupNetworksBondModel method validate.
public boolean validate() {
getBond().validateSelectedItem(new IValidation[] { new NotEmptyValidation(), new LengthValidation(BusinessEntitiesDefinitions.HOST_NIC_NAME_LENGTH), new BondNameValidation() });
getCustomBondEditor().setIsValid(true);
if (getBondingOptions().getSelectedItem().getKey().equals(CUSTOM_BONDING_MODE)) {
getCustomBondEditor().validateEntity(new IValidation[] { new KeyValueFormatValidation() });
}
return getBond().getIsValid() && getCustomBondEditor().getIsValid();
}
use of org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation in project ovirt-engine by oVirt.
the class RoleModel method validate.
public boolean validate() {
RegexValidation tempVar = new RegexValidation();
// $NON-NLS-1$
tempVar.setExpression("^\\w.{0,125}$");
tempVar.setMessage(ConstantsManager.getInstance().getConstants().nameMustBeUpToAndStartWithMsg());
RegexValidation tempVar2 = new RegexValidation();
// $NON-NLS-1$
tempVar2.setExpression("^[A-Za-z0-9_-]+$");
tempVar2.setMessage(ConstantsManager.getInstance().getConstants().asciiNameValidationMsg());
getName().validateEntity(new IValidation[] { new NotEmptyValidation(), tempVar, tempVar2 });
LengthValidation lengthValidation = new LengthValidation();
lengthValidation.setMaxLength(4000);
getDescription().validateEntity(new IValidation[] { lengthValidation });
return getName().getIsValid() && getDescription().getIsValid();
}
use of org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation in project ovirt-engine by oVirt.
the class NewClusterPolicyModel method validate.
private boolean validate() {
getName().validateEntity(new IValidation[] { new NotEmptyValidation(), new LengthValidation(50), new AsciiNameValidation() });
getDescription().validateEntity(new IValidation[] { new LengthValidation(400), new AsciiOrNoneValidation() });
return getName().getIsValid() && getDescription().getIsValid() && getCustomPropertySheet().validate();
}
use of org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation in project ovirt-engine by oVirt.
the class AffinityGroupModel method validate.
protected boolean validate() {
getName().validateEntity(new IValidation[] { new NotEmptyValidation(), new LengthValidation(255), new I18NNameValidation() });
getDescription().validateEntity(new IValidation[] { new AsciiOrNoneValidation() });
return getName().getIsValid() && getDescription().getIsValid();
}
Aggregations