wt.clients.gui
Class ExceptionDialog

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjava.awt.Window
              extended byjava.awt.Dialog
                  extended bywt.clients.gui.ExceptionDialog
All Implemented Interfaces:
Accessible, ImageObserver, MenuContainer, Serializable

public class ExceptionDialog
extends Dialog

Dialog used for displaying throwables. This dialog contains a wrapping label for displaying either a specified message or the localized message of the throwable, a button which, when pressed, generates an HTML page containing the stack trace of the given throwable, and a button to close the dialog.

Supported API:true

Extendable: false

See Also:
Serialized Form

Nested Class Summary
(package private)  class ExceptionDialog.SymAction
           
(package private)  class ExceptionDialog.SymKey
           
(package private)  class ExceptionDialog.SymWindow
           
 
Nested classes inherited from class java.awt.Dialog
Dialog.AccessibleAWTDialog
 
Nested classes inherited from class java.awt.Window
Window.AccessibleAWTWindow
 
Nested classes inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
(package private)  Panel buttonPanel
           
private  ThreadGroup contextGroup
           
private static boolean DEBUG
           
(package private)  Button detailsButton
           
(package private)  JTextArea exceptionLabel
           
(package private)  boolean fComponentsAdjusted
           
(package private)  symantec.itools.awt.shape.HorizontalLine horizontalLine1
           
private  String messageString
           
(package private)  Button okButton
           
private static ResourceBundle resources
           
private static String RESOURCES
           
private  Throwable throwable
           
private  String traceTitle
           
private static String versionID
           
 
Fields inherited from class java.awt.Dialog
 
Fields inherited from class java.awt.Window
 
Fields inherited from class java.awt.Container
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
ExceptionDialog(Component parent, boolean modal, Exception e)
          Deprecated. replaced with constructor which takes in a throwable instead of an exception
ExceptionDialog(Component parent, boolean modal, Exception e, String message)
          Deprecated. replaced with constructor which takes a throwable instead of an exception
ExceptionDialog(Component parent, boolean modal, Throwable t)
           Constructor for Exception Dialog.
ExceptionDialog(Component parent, boolean modal, Throwable t, String message)
           Constructor for Exception Dialog.
ExceptionDialog(Component parent, String title, boolean modal)
          Constructor for Exception Dialog.
ExceptionDialog(Component parent, String title, boolean modal, Exception e, String message)
          Deprecated. replaced with constructor which takes a throwable instead of an exception
ExceptionDialog(Component parent, String title, boolean modal, Throwable t, String message)
           Constructor for Exception Dialog.
ExceptionDialog(Frame parent, boolean modal)
          Constructor for ExceptionDialog
ExceptionDialog(Frame parent, boolean modal, Exception e, String message)
          Deprecated. replaced with constructor that requires a throwable instead of an exception
ExceptionDialog(Frame parent, boolean modal, Throwable t, String message)
          Constructor for Exception Dialog.
ExceptionDialog(Frame parent, String title, boolean modal)
          Constructor for Exception Dialog.
ExceptionDialog(Frame parent, String title, boolean modal, Exception e, String message)
          Deprecated. replaced with constructor which takes in a Throwable instead of an exception
ExceptionDialog(Frame parent, String title, boolean modal, Throwable t, String message)
           Constructor for Exception Dialog.
 
Method Summary
 void addNotify()
           
(package private)  void detailsButton_ActionPerformed(ActionEvent event)
           
(package private)  void detailsButton_KeyPressed(KeyEvent event)
           
(package private)  void Dialog1_WindowClosing(WindowEvent event)
           
private  WTContext getContext()
          Convenience method to retrieve the WTContext for this dialog.
 Exception getException()
          Deprecated. replaced with getThrowable
protected static Frame getFrame(Component component)
          Attempts to find a Frame somewhere in the component hierarchy of the given component.
 String getMessageString()
          Returns the string message displayed by this dialog.
 Throwable getThrowable()
          Returns the throwable whose stack trace is displayed by this dialog.
