Examples of IValidator


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

    }
  }

  protected void bindElementType() {
    UpdateValueStrategy elementTypeUpdateStrategy = new UpdateValueStrategy(UpdateValueStrategy.POLICY_UPDATE);
    elementTypeUpdateStrategy.setBeforeSetValidator(new IValidator() {
      public IStatus validate(Object value) {
        String newName = (String) value;
        System.out.println(".validate: " + newName);
        IStatus status = Status.OK_STATUS;
        try {
View Full Code Here

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

    });
  }

  protected void bindElementName(final WodParserCache refactoringParserCache) {
    UpdateValueStrategy elementNameUpdateStrategy = new UpdateValueStrategy(UpdateValueStrategy.POLICY_UPDATE);
    elementNameUpdateStrategy.setBeforeSetValidator(new IValidator() {
      public IStatus validate(Object value) {
        String newName = (String) value;
        IStatus status = Status.OK_STATUS;
        try {
          if (newName == null || newName.length() == 0) {
View Full Code Here

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

   * @param toType
   * @return an IValidator, or <code>null</code> if unsuccessful
   */
  protected IValidator createValidator(Object fromType, Object toType) {
    if (fromType == null || toType == null) {
      return new IValidator() {

        public IStatus validate(Object value) {
          return Status.OK_STATUS;
        }
      };
View Full Code Here

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

      }
    }
  }

  private IValidator findValidator(Object fromType, Object toType) {
    IValidator result = null;

    // We only default the validator if we defaulted the converter since the
    // two are tightly coupled.
    if (defaultedConverter) {
      if (String.class.equals(fromType)) {
View Full Code Here

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

     * @param toClass
     *            The Class to convert to
     * @return An appropriate IValidator
     */
    private IValidator get(Object fromClass, Object toClass) {
      IValidator result = (IValidator) validators.get(new Pair(fromClass,
          toClass));
      if (result != null)
        return result;
      if (fromClass != null && toClass != null && fromClass == toClass) {
        return new IValidator() {
          public IStatus validate(Object value) {
            return Status.OK_STATUS;
          }
        };
      }
      return new IValidator() {
        public IStatus validate(Object value) {
          return Status.OK_STATUS;
        }
      };
    }
View Full Code Here

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

   * @param toType
   * @return an IValidator, or <code>null</code> if unsuccessful
   */
  protected IValidator createValidator(Object fromType, Object toType) {
    if (fromType == null || toType == null) {
      return new IValidator() {

        public IStatus validate(Object value) {
          return Status.OK_STATUS;
        }
      };
View Full Code Here

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

      }
    }
  }

  private IValidator findValidator(Object fromType, Object toType) {
    IValidator result = null;

    // We only default the validator if we defaulted the converter since the
    // two are tightly coupled.
    if (defaultedConverter) {
      if (String.class.equals(fromType)) {
View Full Code Here

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

     * @param toClass
     *            The Class to convert to
     * @return An appropriate IValidator
     */
    private IValidator get(Object fromClass, Object toClass) {
      IValidator result = (IValidator) validators.get(new Pair(fromClass,
          toClass));
      if (result != null)
        return result;
      if (fromClass != null && toClass != null && fromClass == toClass) {
        return new IValidator() {
          public IStatus validate(Object value) {
            return Status.OK_STATUS;
          }
        };
      }
      return new IValidator() {
        public IStatus validate(Object value) {
          return Status.OK_STATUS;
        }
      };
    }
View Full Code Here

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

  }

  public static void bindBeanProperty(DataBindingContext dataBindingContext, final IMessageManager mmng, Object bean,
      final String propertyName, boolean mandatory, final String labelText, IObservableValue value,
      final Control control) {
    IValidator validator = null;
    if (mandatory) {
      validator = new MandatoryValidator(labelText);
    }
    bindBeanProperty(dataBindingContext, mmng, bean, propertyName, validator, value, control);
  }
View Full Code Here

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

    Control control = combo.getControl();
    GridData gdata = new GridData(SWT.FILL, SWT.CENTER, true, false);
    gdata.widthHint = 400;
    control.setLayoutData(gdata);

    IValidator validator = null;
    if (isMandatory(bean, propertyName)) {
      if (control instanceof Combo) {
        validator = new MandatoryComboValidator(labelText, (Combo) control);
      } else {
        validator = new MandatoryValidator(labelText);
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.