adams.gui.dialog
Class ComposeEmailDialog

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by java.awt.Window
              extended by java.awt.Dialog
                  extended by javax.swing.JDialog
                      extended by adams.gui.core.BaseDialog
                          extended by adams.gui.dialog.ComposeEmailDialog
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, RootPaneContainer, WindowConstants

public class ComposeEmailDialog
extends BaseDialog

A standalone dialog for composing emails.

Version:
$Revision: 4584 $
Author:
fracpete (fracpete at waikato dot ac dot nz)
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JDialog
JDialog.AccessibleJDialog
 
Nested classes/interfaces inherited from class java.awt.Dialog
Dialog.AccessibleAWTDialog, Dialog.ModalExclusionType, Dialog.ModalityType
 
Nested classes/interfaces inherited from class java.awt.Window
Window.AccessibleAWTWindow
 
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
protected  boolean m_CloseOnSend
          whether to close the dialog when successfully sent.
protected  boolean m_DialogClosedByUser
          whether the user closed the dialog.
protected  ComposeEmailPanel m_Panel
          the compose panel.
 
Fields inherited from class javax.swing.JDialog
accessibleContext, rootPane, rootPaneCheckingEnabled
 
Fields inherited from class java.awt.Dialog
DEFAULT_MODALITY_TYPE
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface javax.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSE
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
ComposeEmailDialog(Dialog owner)
          Creates a modal dialog.
ComposeEmailDialog(Dialog owner, String title)
          Creates a modal dialog.
ComposeEmailDialog(Frame owner)
          Creates a modal dialog.
ComposeEmailDialog(Frame owner, String title)
          Creates a modal dialog.
 
Method Summary
protected  void beforeShow()
          Hook method just before the dialog is made visible.
 void clear()
          Resets the dialog to default settings.
protected  void closeOnSuccessfulSend()
          Closes the dialog on a successful send.
 PlaceholderFile[] getAttachments()
          Returns the attachments.
 EmailAddress[] getBCC()
          Returns the BCC recipients.
 String getBody()
          Returns the "signature".
 EmailAddress[] getCC()
          Returns the CC recipients.
 boolean getCloseOnSend()
          Returns whether the dialog gets closed when successfully sending the email.
 boolean getDialogClosedByUser()
          Returns whether the dialog was closed by the user.
 EmailAddress getFrom()
          Returns the current from address.
 String getLastSendResult()
          Returns the last result of sending an email.
 String getSignature()
          Returns the "signature".
 String getSubject()
          Returns the "subject".
 EmailAddress[] getTO()
          Returns the recipients.
protected  void initGUI()
          initializes the GUI elements.
 String send()
          Attempts to send the email.
 void setAttachments(PlaceholderFile[] value)
          Sets the attachments.
 void setBCC(EmailAddress[] value)
          Sets the BCC recipients.
 void setBody(String value)
          Sets the "body".
 void setCC(EmailAddress[] value)
          Sets the CC recipients.
 void setCloseOnSend(boolean value)
          Sets whether to close the dialog on successfully sending the email.
 void setFrom(EmailAddress value)
          Sets the "from" email address.
 void setSignature(String value)
          Sets the "signature".
 void setSubject(String value)
          Sets the "subject".
 void setTO(EmailAddress[] value)
          Sets the recipients.
 
Methods inherited from class adams.gui.core.BaseDialog
afterHide, afterShow, beforeHide, finishInit, initialize, setVisible
 
Methods inherited from class javax.swing.JDialog
addImpl, createRootPane, dialogInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update
 
Methods inherited from class java.awt.Dialog
addNotify, getModalityType, getTitle, hide, isModal, isResizable, isUndecorated, setModal, setModalityType, setResizable, setTitle, setUndecorated, show, toBack
 
Methods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOwnedWindows, getOwner, getOwnerlessWindows, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isShowing, pack, paint, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeNotify, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImage, setIconImages, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, toFront
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusBackward, transferFocusDownCycle, 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, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, 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, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, 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, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resize, resize, setBackground, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

