Class DefaultInteractiveError

  • All Implemented Interfaces:
    InteractiveError

    public class DefaultInteractiveError
    extends java.lang.Object
    implements InteractiveError
    Default implementation for an interactive error.
    Author:
    harald
    • Constructor Summary

      Constructors 
      Constructor Description
      DefaultInteractiveError​(boolean warning, java.lang.String text, java.lang.String errorCode, org.tentackle.validate.ValidationResult validationResult, org.tentackle.fx.FxControl control)
      Creates an interactive error.
      DefaultInteractiveError​(InteractiveError error)
      Creates an error from another error.
      Useful to override methods in anonymous inner classes.
      DefaultInteractiveError​(org.tentackle.validate.ValidationResult validationResult, org.tentackle.fx.FxControl control)
      Creates an interactive error.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.tentackle.fx.FxControl getControl()
      Gets the related FX control.
      java.lang.String getErrorCode()
      Gets the optional error code.
      java.lang.String getText()
      Gets the error message.
      org.tentackle.validate.ValidationResult getValidationResult()
      Gets the optional validation result.
      boolean isWarning()
      Returns whether this is just a warning.
      void showControl()
      Shows the control to the user.
      The default implementation requests the focus.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • DefaultInteractiveError

        public DefaultInteractiveError​(boolean warning,
                                       java.lang.String text,
                                       java.lang.String errorCode,
                                       org.tentackle.validate.ValidationResult validationResult,
                                       org.tentackle.fx.FxControl control)
        Creates an interactive error.
        Parameters:
        warning - true if just a warning, false if error
        text - the error text
        errorCode - the optional error code
        validationResult - the validation result
        control - the optional UI component related to the error, null if none
      • DefaultInteractiveError

        public DefaultInteractiveError​(org.tentackle.validate.ValidationResult validationResult,
                                       org.tentackle.fx.FxControl control)
        Creates an interactive error.
        Parameters:
        validationResult - the validation result
        control - the optional UI component related to the error, null if none
      • DefaultInteractiveError

        public DefaultInteractiveError​(InteractiveError error)
        Creates an error from another error.
        Useful to override methods in anonymous inner classes.
        Parameters:
        error - the error
    • Method Detail

      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • isWarning

        public boolean isWarning()
        Description copied from interface: InteractiveError
        Returns whether this is just a warning.
        Specified by:
        isWarning in interface InteractiveError
        Returns:
        true if warning, false if error
      • getText

        public java.lang.String getText()
        Description copied from interface: InteractiveError
        Gets the error message.
        Specified by:
        getText in interface InteractiveError
        Returns:
        the error text
      • getErrorCode

        public java.lang.String getErrorCode()
        Description copied from interface: InteractiveError
        Gets the optional error code.
        Specified by:
        getErrorCode in interface InteractiveError
        Returns:
        the error code
      • getControl

        public org.tentackle.fx.FxControl getControl()
        Description copied from interface: InteractiveError
        Gets the related FX control.
        Specified by:
        getControl in interface InteractiveError
        Returns:
        the control, null if nothing related
      • showControl

        public void showControl()
        Description copied from interface: InteractiveError
        Shows the control to the user.
        The default implementation requests the focus.

        Applications may override this method to switch tabs, point to rows in tables, etc...

        Specified by:
        showControl in interface InteractiveError
      • getValidationResult

        public org.tentackle.validate.ValidationResult getValidationResult()
        Description copied from interface: InteractiveError
        Gets the optional validation result.
        Specified by:
        getValidationResult in interface InteractiveError
        Returns:
        the result, null if none