org.shaker.dwu
Class BugDialog

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--java.awt.Window
                    |
                    +--java.awt.Dialog
                          |
                          +--javax.swing.JDialog
                                |
                                +--org.shaker.dwu.BugDialog
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.event.ActionListener, java.util.EventListener, java.awt.image.ImageObserver, java.awt.MenuContainer, javax.swing.RootPaneContainer, java.io.Serializable, javax.swing.WindowConstants

final class BugDialog
extends javax.swing.JDialog
implements java.awt.event.ActionListener

This class provides a message dialog, that informs the user about the occured error. The BugProfile can be submitted and previewed via a seperate tab.

Author:
Philipp Bartsch (codeshaker@gmx.net), GPL License
See Also:
Serialized Form

Inner classes inherited from class javax.swing.JDialog
javax.swing.JDialog.AccessibleJDialog
 
Inner classes inherited from class java.awt.Dialog
java.awt.Dialog.AccessibleAWTDialog
 
Inner classes inherited from class java.awt.Window
java.awt.Window.AccessibleAWTWindow
 
Inner classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Inner classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.AWTTreeLock
 
Field Summary
private  BugProfile bugProfile
          The Profile of the occured bug
private  javax.swing.JTextArea commentsArea
          The user comment TextArea
private static java.lang.String DISPOSE
          ActionCommand: Dispose this dialog
private static java.lang.String PREVIEW
          ActionCommand: show message preview
private  javax.swing.JButton previewBtn
          Send later button
private  javax.swing.JEditorPane previewPane
          The mail preview TextArea
private static java.lang.String SEND_LATER
          ActionCommand: Send later (just dispose)
private static java.lang.String SEND_NOW
          ActionCommand: Send reports
private  javax.swing.JButton sendBtn
          Send button
private  javax.swing.JButton sendLaterBtn
          Send later button
private static Settings SETTINGS
          A reference to the settings
private static java.lang.String SHOW_WIZARD
          ActionCommand: Start the configuration wizard
private  javax.swing.JLabel statusLabel
          The statusbar
private  javax.swing.JTabbedPane tabPane
          Dialog`s tabbedpane.
private  javax.swing.JButton wizardBtn
          Configuration wizard starter
 
Fields inherited from class javax.swing.JDialog
accessibleContext, defaultCloseOperation, rootPane, rootPaneCheckingEnabled
 
Fields inherited from class java.awt.Dialog
base, keepBlocking, modal, nameCounter, resizable, serialVersionUID, title
 
Fields inherited from class java.awt.Window
active, dbg, focusMgr, inputContext, inputContextLock, OPENED, ownedWindowList, showWithParent, state, warningString, weakThis, windowListener, windowSerializedDataVersion
 
Fields inherited from class java.awt.Container
component, containerListener, containerSerializedDataVersion, dispatcher, layoutMgr, listeningBoundsChildren, listeningChildren, maxSize, ncomponents, printing, printingThreads
 
Fields inherited from class java.awt.Component
actionListenerK, adjustmentListenerK, appContext, background, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, changeSupport, componentListener, componentListenerK, componentOrientation, componentSerializedDataVersion, containerListenerK, cursor, dropTarget, enabled, eventMask, focusListener, focusListenerK, font, foreground, graphicsConfig, hasFocus, height, hierarchyBoundsListener, hierarchyBoundsListenerK, hierarchyListener, hierarchyListenerK, incRate, inputMethodListener, inputMethodListenerK, isInc, isPacked, itemListenerK, keyListener, keyListenerK, LEFT_ALIGNMENT, locale, LOCK, metrics, minSize, mouseListener, mouseListenerK, mouseMotionListener, mouseMotionListenerK, name, nameExplicitlySet, newEventsOnly, ownedWindowK, parent, peer, peerFont, popups, prefSize, privateKey, RIGHT_ALIGNMENT, textListenerK, TOP_ALIGNMENT, valid, visible, width, windowClosingException, windowListenerK, x, y
 
Fields inherited from interface javax.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
(package private) BugDialog(BugProfile profile, java.awt.Frame parent, java.lang.String error, java.lang.String hint)
          Constructor for a BugProfile driven dialog.
(package private) BugDialog(java.awt.Frame parent, java.lang.String error, java.lang.String solution)
          Constructor for a simple info dialog.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent ae)
          This method handles occuring events, like button usage etc.
private  javax.swing.JPanel initControlPane(boolean showErrorButton)
          Inits the controlpane.
private  void initPreviewPane()
          Inits the report previewer pane by including the mailbody.
private  void initReportPane(boolean setShown)
          Inits the shortened report panel.
private  void initUserInfoPanel(java.lang.String error, java.lang.String solution)
          Inits the general description pane (what happened, what can be done..).
private  void resetStatus(java.lang.String dictKey, boolean isError)
          Resets the embedded status panel.
private  void showWizard()
          Creates and shows the configuration wizard.
private  void togglePreview()
          This method toggles the visibility of the ReportMail preview tab.
 
Methods inherited from class javax.swing.JDialog
addImpl, createRootPane, createRootPaneException, dialogInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isRootPaneCheckingEnabled, paramString, processKeyEvent, processWindowEvent, remove, setContentPane, setDefaultCloseOperation, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setLocationRelativeTo, setRootPane, setRootPaneCheckingEnabled, update
 
Methods inherited from class java.awt.Dialog
, addNotify, conditionalShow, constructComponentName, dispose, disposeImpl, getTitle, hide, hideAndDisposeHandler, initIDs, interruptBlocking, isModal, isResizable, setModal, setResizable, setTitle, show
 
Methods inherited from class java.awt.Window
addOwnedWindow, addWindowListener, adjustListeningChildren, applyResourceBundle, applyResourceBundle, connectOwnedWindow, dispatchEventImpl, eventEnabled, finalize, getFocusOwner, getGraphicsConfiguration, getInputContext, getListeners, getLocale, getOwnedWindows, getOwner, getToolkit, getWarningString, isActive, isShowing, nextFocus, ownedInit, pack, postEvent, postProcessKeyEvent, postWindowEvent, preProcessKeyEvent, processEvent, readObject, removeOwnedWindow, removeWindowListener, resetGC, setCursor, setFocusOwner, setWarningString, toBack, toFront, transferFocus, writeObject
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, applyOrientation, checkGD, countComponents, createChildHierarchyEvents, createHierarchyEvents, deliverEvent, dispatchEventToSelf, doLayout, findComponentAt, findComponentAt, findComponentAt, getAccessibleAt, getAccessibleChild, getAccessibleChildrenCount, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents_NoClientCode, getComponents, getInsets, getLayout, getMaximumSize, getMinimumSize, getMouseEventTarget, getPreferredSize, getWindow, insets, invalidate, invalidateTree, isAncestorOf, layout, lightweightPaint, lightweightPrint, list, list, locate, minimumSize, numListening, paint, paintComponents, paintHeavyweightComponents, postsOldMouseEvents, preferredSize, print, printComponents, printHeavyweightComponents, processContainerEvent, proxyEnableEvents, proxyRequestFocus, remove, removeAll, removeContainerListener, removeNotify, setFont, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, areInputMethodsEnabled, bounds, checkImage, checkImage, checkWindowClosingException, coalesceEvents, contains, contains, createImage, createImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getAccessibleIndexInParent, getAccessibleStateSet, getBackground, getBounds, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont_NoClientCode, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getInputMethodRequests, getLocation, getLocation, getLocationOnScreen_NoTreeLock, getLocationOnScreen, getName, getNativeContainer, getParent_NoClientCode, getParent, getPeer, getSize, getSize, getToolkitImpl, getTreeLock, getWidth, getWindowForObject, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isDisplayable, isDoubleBuffered, isEnabled, isEnabledImpl, isFocusTraversable, isLightweight, isOpaque, isRecursivelyVisible, 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, processMouseEvent, processMouseMotionEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setDropTarget, setEnabled, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, size, toString, transferFocus
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

DISPOSE

private static final java.lang.String DISPOSE
ActionCommand: Dispose this dialog

SHOW_WIZARD

private static final java.lang.String SHOW_WIZARD
ActionCommand: Start the configuration wizard

SEND_NOW

private static final java.lang.String SEND_NOW
ActionCommand: Send reports

SEND_LATER

private static final java.lang.String SEND_LATER
ActionCommand: Send later (just dispose)

PREVIEW

private static final java.lang.String PREVIEW
ActionCommand: show message preview

SETTINGS

private static final Settings SETTINGS
A reference to the settings

statusLabel

private final javax.swing.JLabel statusLabel
The statusbar

tabPane

private final javax.swing.JTabbedPane tabPane
Dialog`s tabbedpane. Holds the message, stacktrace and reportpanel

