Package com.vaadin.data.validator

Examples of com.vaadin.data.validator.EmailValidator


        field.setValue("ab");
        field.setValue("abcd");
    }

    public void testEmailValidator() {
        field.addValidator(new EmailValidator("Invalid e-mail address"));

        // not required

        field.setRequired(false);
        // succeeds
View Full Code Here


                    }
                });
        addComponent(commitButton);
        addComponent(discardButton);
        addComponent(showBean);
        email.addValidator(new EmailValidator("Must be a valid address"));
        lastName.addValidator(new StringLengthValidator("Must be min 5 chars",
                5, null, true));

        age.addValidator(new IntegerRangeValidator(
                "Must be between 0 and 150, {0} is not", 0, 150));
View Full Code Here

        // Create the user input field
        user = new TextField("User:");
        user.setWidth("300px");
        user.setRequired(true);
        user.setInputPrompt("Your username (eg. joe@email.com)");
        user.addValidator(new EmailValidator(
                "Username must be an email address"));
        user.setInvalidAllowed(false);

        // Create the password input field
        password = new PasswordField("Password:");
View Full Code Here

        tf.setValue("-123.45e6");
        form.addField("d", tf);

        tf = new TextField(
                "A field, must contain an e-mail address or be empty");
        tf.addValidator(new EmailValidator("Invalid e-mail address {0}"));
        tf.setValue("a.b@example.com");
        form.addField("e", tf);

        // regular expressions
View Full Code Here

    }

    if ("email".equals(propertyId)) {
      //validate mail addresses
      TextField txt = (TextField)f;
      txt.addValidator(new EmailValidator("exemple@mail.com"));
      txt.setValidationVisible(true);
    }

    return f;
  }
View Full Code Here

    return 0;
  }

  public static boolean isValidEmailAddress(String email) {
    try {
      EmailValidator s = new EmailValidator("false");
      return s.isValid(email);
    } catch (Exception ex) {
      return false;
    }
  }
View Full Code Here

TOP

Related Classes of com.vaadin.data.validator.EmailValidator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.