Class ControlValidator

  • All Implemented Interfaces:
    IValidator, java.util.EventListener,,,,, org.eclipse.swt.internal.SWTEventListener

    public class ControlValidator
    extends ValidationAdapter
    Control validator class for dialog boxes.
    Christopher Mindus
    • Method Detail

      • getImage

        public static getImage​(int type)
        Gets the required image.
        type - Image type: NONE, INFORMATION, WARNING or ERROR.
      • setDecoratedControl

        public void setDecoratedControl​(org.eclipse.swt.widgets.Control control)
        Place the control decorator on this component instead of the control.
        control - The control, if e.g. a composite is wrapping an entry field.
      • setValidatorCallback

        public void setValidatorCallback​(ValidatorCallback callback)
        Sets the callback validator.
      • setType

        public void setType​(java.lang.String descr,
                            int flags)
        Sets the description and flags.
      • setType

        public void setType​(int flags)
        Sets the type.
      • getMessage

        public java.lang.String getMessage()
        Gets the message.
        Specified by:
        getMessage in interface IValidator
      • setRequiredMessage

        public java.lang.String setRequiredMessage​(java.lang.String message)
        Sets a required message.
      • setInformationMessage

        public java.lang.String setInformationMessage​(java.lang.String message)
        Sets a warning message.
      • setWarningMessage

        public java.lang.String setWarningMessage​(java.lang.String message)
        Sets a warning message.
      • setErrorMessage

        public java.lang.String setErrorMessage​(java.lang.String message)
        Sets an error message.
      • getMessageType

        public int getMessageType()
        Gets the type of message (ERROR, WARNING, INFORMATION or NONE).
        Specified by:
        getMessageType in interface IValidator
      • modifyText

        public void modifyText​( e)
        Handles modifications.
        Specified by:
        modifyText in interface
      • verifyText

        public void verifyText​( e)
        Verifies input for for upper case and numeric only.
        Specified by:
        verifyText in interface
      • widgetSelected

        public void widgetSelected​( e)
        Selection changes (spinner).
        Specified by:
        widgetSelected in interface
      • widgetDefaultSelected

        public void widgetDefaultSelected​( e)
        Not processed.
        Specified by:
        widgetDefaultSelected in interface
      • reset

        public void reset()
        Resets the validator before performing all validations in the manager.
        Specified by:
        reset in interface IValidator
      • validate

        public boolean validate()
        Performs validation.
        Specified by:
        validate in interface IValidator
        true for success, false for failure.
      • setAtomNameValidator

        public void setAtomNameValidator​(PropCnr container,
                                         GProp<?> property,
                                         boolean allowLeadingDollar)
        Assigns the callback to be an Atom Name Validator.
        container - Property container where the name must not exist, null for no check.
        property - The property (name) being edited, null for none.
        allowLeadingDollar - Flag indicating leading dollar is allowed or not.
      • focusGained

        public void focusGained​( e)
        Sent when a control gets focus.
        Specified by:
        focusGained in interface
        e - An event containing information about the focus change.
      • focusLost

        public void focusLost​( e)
        Sent when a control loses focus.
        Specified by:
        focusLost in interface
        e - An event containing information about the focus change.