Class ValidatorManager

java.lang.Object
com.iizigo.validator.ValidatorManager

public class ValidatorManager extends Object
Validator that manages several control validators on a wizard page.
Author:
Christopher Mindus
  • Constructor Details

    • ValidatorManager

      public ValidatorManager(IValidationMessage messageHandler)
      Creates the validation manager without a default message.
      Parameters:
      messageHandler - The message handler dialog, wizard or page.
    • ValidatorManager

      public ValidatorManager(IValidationMessage messageHandler, String defaultText)
      Creates the validation manager with a default message.
      Parameters:
      messageHandler - The message handler dialog, wizard or page.
      defaultText - Default text, can be null.
  • Method Details

    • hasBeenModified

      public boolean hasBeenModified()
      Checks if any input has been modified.
    • resetModified

      public void resetModified()
      Resets the modified state for all validators.
    • isValidAndComplete

      public boolean isValidAndComplete()
      Returns if the last validation is in error or not.
      Returns:
      true if OK (or warning), false for error or missing parameters.
    • validate

      public boolean validate()
      Validates the entire dialog.
      Returns:
      true if all validates OK (with possible warnings), false otherwise.
    • add

      public void add(IValidator validator)
      Adds a validator.
    • newValidator

      public ControlValidator newValidator(Button control)
      Creates a validator for a button in order to handle modified states.
    • newValidator

      public ControlValidator newValidator(Tree control, String descr, boolean mustBeSpecified)
      Creates a validator for a tree in order to handle modified states.
    • newValidator

      public ControlValidator newValidator(Text control, String descr, boolean mustBeSpecified)
      Creates a validator for a text field.
    • newValidator

      public ControlValidator newValidator(Combo control, String descr, boolean mustBeSpecified)
      Creates a validator for a combo.
    • newManualValidator

      public ControlValidator newManualValidator(Control control, int location)
      Creates a validator for any other control with manual verification.
      Parameters:
      control - The control.
      location - The location: combination of e.g. SWT.TOP|SWT.LEFT.
    • newValidator

      public ControlValidator newValidator(Spinner control, String descr, int min, int max, int value, int textLimit)
      Creates a validator for a spinner with a range and sets up the control.
      Parameters:
      control - The spinner.
      descr - The field description.
      min - Minimum value.
      max - Maximum value.
      value - The current value.
      textLimit - The text limit.