static char[] getTraceAsCharArray(Throwable exception)
          Returns the stack trace of the given throwable as a character array.
 String getTraceTitle()
          Returns the string being used as the title of the HTML stack trace page.
protected  void handleDetailsCommand()
          Invoked in response to the Show Details button being pressed or ENTER key pressed.
protected  void handleOkCommand()
          Invoked in response to the OK button being pressed or ENTER key pressed.
private  void initResources()
           
private  void localize()
           
(package private)  void okButton_ActionPerformed(ActionEvent event)
          Event callback invoked when the OK button is pressed.
(package private)  void okButton_KeyPressed(KeyEvent event)
          Event callback invoked when a key is pressed with the OK button in focus.
protected  void setDisplayLocation()
           
 void setException(Throwable t)
          Deprecated. replaced with setThrowable
 void setMessageString(String s)
          Sets the string message to be displayed in this dialog.
 void setThrowable(Throwable t)
          Sets the throwable whose stack trace is displayed by this dialog.
 void setTraceTitle(String s)
          Sets the string title displayed on the HTML stack trace page.
 void setVisible(boolean b)
          Shows or hides the component depending on the boolean flag b.
 void show()
           
 
Methods inherited from class java.awt.Dialog
dispose, getAccessibleContext, getTitle, hide, isModal, isResizable, isUndecorated, paramString, setModal, setResizable, setTitle, setUndecorated
 
Methods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, finalize, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getInputContext, getListeners, getLocale, getMostRecentFocusOwner, getOwnedWindows, getOwner, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindowStateListeners, isActive, isFocusableWindow, isFocusCycleRoot, isFocused, isShowing, pack, postEvent, processEvent, processWindowEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, setCursor, setFocusableWindowState, setFocusCycleRoot, setLocationRelativeTo, toBack, toFront
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setFocusTraversalKeys, setFocusTraversalPolicy, setFont, setLayout, transferFocusBackward, transferFocusDownCycle, update, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isOpaque, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

versionID

private static final String versionID
See Also:
Constant Field Values

fComponentsAdjusted

boolean fComponentsAdjusted

exceptionLabel

JTextArea exceptionLabel

horizontalLine1

symantec.itools.awt.shape.HorizontalLine horizontalLine1

buttonPanel

Panel buttonPanel

okButton

Button okButton

detailsButton

Button detailsButton

contextGroup

private ThreadGroup contextGroup

throwable

private Throwable throwable

messageString

private String messageString

traceTitle

private String traceTitle

RESOURCES

private static String RESOURCES

resources

private static ResourceBundle resources

DEBUG

private static boolean DEBUG
Constructor Detail

ExceptionDialog

public ExceptionDialog(Frame parent,
                       boolean modal)
Constructor for ExceptionDialog


ExceptionDialog

public ExceptionDialog(Frame parent,
                       String title,
                       boolean modal)
Constructor for Exception Dialog.

Parameters:
parent - the Frame owner of this dialog
title - the String to be displayed as the dialog title
modal - if true, dialog blocks input into the parent frame when shown.

ExceptionDialog

public ExceptionDialog(Frame parent,
                       boolean modal,
                       Exception e,
                       String message)
Deprecated. replaced with constructor that requires a throwable instead of an exception

Constructor for Exception Dialog.

Parameters:
parent - the Frame owner of this dialog
modal - if true, dialog blocks input into the parent frame when shown.
e - the exception whose stack trace is displayed by this dialog
message - the message string to be displayed as the text of this dialog.

ExceptionDialog

public ExceptionDialog(Frame parent,
                       boolean modal,
                       Throwable t,
                       String message)
Constructor for Exception Dialog.

Parameters:
parent - the Frame owner of this dialog
modal - if true, dialog blocks input into the parent frame when shown.
t - the Throwable whose stack trace is displayed by this dialog
message - the message string to be displayed as the text of this dialog.

ExceptionDialog

public ExceptionDialog(Frame parent,
                       String title,
                       boolean modal,
                       Exception e,
                       String message)
Deprecated. replaced with constructor which takes in a Throwable instead of an exception

