Examples of IntegerValidator


Examples of com.vaadin.data.validator.IntegerValidator

                        RichTextArea textArea = (RichTextArea) field;
                        textArea.setNullRepresentation("");
                    }

                    if (cls.equals(Integer.class)) {
                        field.addValidator(new IntegerValidator(getLocalizedMessage("is.not.an.integer")));
                        field.setWidth("100px");
                    } else {
                        field.setWidth("100%");
                    }
                    if (reflectField.getAnnotation(RequiredAttribute.class) != null) {
View Full Code Here

Examples of eu.maydu.gwt.validation.client.validators.numeric.IntegerValidator

  private void setupValidation() {
    validator = new DefaultValidationProcessor(showcaseMessages);
    popupDesc = new PopupDescription(showcaseMessages, Location.TOP);
    FocusAction focusAction = new FocusAction();
   
    IntegerValidator val = new IntegerValidator(integerPositiveTextBox, 1, Integer.MAX_VALUE, "customNotInRange");
    //val.setRequired(false);
   
    validator.addValidators("positiveInteger",
        val
          .addActionForFailure(focusAction)
          .addActionForFailure(new StyleAction("validationFailedBorder"))
          //.addActionForFailure(new TextAction(errorLabel))
    );
   
   
    popupDesc.addDescription("positiveIntegerHelp", integerPositiveTextBox);
   
    validator.addValidators("integerInRangeMinus5000Plus5000",
      new IntegerValidator(integerMinus5000To5000TextBox, -5000, 5000)
        .addActionForFailure(focusAction)
        .addActionForFailure(new StyleAction("validationFailedBorder"))
    );
   
    popupDesc.addDescription("integerInRangeMinus5000Plus5000Help", integerMinus5000To5000TextBox);
   
    validator.addValidators("anyInteger",
        new IntegerValidator(integerTextBox3)
          .addActionForFailure(focusAction)
          .addActionForFailure(new StyleAction("validationFailedBorder"))
      );
   
    popupDesc.addDescription("anyIntegerHelp", integerTextBox3);
   
   
    validator.addValidators("stringLengthSmaller5",
      new StringLengthValidator(stringLengthSmaller5TextBox, 0, 4)
        .addActionForFailure(focusAction)
        .addActionForFailure(new StyleAction("validationFailedBorder"))
    );
   
    popupDesc.addDescription("stringLengthSmaller5Help", stringLengthSmaller5TextBox);
   
   
   
    validator.addValidators("stringLengthBetween2And5",
        new StringLengthValidator(stringLengthBetween2And5TextBox, 2, 5)
          .addActionForFailure(focusAction)
          .addActionForFailure(new StyleAction("validationFailedBorder"))
    );
   
    popupDesc.addDescription("stringLengthBetween2And5Help", stringLengthBetween2And5TextBox);
   
    validator.addValidators("notEmpty",
        new NotEmptyValidator(notEmptyTextBox)
          .addActionForFailure(focusAction)
          .addActionForFailure(new StyleAction("validationFailedBorder"))
    );
   
    validator.addValidators("localizedDate",
        new LocalizedDateValidator(localizedDateTextBox, DateTimeFormat.getShortDateFormat(), false)
          .addActionForFailure(focusAction)
          .addActionForFailure(new StyleAction("validationFailedBorder"))
      );
   
    popupDesc.addDescription("localizedDate.description", localizedDateTextBox);
   
    validator.addValidators("name",
        new NameValidator(nameValidatorTextBox)
          .addActionForFailure(focusAction)
          .addActionForFailure(new StyleAction("validationFailedBorder"))
    );
   
    popupDesc.addDescription("name.description", nameValidatorTextBox);
   
    popupDesc.addDescription("notEmptyHelp", notEmptyTextBox);

    RegularExpressionValidator regex = new RegularExpressionValidator(regexValidateEntryTextBox, new ValidatorConfigurationSource<String>() {

      public String getConfigurationValue() {
        String regex = regexEntryTextBox.getText();
        if(regex.trim().equals("")) {
          regexEntryTextBox.setText("(a|b)*");
          return "(a|b)*";
        }
       
        return regex;
      }
     
    }, "regexNotMatched");
   
    validator.addValidators("enterRegExedText", regex
      .addActionForFailure(new StyleAction("validationFailedBorder"))
      .addActionForFailure(focusAction)
    );
   
    popupDesc.addDescription("regexText.description", regexValidateEntryTextBox);
   
    validator.addValidators("localizedDate",
        new LocalizedDateValidator(localizedDateTextBox, DateTimeFormat.getShortDateFormat(), false)
          .addActionForFailure(focusAction)
          .addActionForFailure(new StyleAction("validationFailedBorder"))
      );
   
    popupDesc.addDescription("localizedDate.description", localizedDateTextBox);
   
   
    validator.addValidators("suggest1", new IntegerValidator(suggestBox1)
      .addActionForFailure(new StyleAction("validationFailedBorder"))
      //.addActionForFailure(focusAction)
    );
    popupDesc.addDescription("localizedDate.description", suggestBox1);
   
View Full Code Here

Examples of eu.maydu.gwt.validation.client.validators.numeric.IntegerValidator

        GWT.log("Primary style: "+text1.getStylePrimaryName(), null);
      }
     
    });
   
    validator.addValidators("int", new IntegerValidator(text1, 0, 50000).addActionForFailure(new StyleAction("validationFailedBorder")));
   
    return panel;
  }
