本文整理汇总了Java中org.jdesktop.beansbinding.Validator类的典型用法代码示例。如果您正苦于以下问题:Java Validator类的具体用法?Java Validator怎么用?Java Validator使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Validator类属于org.jdesktop.beansbinding包,在下文中一共展示了Validator类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: validate
import org.jdesktop.beansbinding.Validator; //导入依赖的package包/类
public Validator.Result validate(Object arg) {
if (((String) arg).length() < MIN_LENGTH) {
return new Validator.Result(null, "Password is too short. Min length is " + String.valueOf(MIN_LENGTH)); // NOI18N
} else {
return null;
}
}
示例2: validate
import org.jdesktop.beansbinding.Validator; //导入依赖的package包/类
public Validator.Result validate(Integer arg) {
if ((arg < 1) || (arg > 199)) {
return new Result(null, "Age range is 1-199");
}
return null;
}
示例3: validate
import org.jdesktop.beansbinding.Validator; //导入依赖的package包/类
@Override
public Validator.Result validate(Object arg0) {
if (arg0.equals(true)) {
formValidation.setComboBoxState(false);
formValidation.setTextFieldState(true);
}
return null;
}
示例4: validate
import org.jdesktop.beansbinding.Validator; //导入依赖的package包/类
@Override
public Validator.Result validate(Object arg0) {
if (arg0.equals(true)) {
formValidation.setComboBoxState(true);
formValidation.setTextFieldState(false);
formValidation.setButtonState(true);
}
return null;
}
示例5: validate
import org.jdesktop.beansbinding.Validator; //导入依赖的package包/类
public Validator<String>.Result validate(String arg0) {
if (ValidationUtils.isEmpty(arg0)) {
if (formValidation != null) {
formValidation.setButtonState(false);
}
return new Result(null, NbBundle.getMessage(Costanti.class, Costanti.CAMPO_NULLO));
}
if (formValidation != null) {
formValidation.setButtonState(true);
}
return null;
}
示例6: validate
import org.jdesktop.beansbinding.Validator; //导入依赖的package包/类
@Override
public Validator<Double>.Result validate(Double numero) {
if (numero < 0 || numero > 1.0) {
formValidation.setButtonState(false);
return new Result(null, NbBundle.getMessage(Costanti.class, Costanti.ERROR_LABEL_CONFIDENCE));
}
formValidation.setButtonState(true);
return null;
}
示例7: validate
import org.jdesktop.beansbinding.Validator; //导入依赖的package包/类
public Validator.Result validate(String arg) {
if ((arg == null) || (arg.length() == 0)) {
return new Validator.Result(null, "Empty value");
}
return null;
}
示例8: validate
import org.jdesktop.beansbinding.Validator; //导入依赖的package包/类
public Validator.Result validate(String arg) {
if ((arg.length() < 4) || !arg.contains("@") || !arg.contains(".")) {
return new Result(null, "Please enter a valid email");
}
return null;
}
示例9: getValidatorClass
import org.jdesktop.beansbinding.Validator; //导入依赖的package包/类
@Override
public Class getValidatorClass() {
return Validator.class;
}
示例10: validate
import org.jdesktop.beansbinding.Validator; //导入依赖的package包/类
@Override
public Validator.Result validate(Object arg0) {
throw new UnsupportedOperationException("Not supported yet.");
}