Constructor for Exception Dialog.

Parameters:
parent - the Frame owner of this dialog
title - the String to display as the title of this dialog
modal - if true, dialog blocks input into the parent frame when shown.
e - the exception whose stack trace is displayed by this dialog
message - the message string to be displayed as the text of this dialog.

ExceptionDialog

public ExceptionDialog(Frame parent,
                       String title,
                       boolean modal,
                       Throwable t,
                       String message)
Constructor for Exception Dialog.

Parameters:
parent - the Frame owner of this dialog
title - the String to display as the title of this dialog
modal - if true, dialog blocks input into the parent frame when shown.
message - the message string to be displayed as the text of this dialog.

ExceptionDialog

public ExceptionDialog(Component parent,
                       String title,
                       boolean modal)
Constructor for Exception Dialog. This constructor accepts a Component as the parent of the dialog. This constructor will attempt to locate a frame in the hierarchy of the component to parent this dialog.

Parameters:
parent - the Component owner of this dialog
title - the String to be displayed as the dialog title
modal - if true, dialog blocks input into the parent frame when shown.

ExceptionDialog

public ExceptionDialog(Component parent,
                       boolean modal,
                       Exception e)
Deprecated. replaced with constructor which takes in a throwable instead of an exception

Constructor for Exception Dialog. This constructor accepts a Component as the parent of the dialog. This constructor will attempt to locate a frame in the hierarchy of the component to parent this dialog.

Parameters:
parent - the Component owner of this dialog
modal - if true, dialog blocks input into the parent frame when shown.
e - the exception whose stack trace is displayed by this dialog

ExceptionDialog

public ExceptionDialog(Component parent,
                       boolean modal,
                       Throwable t)
Constructor for Exception Dialog. This constructor accepts a Component as the parent of the dialog. This constructor will attempt to locate a frame in the hierarchy of the component to parent this dialog.

Parameters:
parent - the Component owner of this dialog
modal - if true, dialog blocks input into the parent frame when shown.
t - the throwable whose stack trace is displayed by this dialog

ExceptionDialog

public ExceptionDialog(Component parent,
                       boolean modal,
                       Exception e,
                       String message)
Deprecated. replaced with constructor which takes a throwable instead of an exception

Constructor for Exception Dialog. This constructor accepts a Component as the parent of the dialog. This constructor will attempt to locate a frame in the hierarchy of the component to parent this dialog.

Parameters:
parent - the Component owner of this dialog
modal - if true, dialog blocks input into the parent frame when shown.
e - the exception whose stack trace is displayed by this dialog
message - the message string to be displayed as the text of this dialog.

ExceptionDialog

public ExceptionDialog(Component parent,
                       boolean modal,
                       Throwable t,
                       String message)
Constructor for Exception Dialog. This constructor accepts a Component as the parent of the dialog. This constructor will attempt to locate a frame in the hierarchy of the component to parent this dialog.

Parameters:
parent - the Component owner of this dialog
modal - if true, dialog blocks input into the parent frame when shown.
t - the throwable whose stack trace is displayed by this dialog
message - the message string to be displayed as the text of this dialog.

ExceptionDialog

public ExceptionDialog(Component parent,
                       String title,
                       boolean modal,
                       Exception e,
                       String message)
Deprecated. replaced with constructor which takes a throwable instead of an exception

Constructor for Exception Dialog. This constructor accepts a Component as the parent of the dialog. This constructor will attempt to locate a frame in the hierarchy of the component to parent this dialog.

Parameters:
parent - the Component owner of this dialog
title - the String title of this dialog
modal - if true, dialog blocks input into the parent frame when shown.
e - the exception whose stack trace is displayed by this dialog
message - the message string to be displayed as the text of this dialog.

ExceptionDialog

public ExceptionDialog(Component parent,
                       String title,
                       boolean modal,
                       Throwable t,
                       String message)
Constructor for Exception Dialog. This constructor accepts a Component as the parent of the dialog. This constructor will attempt to locate a frame in the hierarchy of the component to parent this dialog.