View Full Code Here

Examples of eu.maydu.gwt.validation.client.validators.numeric.IntegerValidator

  private void setup(int min, int max) {
    if(this.text != null) {
      addValidators(
          new TrimTransformer(this.text),
          this.noMinMax?
              new IntegerValidator(this.text):
              new IntegerValidator(this.text, min, max)
          );
    }else {
      addValidators(
          new TrimTransformer(this.suggest),
          this.noMinMax?
              new IntegerValidator(this.suggest):
              new IntegerValidator(this.suggest, min, max)
          );
    }
  }
View Full Code Here

Examples of eu.maydu.gwt.validation.client.validators.numeric.IntegerValidator

  private void setupValidation() {
    validator = new DefaultValidationProcessor(showcaseMessages);
    popupDesc = new PopupDescription(showcaseMessages);
    FocusAction focusAction = new FocusAction();
   
    IntegerValidator val = new IntegerValidator(integerPositiveTextBox, 1, Integer.MAX_VALUE, "customNotInRange");
    //val.setRequired(false);
   
    validator.addValidators("positiveInteger",
        val
          .addActionForFailure(focusAction)
          .addActionForFailure(new StyleAction("validationFailedBorder"))
          //.addActionForFailure(new TextAction(errorLabel))
    );
   
   
    popupDesc.addDescription("positiveIntegerHelp", integerPositiveTextBox);
   
    validator.addValidators("integerInRangeMinus5000Plus5000",
      new IntegerValidator(integerMinus5000To5000TextBox, -5000, 5000)
        .addActionForFailure(focusAction)
        .addActionForFailure(new StyleAction("validationFailedBorder"))
    );
   
    popupDesc.addDescription("integerInRangeMinus5000Plus5000Help", integerMinus5000To5000TextBox);
   
    validator.addValidators("anyInteger",
        new IntegerValidator(integerTextBox3)
          .addActionForFailure(focusAction)
          .addActionForFailure(new StyleAction("validationFailedBorder"))
      );
   
    popupDesc.addDescription("anyIntegerHelp", integerTextBox3);
View Full Code Here

Examples of org.apache.shale.validator.validator.IntegerValidator

     * registered on our corresponding <code>UIComponent</code>.</p>
     */
    protected Validator createValidator() {

        FacesContext context = FacesContext.getCurrentInstance();
        IntegerValidator validator = new IntegerValidator();

        if (client != null) {
            Boolean value = null;
            if (UIComponentTag.isValueReference(client)) {
                ValueBinding vb = context.getApplication().createValueBinding(client);
                value = (Boolean) vb.getValue(context);
            } else {
                value = (Boolean) HELPER.asObject(context, Boolean.class, client);
            }
            validator.setClient(value.booleanValue());
        }

        if (maximum != null) {
            Integer value = null;
            if (UIComponentTag.isValueReference(maximum)) {
                ValueBinding vb = context.getApplication().createValueBinding(maximum);
                value = (Integer) vb.getValue(context);
            } else {
                value = (Integer) HELPER.asObject(context, Integer.class, maximum);
            }
            validator.setMaximum(value.intValue());
        }

        if (message != null) {
            String value = null;
            if (UIComponentTag.isValueReference(message)) {
                ValueBinding vb = context.getApplication().createValueBinding(message);
                value = (String) vb.getValue(context);
            } else {
                value = message;
            }
            validator.setMessage(value);
        }

        if (minimum != null) {
            Integer value = null;
            if (UIComponentTag.isValueReference(minimum)) {
                ValueBinding vb = context.getApplication().createValueBinding(minimum);
                value = (Integer) vb.getValue(context);
            } else {
                value = (Integer) HELPER.asObject(context, Integer.class, minimum);
            }
            validator.setMinimum(value.intValue());
        }

        return validator;

    }
View Full Code Here

Examples of org.apache.xerces.validators.datatype.IntegerValidator

        };

        void initializeRegistry() {
            Hashtable facets = null;
            fRegistry.put("boolean", new BooleanValidator());
            DatatypeValidator integerValidator = new IntegerValidator();
            fRegistry.put("integer", integerValidator);
            fRegistry.put("string", new StringValidator());
            fRegistry.put("real", new RealValidator());
            fRegistry.put("decimal", new DecimalValidator());
            //REVISIT - enable the below
            //fRegistry.put("binary", new BinaryValidator());
            //fRegistry.put("date", new DateValidator());
            //fRegistry.put("timePeriod", new TimePeriodValidator());
            //fRegistry.put("time", new TimeValidator());
            //fRegistry.put("uri", new URIValidator());

            DatatypeValidator v = null;
            for (int i = 0; i < integerSubtypeTable.length; i++) {
                v = new IntegerValidator();
                facets = new Hashtable();
                facets.put(integerSubtypeTable[i][1],integerSubtypeTable[i][2]);
                v.setBasetype(integerValidator);
                try {
                    v.setFacets(facets);
View Full Code Here

Examples of org.apache.xerces.validators.datatype.IntegerValidator

        };

        void initializeRegistry() {
            Hashtable facets = null;
            fRegistry.put("boolean", new BooleanValidator());
            DatatypeValidator integerValidator = new IntegerValidator();
            fRegistry.put("integer", integerValidator);
            fRegistry.put("string", new StringValidator());
            fRegistry.put("decimal", new DecimalValidator());
            fRegistry.put("float", new FloatValidator());
            fRegistry.put("double", new DoubleValidator());
            //REVISIT - enable the below
            //fRegistry.put("binary", new BinaryValidator());
            //fRegistry.put("date", new DateValidator());
            //fRegistry.put("timePeriod", new TimePeriodValidator());
            //fRegistry.put("time", new TimeValidator());
            //fRegistry.put("uri", new URIValidator());

            DatatypeValidator v = null;
            for (int i = 0; i < integerSubtypeTable.length; i++) {
                v = new IntegerValidator();
                facets = new Hashtable();
                facets.put(integerSubtypeTable[i][1],integerSubtypeTable[i][2]);
                v.setBasetype(integerValidator);
                try {
                    v.setFacets(facets);
View Full Code Here

Examples of org.apache.xerces.validators.datatype.IntegerValidator

        };

        void initializeRegistry() {
            Hashtable facets = null;
            fRegistry.put("boolean", new BooleanValidator());
            DatatypeValidator integerValidator = new IntegerValidator();
            fRegistry.put("integer", integerValidator);
            fRegistry.put("string", new StringValidator());
            fRegistry.put("decimal", new DecimalValidator());
            fRegistry.put("float", new FloatValidator());
            fRegistry.put("double", new DoubleValidator());
            fRegistry.put("timeDuration", new TimeDurationValidator());
            fRegistry.put("timeInstant", new TimeInstantValidator());
            fRegistry.put("binary", new BinaryValidator());
            fRegistry.put("uri", new URIValidator());
            //REVISIT - enable the below
            //fRegistry.put("date", new DateValidator());
            //fRegistry.put("timePeriod", new TimePeriodValidator());
            //fRegistry.put("time", new TimeValidator());


            DatatypeValidator v = null;
            for (int i = 0; i < integerSubtypeTable.length; i++) {
                v = new IntegerValidator();
                facets = new Hashtable();
                facets.put(integerSubtypeTable[i][1],integerSubtypeTable[i][2]);
                v.setBasetype(integerValidator);
                try {
                    v.setFacets(facets);
View Full Code Here

Examples of org.beryl.gui.validators.IntegerValidator

    okButton = (Button) dialog.getWidget("OKButton");

    customComponents = new HashMap();
    activeComponents = new ArrayList();

    loadCustomComponent("hig", "HIG_Row", new IntegerValidator());
    loadCustomComponent("hig", "HIG_Column", new IntegerValidator());
    loadCustomComponent("hig", "HIG_Width", new IntegerValidator());
    loadCustomComponent("hig", "HIG_Height", new IntegerValidator());
    loadCustomComponent("hig", "HIG_Alignment", null);

    loadCustomComponent("border", "Border_Alignment", null);

    loadCustomComponent("box", "Box_AlignX", new FloatValidator());
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.