sendBtn

private final javax.swing.JButton sendBtn
Send button

sendLaterBtn

private final javax.swing.JButton sendLaterBtn
Send later button

previewBtn

private final javax.swing.JButton previewBtn
Send later button

wizardBtn

private final javax.swing.JButton wizardBtn
Configuration wizard starter

commentsArea

private final javax.swing.JTextArea commentsArea
The user comment TextArea

previewPane

private final javax.swing.JEditorPane previewPane
The mail preview TextArea

bugProfile

private final BugProfile bugProfile
The Profile of the occured bug
Constructor Detail

BugDialog

BugDialog(BugProfile profile,
          java.awt.Frame parent,
          java.lang.String error,
          java.lang.String hint)
Constructor for a BugProfile driven dialog.
Parameters:
profile - a bugprofile that has never been submitted
parent - the parental frame
error - error description.
solution - an optional solution/hint regarding this error
See Also:
for a simple, BugProfile-less messagedialog.

BugDialog

BugDialog(java.awt.Frame parent,
          java.lang.String error,
          java.lang.String solution)
Constructor for a simple info dialog. It contains a problem description and a optional solution.
Parameters:
parent - parental frame
error - the error description
solution - a optional solution
See Also:
for a BugProfile driven dialog
Method Detail

initUserInfoPanel

private void initUserInfoPanel(java.lang.String error,
                               java.lang.String solution)
Inits the general description pane (what happened, what can be done..).
Parameters:
error - a string representation of the error
solution - a optional hint

initReportPane

private void initReportPane(boolean setShown)
Inits the shortened report panel. It contains a restart-wizard button, a comment textarea and sendbuttons. This pane gets created, when the wizard has created a properly working dwu setting.
Parameters:
setShown - preselect the bugreport pane

initPreviewPane

private void initPreviewPane()
Inits the report previewer pane by including the mailbody.

initControlPane

private javax.swing.JPanel initControlPane(boolean showErrorButton)
Inits the controlpane. The controlpane delivers a close button and, if the wizard has never been started, a wizardstarter.
Parameters:
showErrorButton - indicates wheter to show the wizardstarter button
Returns:
JPanel the control container panel

resetStatus

private void resetStatus(java.lang.String dictKey,
                         boolean isError)
Resets the embedded status panel.
Parameters:
dictKey - the message dictionary key
isError - is true, the label has a red foreground

showWizard

private void showWizard()
Creates and shows the configuration wizard.
See Also:
for a description of the wizard

togglePreview

private void togglePreview()
This method toggles the visibility of the ReportMail preview tab.

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent ae)
This method handles occuring events, like button usage etc.
Specified by:
actionPerformed in interface java.awt.event.ActionListener
Parameters:
ae - an ActionEvent