Top Description Fields Constructors Methods
org.apache.pdfbox.debugger.ui

public Class ErrorDialog

extends JDialog
Class Inheritance
Annotations
@SuppressWarnings:serial, squid:MaximumInheritanceDepth
Imports
java.awt.BorderLayout, .Component, .Dimension, .Point, .Toolkit, java.awt.event.ActionListener, .KeyEvent, java.util.Arrays, .List, javax.swing.BorderFactory, .Box, .Icon, .ImageIcon, .JButton, .JCheckBox, .JComponent, .JDialog, .JEditorPane, .JPanel, .JScrollPane, .JTextPane, .KeyStroke, .ScrollPaneConstants, .WindowConstants

A dialog to display a runtime exception stack trace.
Author
Pinaki Poddar Modified from ErrorDialog.java and SwingHelper.java of the Apache OpenJPA jpa.tools.swing package.

Field Summary

Modifier and TypeField and Description
private static final int
private JScrollPane
private final Throwable
private static final List<String>
private static final String
private boolean
private final JComponent
private final JComponent
private static final Dimension
private static final String
private boolean
private JTextPane
private static final Dimension
private static final Dimension
Inherited from javax.swing.JDialog:
accessibleContextrootPanerootPaneCheckingEnabled

Constructor Summary

AccessConstructor and Description
public
ErrorDialog(Throwable
the exception to display
t
)

Creates a modal dialog to display the given exception message.

public
ErrorDialog(JComponent
if non-null, then the dialog is positioned (centered) w.r.t. this component
owner
,
Throwable
the exception to display
t
)

Creates a modal dialog to display the given exception message.

public
ErrorDialog(JComponent
if non-null, then the dialog is positioned (centered) w.r.t. this component
owner
,
Icon
the icon to display
icon
,
Throwable
the exception to display
t
)

Creates a modal dialog to display the given exception message.

Method Summary

Modifier and TypeMethod and Description
pack-priv final JComponent
createContent()

Creates the display with the top-level exception message followed by a pane (that toggles) for detailed stack traces.

pack-priv JScrollPane
createDetailedMessage()

Creates a non-editable widget to display the detailed stack trace.

pack-priv final JComponent
createErrorMessage(Throwable t)

Creates a non-editable widget to display the error message.

pack-priv StringBuilder
generateStackTrace(Throwable t, StringBuilder buffer)

Recursively print the stack trace on the given buffer.

private boolean
isSuppressed(String className)

Affirms if the error messages from the given class name is to be suppressed.

pack-priv static void
position(Component
the component to be positioned
c
,
Component
the component whose center will match the center of the given component. If null, the given component will match the screen center.
parent
)

Position the given component at the center of the given parent component or physical screen.

pack-priv StringBuilder
Inherited from javax.swing.JDialog:
addImplcreateRootPanedialogInitgetAccessibleContextgetContentPanegetDefaultCloseOperationgetGlassPanegetGraphicsgetJMenuBargetLayeredPanegetRootPanegetTransferHandlerisDefaultLookAndFeelDecoratedisRootPaneCheckingEnabledparamStringprocessWindowEventremoverepaintsetContentPanesetDefaultCloseOperationsetDefaultLookAndFeelDecoratedsetGlassPanesetJMenuBarsetLayeredPanesetLayoutsetRootPanesetRootPaneCheckingEnabledsetTransferHandlerupdate

Field Detail

BORDER_SIZEback to summary
private static final int BORDER_SIZE
detailsback to summary
private JScrollPane details
errorback to summary
private final Throwable error
FILTERSback to summary
private static final List<String> FILTERS
INDENTback to summary
private static final String INDENT
isFilteringback to summary
private boolean isFiltering
mainback to summary
private final JComponent main
messageback to summary
private final JComponent message
MESSAGE_SIZEback to summary
private static final Dimension MESSAGE_SIZE
NEWLINEback to summary
private static final String NEWLINE
showingDetailsback to summary
private boolean showingDetails
stacktraceback to summary
private JTextPane stacktrace
STACKTRACE_SIZEback to summary
private static final Dimension STACKTRACE_SIZE
TOTAL_SIZEback to summary
private static final Dimension TOTAL_SIZE

Constructor Detail

ErrorDialogback to summary
public ErrorDialog(Throwable t)

Creates a modal dialog to display the given exception message.

Parameters
t:Throwable

the exception to display

ErrorDialogback to summary
public ErrorDialog(JComponent owner, Throwable t)

Creates a modal dialog to display the given exception message.

Parameters
owner:JComponent

if non-null, then the dialog is positioned (centered) w.r.t. this component

t:Throwable

the exception to display

ErrorDialogback to summary
public ErrorDialog(JComponent owner, Icon icon, Throwable t)

Creates a modal dialog to display the given exception message.

Parameters
owner:JComponent

if non-null, then the dialog is positioned (centered) w.r.t. this component

icon:Icon

the icon to display

t:Throwable

the exception to display

Method Detail

createContentback to summary
pack-priv final JComponent createContent()

Creates the display with the top-level exception message followed by a pane (that toggles) for detailed stack traces.

createDetailedMessageback to summary
pack-priv JScrollPane createDetailedMessage()

Creates a non-editable widget to display the detailed stack trace.

createErrorMessageback to summary
pack-priv final JComponent createErrorMessage(Throwable t)

Creates a non-editable widget to display the error message.

generateStackTraceback to summary
pack-priv StringBuilder generateStackTrace(Throwable t, StringBuilder buffer)

Recursively print the stack trace on the given buffer.

isSuppressedback to summary
private boolean isSuppressed(String className)

Affirms if the error messages from the given class name is to be suppressed.

positionback to summary
pack-priv static void position(Component c, Component parent)

Position the given component at the center of the given parent component or physical screen.

Parameters
c:Component

the component to be positioned

parent:Component

the component whose center will match the center of the given component. If null, the given component will match the screen center.

toStringback to summary
pack-priv StringBuilder toString(StackTraceElement[] traces)