Examples of IValidator


Examples of org.eclipse.core.databinding.validation.IValidator

   
    maxInstancesTextObservable = WidgetProperties.text(SWT.Modify).observe(this.maxInstances);
    maxInstancesModelObservable = BeanProperties.value("maxInstances").observe(this.formModel);
   
    // Add a validator for number only
    IValidator optionalNumbersOnlyValidator = new IValidator() {
      @Override
      public IStatus validate(Object value) {
        String s = String.valueOf(value);
       
        if (s.trim().length()<1) return ValidationStatus.ok();
        if (s.matches("\\d*")) return ValidationStatus.ok();

        return ValidationStatus.error("Please enter a valid number of instances...");
      }
    };

    // now the validator for consistancy
    IValidator instancesValidator = new IValidator() {
      @Override
      public IStatus validate(Object value) {
        String smin = (String)minInstancesTextObservable.getValue();
        String smax = (String)maxInstancesTextObservable.getValue();
        Integer min = smin.trim().length()>0 ? Integer.parseInt(smin) : null;
View Full Code Here

Examples of org.eclipse.core.databinding.validation.IValidator

              value = field.getElementName();
           
            return value;
          }

        }).setBeforeSetValidator(new IValidator() {

          public IStatus validate(Object value) {
            //dont set value if it is null. Thus no parent node gets created.
            //The parent node has just been deleted in converter
            return value == null ? Status.CANCEL_STATUS : Status.OK_STATUS;
View Full Code Here

Examples of org.eclipse.core.databinding.validation.IValidator

            }
           
            return value;
          }

        }).setBeforeSetValidator(new IValidator() {

          public IStatus validate(Object value) {
            //dont set value if it is null. Thus no parent node gets created.
            //The parent node has just been deleted in converter
            return value == null ? Status.CANCEL_STATUS : Status.OK_STATUS;
View Full Code Here

Examples of org.eclipse.core.databinding.validation.IValidator

            }
           
            return fromObject;
          }

        }).setBeforeSetValidator(new IValidator() {

          public IStatus validate(Object value) {
            //dont set value if it is null. Thus no parent node gets created.
            //The parent node has been deleted in converter
            return value == null ? Status.CANCEL_STATUS : Status.OK_STATUS;
View Full Code Here

Examples of org.eclipse.core.databinding.validation.IValidator

            }
           
            return fromObject;
          }

        }).setBeforeSetValidator(new IValidator() {

          public IStatus validate(Object value) {
            //dont set value if it is null. Thus no parent node gets created.
            //The parent node has been deleted in converter
            return value == null ? Status.CANCEL_STATUS : Status.OK_STATUS;
View Full Code Here

Examples of org.eclipse.core.databinding.validation.IValidator

                            @Override
                            public String getText(Object element)
                            {
                                return ((Account) element).getName();
                            }
                        }, new IValidator()
                        {
                            @Override
                            public IStatus validate(Object value)
                            {
                                return value != null ? ValidationStatus.ok() : ValidationStatus
View Full Code Here

Examples of org.eclipse.core.databinding.validation.IValidator

    {
        context.bindValue(SWTObservables.observeText(txtValue, SWT.Modify), //
                        BeansObservables.observeValue(model, property), //
                        new UpdateValueStrategy() //
                                        .setConverter(new StringToCurrencyConverter(type)) //
                                        .setAfterConvertValidator(new IValidator()
                                        {
                                            @Override
                                            public IStatus validate(Object value)
                                            {
                                                Long v = (Long) value;
View Full Code Here

Examples of org.eclipse.core.databinding.validation.IValidator

    {
        Text txtValue = createTextInput(editArea, label);

        context.bindValue(SWTObservables.observeText(txtValue, SWT.Modify), //
                        BeansObservables.observeValue(model, property), //
                        new UpdateValueStrategy().setAfterConvertValidator(new IValidator()
                        {
                            @Override
                            public IStatus validate(Object value)
                            {
                                Long v = (Long) value;
View Full Code Here

Examples of org.eclipse.core.databinding.validation.IValidator

    {
        Text txtValue = createTextInput(editArea, label);

        context.bindValue(SWTObservables.observeText(txtValue, SWT.Modify), //
                        BeansObservables.observeValue(model, property), //
                        new UpdateValueStrategy().setAfterConvertValidator(new IValidator()
                        {
                            @Override
                            public IStatus validate(Object value)
                            {
                                String v = (String) value;
View Full Code Here

Examples of org.eclipse.core.databinding.validation.IValidator

        Text txtValue = createTextInput(editArea, label, SWT.NONE, 12);
        txtValue.setTextLimit(12);

        context.bindValue(SWTObservables.observeText(txtValue, SWT.Modify), //
                        BeansObservables.observeValue(model, property), //
                        new UpdateValueStrategy().setAfterConvertValidator(new IValidator()
                        {
                            @Override
                            public IStatus validate(Object value)
                            {
                                String v = (String) value;
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.