m_Panel

protected ComposeEmailPanel m_Panel
the compose panel.


m_CloseOnSend

protected boolean m_CloseOnSend
whether to close the dialog when successfully sent.


m_DialogClosedByUser

protected boolean m_DialogClosedByUser
whether the user closed the dialog.

Constructor Detail

ComposeEmailDialog

public ComposeEmailDialog(Dialog owner)
Creates a modal dialog.

Parameters:
owner - the owning dialog

ComposeEmailDialog

public ComposeEmailDialog(Dialog owner,
                          String title)
Creates a modal dialog.

Parameters:
owner - the owning dialog
title - the title of the dialog

ComposeEmailDialog

public ComposeEmailDialog(Frame owner)
Creates a modal dialog.

Parameters:
owner - the owning frame

ComposeEmailDialog

public ComposeEmailDialog(Frame owner,
                          String title)
Creates a modal dialog.

Parameters:
owner - the owning frame
title - the title of the dialog
Method Detail

initGUI

protected void initGUI()
initializes the GUI elements.

Overrides:
initGUI in class BaseDialog

clear

public void clear()
Resets the dialog to default settings.


closeOnSuccessfulSend

protected void closeOnSuccessfulSend()
Closes the dialog on a successful send.

See Also:
getCloseOnSend(), getLastSendResult()

send

public String send()
Attempts to send the email.

Returns:
null if successfully sent
See Also:
setCloseOnSend(boolean)

setFrom

public void setFrom(EmailAddress value)
Sets the "from" email address.

Parameters:
value - the address

getFrom

public EmailAddress getFrom()
Returns the current from address.

Returns:
the "from" address

setTO

public void setTO(EmailAddress[] value)
Sets the recipients.

Parameters:
value - the recipients

getTO

public EmailAddress[] getTO()
Returns the recipients.

Returns:
the recipients

setCC

public void setCC(EmailAddress[] value)
Sets the CC recipients.

Parameters:
value - the CC Brecipients

getCC

public EmailAddress[] getCC()
Returns the CC recipients.

Returns:
the CC recipients

setBCC

public void setBCC(EmailAddress[] value)
Sets the BCC recipients.

Parameters:
value - the BCC recipients

getBCC

public EmailAddress[] getBCC()
Returns the BCC recipients.

Returns:
the BCC recipients

setAttachments

public void setAttachments(PlaceholderFile[] value)
Sets the attachments.

Parameters:
value - the attachments

getAttachments

public PlaceholderFile[] getAttachments()
Returns the attachments.

Returns:
the attachements

setSubject

public void setSubject(String value)
Sets the "subject".

Parameters:
value - the subject

getSubject

public String getSubject()
Returns the "subject".

Returns:
the subject

setBody

public void setBody(String value)
Sets the "body".

Parameters:
value - the body

getBody

public String getBody()
Returns the "signature".

Returns:
the signature

setSignature

public void setSignature(String value)
Sets the "signature".

Parameters:
value - the signature

getSignature

public String getSignature()
Returns the "signature".

Returns:
the signature

getLastSendResult

public String getLastSendResult()
Returns the last result of sending an email.

Returns:
null if successfully (or nothing yet) sent, otherwise the error message

setCloseOnSend

public void setCloseOnSend(boolean value)
Sets whether to close the dialog on successfully sending the email.

Parameters:
value - if true the dialog gets closed as soon as email got successfully sent

getCloseOnSend

public boolean getCloseOnSend()
Returns whether the dialog gets closed when successfully sending the email.

Returns:
true if the dialog gets closed as soon as the email got sent successfully

getDialogClosedByUser

public boolean getDialogClosedByUser()
Returns whether the dialog was closed by the user.

Returns:
true if closed by the user

beforeShow

protected void beforeShow()
Hook method just before the dialog is made visible.

Overrides:
beforeShow in class BaseDialog


Copyright © 2013 University of Waikato, Hamilton, NZ. All Rights Reserved.