Examples of DoubleValidator


Examples of com.vaadin.data.validator.DoubleValidator

        tf.setValue("-321");
        form.addField("c", tf);

        tf = new TextField(
                "A field, must contain a floating point number or be empty");
        tf.addValidator(new DoubleValidator("Invalid double {0}"));
        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

        tf = new TextField("A field, must match the regular expression a.*b.*c");
        tf.addValidator(new RegexpValidator("a.*b.*c",
                "{0} does not match the regular expression"));
        tf.setValue("aagsabeqgc");
        form.addField("f", tf);

        tf = new TextField(
                "A field, must contain the regular expression a.*b.*c");
        tf.addValidator(new RegexpValidator("a.*b.*c", false,
                "{0} does not contain the regular expression"));
        tf.setValue("aagsabeqgc");
        form.addField("g", tf);

        tf = new TextField(
                "A field, must match the regular expression ^a.*b.*c$");
        tf.addValidator(new RegexpValidator("^a.*b.*c$", false,
                "{0} does not match the regular expression with ^ and $"));
        tf.setValue("aagsabeqgc");
        form.addField("h", tf);

        tf = new TextField(
                "A field, must contain the regular expression ^a.*b.*c$");
        tf.addValidator(new RegexpValidator("^a.*b.*c$", false,
                "{0} does not contain the regular expression with ^ and $"));
        tf.setValue("aagsabeqgc");
        form.addField("i", tf);

        // TODO CompositeValidator
        tf = new TextField(
                "A field, must be a floating point number with 4-5 chars");
        CompositeValidator cv = new CompositeValidator(CombinationMode.AND,
                "The field must contain a floating point number with 4-5 characters");
        cv.addValidator(new StringLengthValidator(
                "String length of '{0}' should be 4-5 characters", 4, 5, false));
        cv.addValidator(new DoubleValidator(
                "{0} must be a floating point number"));
        tf.addValidator(cv);
        tf.setValue("12.34");
        form.addField("j", tf);

        tf = new TextField(
                "A field, must be a floating point number or 4-5 chars");
        cv = new CompositeValidator(CombinationMode.OR,
                "The field must contain a floating point  or with 4-5 characters");
        cv.addValidator(new StringLengthValidator(
                "String length of '{0}' should be 4-5 characters", 4, 5, false));
        cv.addValidator(new DoubleValidator(
                "{0} must be a floating point number"));
        tf.addValidator(cv);
        tf.setValue("12.34g");
        form.addField("jb", tf);

View Full Code Here

Examples of com.vaadin.data.validator.DoubleValidator

        addComponent(tf);

        tf = createIntegerTextField();
        tf.setCaption("Enter a double");
        tf.setPropertyDataSource(new ObjectProperty<Double>(2.1));
        tf.addValidator(new DoubleValidator("Must be a Double"));
        addComponent(tf);
    }
View Full Code Here

Examples of com.vaadin.data.validator.DoubleValidator

    dateField.setResolution(DateField.RESOLUTION_MONTH);
    form.addField("month", dateField);
    final TextField textField = new TextField("Wartość");
    textField.setRequired(true);
    textField.setValue("100.99");
    textField.addValidator(new DoubleValidator("Tylko wartości liczbowe"));
    form.addField("value", textField);
    window.addComponent(form);
    Button button = new Button("Zapisz", form, "commit");
    button.setIcon(new ThemeResource("../runo/icons/16/ok.png"));
    button.addListener(new ClickListener() {
View Full Code Here

Examples of com.vaadin.data.validator.DoubleValidator

                if (valueType != null) {
                    if ("int".equalsIgnoreCase(valueType)) {
                        textField.addValidator(new IntegerValidator(source.getMessage("validate.integer")));
                    }
                    else if ("dbl".equalsIgnoreCase(valueType)) {
                        textField.addValidator(new DoubleValidator(source.getMessage("validate.double")));
                    }
                }
                textField.setWidth("100%");
                field = textField;
            }
View Full Code Here

Examples of org.activiti.explorer.ui.validator.DoubleValidator

    if (formProperty.getValue() != null) {
      textField.setValue(formProperty.getValue());
    }

    // Add validation of numeric value
    textField.addValidator(new DoubleValidator("Value must be a double"));
    textField.setImmediate(true);

    return textField;
  }
View Full Code Here

Examples of org.apache.pivot.wtk.text.validation.DoubleValidator

        final String key, Form.Section section) {
        double value = (Double)dictionary.get(key);

        TextInput textInput = new TextInput();
        textInput.setTextSize(14);
        textInput.setValidator(new DoubleValidator());
        textInput.setText(String.valueOf(value));
        section.add(textInput);
        Form.setLabel(textInput, key);

        textInput.getComponentStateListeners().add(new ComponentStateListener.Adapter() {
View Full Code Here

Examples of org.apache.pivot.wtk.validation.DoubleValidator

        final String key, Form.Section section) {
        double value = (Double)dictionary.get(key);

        TextInput textInput = new TextInput();
        textInput.setTextSize(14);
        textInput.setValidator(new DoubleValidator());
        textInput.setText(String.valueOf(value));
        section.add(textInput);
        Form.setLabel(textInput, key);

        textInput.getComponentStateListeners().add(new ComponentStateListener.Adapter() {
View Full Code Here

Examples of org.apache.pivot.wtk.validation.DoubleValidator

            }
        });
        invalidComparableRangeLabel = (Label)bxmlSerializer.getNamespace().get("invalidComparableRangeLabel");

        textinputDouble.setText("\u221E")// infinite symbol
        textinputDouble.setValidator(new DoubleValidator());

        // textinputFloat.setText("123456.789");
        // new, show different ways to format decimal values in i18n format
        Double value = new Double(testValue);
        // textinputFloat.setText(value.toString());
View Full Code Here

Examples of org.apache.pivot.wtk.validation.DoubleValidator

        final String key, Form.Section section) {
        double value = (Double)dictionary.get(key);

        TextInput textInput = new TextInput();
        textInput.setTextSize(14);
        textInput.setValidator(new DoubleValidator());
        textInput.setText(String.valueOf(value));
        section.add(textInput);
        Form.setLabel(textInput, key);

        textInput.getComponentStateListeners().add(new ComponentStateListener.Adapter() {
View Full Code Here

Examples of org.apache.pivot.wtk.validation.DoubleValidator

        final String key, Form.Section section) {
        double value = (Double)dictionary.get(key);

        TextInput textInput = new TextInput();
        textInput.setTextSize(14);
        textInput.setValidator(new DoubleValidator());
        textInput.setText(String.valueOf(value));
        section.add(textInput);
        Form.setLabel(textInput, key);

        textInput.getComponentStateListeners().add(new ComponentStateListener.Adapter() {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.