Package adams.gui.dialog
Class ComposeEmailDialog
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- java.awt.Window
-
- java.awt.Dialog
-
- javax.swing.JDialog
-
- adams.gui.core.BaseDialog
-
- 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$
- 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, Window.Type
-
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
Fields Modifier and Type Field Description 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 adams.gui.core.BaseDialog
m_AfterHideActions, m_AfterShowActions, m_BeforeHideActions, m_BeforeShowActions, m_DisposeCalled, m_UISettingsApplied, m_UISettingsPrefix, m_UISettingsStored
-
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 java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
-
Fields inherited from interface javax.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSE
-
-
Constructor Summary
Constructors Constructor Description 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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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
addAfterHideAction, addAfterShowAction, addBeforeHideAction, addBeforeShowAction, afterHide, afterShow, applyUISettings, beforeHide, dispose, executeAfterHideActions, executeAfterShowActions, executeBeforeHideActions, executeBeforeShowActions, finishInit, getUISettingsApplied, getUISettingsPrefix, initialize, pack, removeAfterHideAction, removeAfterShowAction, removeBeforeHideAction, removeBeforeShowAction, setLocationRelativeTo, setUISettingsPrefix, setUISettingsPrefix, setVisible, storeUISettings
-
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, setBackground, setModal, setModalityType, setOpacity, setResizable, setShape, setTitle, setUndecorated, show, toBack
-
Methods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, getBackground, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOpacity, getOwnedWindows, getOwner, getOwnerlessWindows, getShape, getToolkit, getType, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isAutoRequestFocus, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isOpaque, isShowing, isValidateRoot, pack, paint, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeNotify, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setAutoRequestFocus, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImage, setIconImages, setLocation, setLocation, setLocationByPlatform, setMinimumSize, setModalExclusionType, setSize, setSize, setType, 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, 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, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, 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, 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, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, requestFocusInWindow, resize, resize, revalidate, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setMixingCutoutShape, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
-
-
-
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 dialogtitle
- the title of the dialog
-
ComposeEmailDialog
public ComposeEmailDialog(Frame owner)
Creates a modal dialog.- Parameters:
owner
- the owning frame
-
-
Method Detail
-
initGUI
protected void initGUI()
initializes the GUI elements.- Overrides:
initGUI
in classBaseDialog
-
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 classBaseDialog
-
-