Class StatusReporter
java.lang.Object
org.eclipse.e4.core.services.statusreporter.StatusReporter
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
Modifier and TypeFieldDescriptionstatic final int
Style constant indicating that the handling should block the calling thread until the status has been handled.static final int
severity ERRORstatic final int
Style constant indicating that the status should not be acted on.static final int
severity INFOstatic final int
Style constant indicating that the status should be logged only.static final int
severity OKstatic 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
-
Method Summary
Modifier and TypeMethodDescriptionabstract IStatus
Return a status object with the given severity, message, and optional exception.abstract void
Report the given status, using the given style as a hint.final void
Convenience method, equivalent to callingreport(newStatus(severity, message, exception), SHOW, information).
-
Field Details
-
OK
public static final int OKseverity OK- See Also:
-
INFO
public static final int INFOseverity INFO- See Also:
-
WARNING
public static final int WARNINGseverity WARNING- See Also:
-
ERROR
public static final int ERRORseverity ERROR- See Also:
-
IGNORE
public static final int IGNOREStyle 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 LOGStyle constant indicating that the status should be logged only.- See Also:
-
SHOW
public static final int SHOWStyle 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 BLOCKStyle 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
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
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, ornull
.
-
show
Convenience method, equivalent to callingreport(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, ornull
.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.
-