Class StatusReporter

java.lang.Object
org.eclipse.e4.core.services.statusreporter.StatusReporter

public abstract class StatusReporter extends Object
Handling warnings or errors, with the intent of making the end user aware of these. Strings are expected to be translated.
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    Style constant indicating that the handling should block the calling thread until the status has been handled.
    static final int
    severity ERROR
    static final int
    Style constant indicating that the status should not be acted on.
    static final int
    severity INFO
    static final int
    Style constant indicating that the status should be logged only.
    static final int
    severity OK
    static final int
    Style constant indicating that handlers should show a problem to an user without blocking the calling method while awaiting user response.
    static final int
    severity WARNING
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract IStatus
    newStatus(int severity, String message, Throwable exception)
    Return a status object with the given severity, message, and optional exception.
    abstract void
    report(IStatus status, int style, Object... information)
    Report the given status, using the given style as a hint.
    final void
    show(int severity, String message, Throwable exception, Object... information)
    Convenience method, equivalent to calling report(newStatus(severity, message, exception), SHOW, information).

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • OK

      public static final int OK
      severity OK
      See Also:
    • INFO

      public static final int INFO
      severity INFO
      See Also:
    • WARNING

      public static final int WARNING
      severity WARNING
      See Also:
    • ERROR

      public static final int ERROR
      severity ERROR
      See Also:
    • IGNORE

      public static final int IGNORE
      Style constant indicating that the status should not be acted on. This is used by objects such as log listeners that do not want to report a status twice. This constant is treated as a HINT.
      See Also:
    • LOG

      public static final int LOG
      Style constant indicating that the status should be logged only.
      See Also:
    • SHOW

      public static final int SHOW
      Style constant indicating that handlers should show a problem to an user without blocking the calling method while awaiting user response. This is generally done using a non modal Dialog. This constant is treated as a HINT.
      See Also:
    • BLOCK

      public static final int BLOCK
      Style constant indicating that the handling should block the calling thread until the status has been handled. This constant is treated as a HINT, and the caller cannot rely on the fact that the call will be blocking. However, the caller needs to be prepared for the case where the call blocks, and potentially runs the event loop (which may change UI state).

      A typical usage of this would be to give the user an opportunity to deal with the status in some manner. It is therefore likely but not required that a modal dialog is going to be used.

      The use of BLOCK is not recommended because of its potential to block the current thread, and the corresponding risk of causing deadlocks.

      See Also:
  • Constructor Details

    • StatusReporter

      public StatusReporter()
  • Method Details

    • report

      public abstract void report(IStatus status, int style, Object... information)
      Report the given status, using the given style as a hint.
      Parameters:
      status - a status object describing an exceptional situation that should be brought to the attention of the user.
      style - one of the handling styles (IGNORE, LOG, SHOW, BLOCK).
      information - any number of additional objects to pass along with the status in order to help with diagnosing the problem. One possible use of these objects would be to call their toString() methods.
    • newStatus

      public abstract IStatus newStatus(int severity, String message, Throwable exception)
      Return a status object with the given severity, message, and optional exception.
      Parameters:
      severity - one of the severity constants (OK, INFO, WARNING, ERROR).
      message - a non-null, non-empty localized message describing the unforeseen condition, in as high-level a way as possible such that an end user can understand the situation and act upon it. In the case of IGNORE or LOG, the message may be untranslated if there is reason to believe that the message will primarily be seen by technical support.
      exception - an optional exception, or null.
    • show

      public final void show(int severity, String message, Throwable exception, Object... information)
      Convenience method, equivalent to calling report(newStatus(severity, message, exception), SHOW, information).
      Parameters:
      severity - one of the severity constants (OK, INFO, WARNING, ERROR).
      message - a non-null, non-empty localized message describing the unforeseen condition, in as high-level a way as possible such that an end user can understand the situation and act upon it. In the case of IGNORE or LOG, the message may be untranslated if there is reason to believe that the message will primarily be seen by technical support.
      exception - an optional exception, or null.
      information - any number of additional objects to pass along in order to help with diagnosing the problem. One possible use of these objects may be that their toString() methods will be called.