Interface IVSMessageComponent

All Superinterfaces:
ICustomDataProvider, IFocusComp, IGProp<GProp<?>[]>, IMessageBox, IPropCnr, IVSComponent, IVSComponentListener, IVSComponentState
All Known Implementing Classes:
EditorVirtualSpace, EditorVSAction, EditorVSColumnHeader, EditorVSField, EditorVSTable, VirtualSpace, VSAction, VSColumnHeader, VSField, VSTable

public interface IVSMessageComponent extends IVSComponent
The message support for a VS component.
Author:
Christopher Mindus
  • Method Details

    • isValid

      default boolean isValid()
      Checks if valid, i.e. no message is present.
      Returns:
      true if there is no message, false otherwise.
    • clearMessage

      default boolean clearMessage()
      Clears the message.
      Returns:
      true for change, false means no change.
    • getMessage

      default PlainKString getMessage()
      Gets the message from the validation process.
      Returns:
      The message from the parsing or validation, null for none (i.e. OK).
    • getMessageString

      default String getMessageString()
      Gets the message from the validation process as a String.

      Note: the returned string could be empty in case the PlainKString contains tags and the resolved string becomes empty!

      Returns:
      The message from the parsing or validation, null for none (i.e. OK).
    • getMessageCategory

      default int getMessageCategory()
      Gets the current message category.
      Returns:
      Always IVSComponent.NONE (-1) when valid, otherwise IVSComponent.INFORMATION (0), IVSComponent.WARNING (1) or IVSComponent.ERROR (2).
    • setMessage

      default boolean setMessage(ValueConversionException exception)
      Sets the validation message for a value conversion error.
      Parameters:
      exception - The value conversion exception.
      Returns:
      true for change, false means no change.
    • setMessage

      default boolean setMessage(PlainKString message, int category)
      Sets the validation message.
      Parameters:
      message - The message to set, null to clear message (category will not be changed).
      category - The message category IVSComponent.NONE (-1), IVSComponent.INFORMATION (0), IVSComponent.WARNING (1) or IVSComponent.ERROR (2).
      Returns:
      true for change, false for no change.
      Throws:
      IllegalArgumentException - If the category is not IVSComponent.NONE (-1), IVSComponent.INFORMATION (0), IVSComponent.WARNING (1) or IVSComponent.ERROR (2).
    • setErrorMessage

      default boolean setErrorMessage(String message)
      Helper method to set (or clear) the error message (message + category IVSComponent.ERROR).
      Parameters:
      message - The message.
      Returns:
      true for change, false for no change.