Search in sources :

Example 16 with LengthValidation

use of org.ovirt.engine.ui.uicommonweb.validation.LengthValidation 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();
}
Also used : BondNameValidation(org.ovirt.engine.ui.uicommonweb.validation.BondNameValidation) NotEmptyValidation(org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation) LengthValidation(org.ovirt.engine.ui.uicommonweb.validation.LengthValidation) KeyValueFormatValidation(org.ovirt.engine.ui.uicommonweb.validation.KeyValueFormatValidation)

Example 17 with LengthValidation

use of org.ovirt.engine.ui.uicommonweb.validation.LengthValidation 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();
}
Also used : RegexValidation(org.ovirt.engine.ui.uicommonweb.validation.RegexValidation) NotEmptyValidation(org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation) LengthValidation(org.ovirt.engine.ui.uicommonweb.validation.LengthValidation)

Example 18 with LengthValidation

use of org.ovirt.engine.ui.uicommonweb.validation.LengthValidation 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();
}
Also used : AsciiOrNoneValidation(org.ovirt.engine.ui.uicommonweb.validation.AsciiOrNoneValidation) NotEmptyValidation(org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation) AsciiNameValidation(org.ovirt.engine.ui.uicommonweb.validation.AsciiNameValidation) LengthValidation(org.ovirt.engine.ui.uicommonweb.validation.LengthValidation)

Example 19 with LengthValidation

use of org.ovirt.engine.ui.uicommonweb.validation.LengthValidation 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();
}
Also used : AsciiOrNoneValidation(org.ovirt.engine.ui.uicommonweb.validation.AsciiOrNoneValidation) NotEmptyValidation(org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation) LengthValidation(org.ovirt.engine.ui.uicommonweb.validation.LengthValidation) I18NNameValidation(org.ovirt.engine.ui.uicommonweb.validation.I18NNameValidation)

Example 20 with LengthValidation

use of org.ovirt.engine.ui.uicommonweb.validation.LengthValidation in project ovirt-engine by oVirt.

the class XENPropertiesModel method validate.

public boolean validate() {
    if (!getIsAvailable()) {
        setIsValid(true);
    } else {
        getUrl().validateEntity(new IValidation[] { new NotEmptyValidation(), new LengthValidation(255) });
        setIsValid(getUrl().getIsValid());
    }
    return getIsValid();
}
Also used : NotEmptyValidation(org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation) LengthValidation(org.ovirt.engine.ui.uicommonweb.validation.LengthValidation)

Aggregations

LengthValidation (org.ovirt.engine.ui.uicommonweb.validation.LengthValidation)31 NotEmptyValidation (org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation)31 IntegerValidation (org.ovirt.engine.ui.uicommonweb.validation.IntegerValidation)9 SpecialAsciiI18NOrNoneValidation (org.ovirt.engine.ui.uicommonweb.validation.SpecialAsciiI18NOrNoneValidation)7 AsciiNameValidation (org.ovirt.engine.ui.uicommonweb.validation.AsciiNameValidation)6 HostAddressValidation (org.ovirt.engine.ui.uicommonweb.validation.HostAddressValidation)6 I18NNameValidation (org.ovirt.engine.ui.uicommonweb.validation.I18NNameValidation)4 AsciiOrNoneValidation (org.ovirt.engine.ui.uicommonweb.validation.AsciiOrNoneValidation)3 HostnameValidation (org.ovirt.engine.ui.uicommonweb.validation.HostnameValidation)2 I18NExtraNameOrNoneValidation (org.ovirt.engine.ui.uicommonweb.validation.I18NExtraNameOrNoneValidation)2 IValidation (org.ovirt.engine.ui.uicommonweb.validation.IValidation)2 MatchFieldsValidator (org.ovirt.engine.ui.uicommonweb.validation.MatchFieldsValidator)2 RegexValidation (org.ovirt.engine.ui.uicommonweb.validation.RegexValidation)2 Map (java.util.Map)1 SortedMap (java.util.SortedMap)1 TreeMap (java.util.TreeMap)1 StoragePool (org.ovirt.engine.core.common.businessentities.StoragePool)1 VmInitNetwork (org.ovirt.engine.core.common.businessentities.VmInitNetwork)1 EntityModel (org.ovirt.engine.ui.uicommonweb.models.EntityModel)1 NewVnicProfileModel (org.ovirt.engine.ui.uicommonweb.models.profiles.NewVnicProfileModel)1