Parameters:
parent - the Component owner of this dialog
title - the String title of this dialog
modal - if true, dialog blocks input into the parent frame when shown.
t - the throwable whose stack trace is displayed by this dialog
message - the message string to be displayed as the text of this dialog.
Method Detail

initResources

private void initResources()
                    throws MissingResourceException
Throws:
MissingResourceException

localize

private void localize()

addNotify

public void addNotify()

setException

public void setException(Throwable t)
Deprecated. replaced with setThrowable

Sets the throwable whose stack trace is displayed by this dialog. If no message text has been explicitly set for this dialog, this method will use the localized message of the throwable as the message text of the dialog.

Parameters:
t - the throwable whose stack trace is displayed by this dialog

setThrowable

public void setThrowable(Throwable t)
Sets the throwable whose stack trace is displayed by this dialog. If no message text has been explicitly set for this dialog, this method will use the localized message of the throwable as the message text of the dialog.

Parameters:
t - the throwable whose stack trace is displayed by this dialog

getException

public Exception getException()
Deprecated. replaced with getThrowable

Returns the exception whose stack trace is displayed by this dialog.

Returns:
the exception corresponding to this dialog

getThrowable

public Throwable getThrowable()
Returns the throwable whose stack trace is displayed by this dialog.

Returns:
the throwable corresponding to this dialog

setMessageString

public void setMessageString(String s)
Sets the string message to be displayed in this dialog.

Parameters:
s - the string message to be displayed in this dialog.

getMessageString

public String getMessageString()
Returns the string message displayed by this dialog. If the message has not been explicitly set, the localized message of the exception is used as the message text.

Returns:
the string message displayed by this dialog.

setTraceTitle

public void setTraceTitle(String s)
Sets the string title displayed on the HTML stack trace page.

Parameters:
s - the string title of the HTML stack trace page.

getTraceTitle

public String getTraceTitle()
Returns the string being used as the title of the HTML stack trace page. If the string has not been explicitly set, this method returns the class name of the exception.

Returns:
the string being used as the stack trace page.

setVisible

public void setVisible(boolean b)
Shows or hides the component depending on the boolean flag b.

Parameters:
b - if true, show the component; otherwise, hide the component.
See Also:
Component.isVisible()

show

public void show()

setDisplayLocation

protected void setDisplayLocation()

Dialog1_WindowClosing

void Dialog1_WindowClosing(WindowEvent event)

handleOkCommand

protected void handleOkCommand()
Invoked in response to the OK button being pressed or ENTER key pressed. This method closes this dialog.


okButton_ActionPerformed

void okButton_ActionPerformed(ActionEvent event)
Event callback invoked when the OK button is pressed.


okButton_KeyPressed

void okButton_KeyPressed(KeyEvent event)
Event callback invoked when a key is pressed with the OK button in focus. If the key pressed is an ENTER key, this method invokes the handleOkCommand method.

Parameters:
event - the KeyEvent resulting in this method being invoked.

getFrame

protected static Frame getFrame(Component component)
Attempts to find a Frame somewhere in the component hierarchy of the given component. If no frame is found, null is returned.

Parameters:
component - the component for which a parent Frame is found
Returns:
the parent frame of the given component, or null if no frame is found.

getContext

private WTContext getContext()
Convenience method to retrieve the WTContext for this dialog.

Returns:
the WTContext for this dialog

detailsButton_ActionPerformed

void detailsButton_ActionPerformed(ActionEvent event)

handleDetailsCommand

protected void handleDetailsCommand()
Invoked in response to the Show Details button being pressed or ENTER key pressed. This method generates and displays an HTML page containing the stack trace of the exception of this dialog.


detailsButton_KeyPressed

void detailsButton_KeyPressed(KeyEvent event)

getTraceAsCharArray

public static char[] getTraceAsCharArray(Throwable exception)
Returns the stack trace of the given throwable as a character array.

Parameters:
exception - the throwable whose stack trace is returned as an array
Returns:
a character array containing the stack trace of the given exception