public class BugReportQueue extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
private class |
BugReportQueue.BugReportDisplayRunnable |
static interface |
BugReportQueue.BugReportHandler
Class that handles reporting a bug to the user.
|
static class |
BugReportQueue.SuppressionMode
The suppression mode that should be used after the dialog was closed.
|
Modifier and Type | Field and Description |
---|---|
private BugReportQueue.BugReportHandler |
bugReportHandler |
private int |
displayedErrors |
private java.lang.Thread |
displayThread |
static BugReportQueue.BugReportHandler |
FALLBACK_BUGREPORT_HANDLER
The fallback bug report handler if none is set.
|
private java.util.concurrent.CopyOnWriteArrayList<java.util.function.Predicate<ReportedException>> |
handlers |
private boolean |
inReportDialog |
private static BugReportQueue |
INSTANCE |
private java.util.LinkedList<ReportedException> |
reportsToDisplay |
private boolean |
suppressAllMessages |
private java.util.ArrayList<ReportedException> |
suppressFor |
Constructor and Description |
---|
BugReportQueue() |
Modifier and Type | Method and Description |
---|---|
void |
addBugReportHandler(java.util.function.Predicate<ReportedException> handler)
Allows you to peek or even intercept the bug reports.
|
private BugReportQueue.SuppressionMode |
displayFor(ReportedException e) |
boolean |
exceptionHandlingInProgress()
Check if the dialog is shown.
|
private int |
getDisplayedErrors() |
static BugReportQueue |
getInstance()
Gets the global bug report queue
|
private ReportedException |
getNext() |
private void |
handleDialogResult(ReportedException e,
BugReportQueue.SuppressionMode suppress) |
void |
setBugReportHandler(BugReportQueue.BugReportHandler bugReportHandler)
Sets the
BugReportQueue.BugReportHandler for this queue. |
void |
submit(ReportedException report)
Submit a new error to be displayed
|
public static final BugReportQueue.BugReportHandler FALLBACK_BUGREPORT_HANDLER
private static final BugReportQueue INSTANCE
private final java.util.LinkedList<ReportedException> reportsToDisplay
private boolean suppressAllMessages
private final java.util.ArrayList<ReportedException> suppressFor
private java.lang.Thread displayThread
private BugReportQueue.BugReportHandler bugReportHandler
private final java.util.concurrent.CopyOnWriteArrayList<java.util.function.Predicate<ReportedException>> handlers
private int displayedErrors
private boolean inReportDialog
public BugReportQueue()
public void submit(ReportedException report)
report
- The error to displayprivate void handleDialogResult(ReportedException e, BugReportQueue.SuppressionMode suppress)
private ReportedException getNext() throws java.lang.InterruptedException
java.lang.InterruptedException
private BugReportQueue.SuppressionMode displayFor(ReportedException e)
private int getDisplayedErrors()
public boolean exceptionHandlingInProgress()
true
if the exception handler is still showing the exception to the user.public void setBugReportHandler(BugReportQueue.BugReportHandler bugReportHandler)
BugReportQueue.BugReportHandler
for this queue.bugReportHandler
- the handler in charge of displaying the bug report. Must not be nullpublic void addBugReportHandler(java.util.function.Predicate<ReportedException> handler)
handler
- The handler. It can return false to stop all further handling of the exception.public static BugReportQueue getInstance()