Package adams.gui.dialog
Class ComposeEmailPanel
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- javax.swing.JComponent
-
- javax.swing.JPanel
-
- adams.gui.core.BasePanel
-
- adams.gui.dialog.ComposeEmailPanel
-
- All Implemented Interfaces:
ImageObserver
,MenuContainer
,Serializable
,Accessible
public class ComposeEmailPanel extends BasePanel
A panel for composing an email.- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
-
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
-
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 BaseButton
m_ButtonSend
the button for sending.protected GenericArrayEditorPanel
m_GAEPanelAttachments
the attachments.protected GenericArrayEditorPanel
m_GAEPanelBCC
the "bcc recipients".protected GenericArrayEditorPanel
m_GAEPanelCC
the "cc recipients".protected GenericArrayEditorPanel
m_GAEPanelTO
the "to recipients".protected String
m_LastSendResult
the last "send" result.protected HashSet<ActionListener>
m_Listeners
the send listeners.protected BaseTabbedPane
m_TabbedPane
the tabbed pane for recipients and attachments.protected BaseTextArea
m_TextBody
the body.protected BaseTextField
m_TextFrom
the "from".protected BaseTextArea
m_TextSignature
the signature.protected BaseTextField
m_TextSubject
the subject.-
Fields inherited from class adams.gui.core.BasePanel
m_FileChooser
-
Fields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
-
Fields inherited from class java.awt.Component
accessibleContext, 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
Constructors Constructor Description ComposeEmailPanel()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addSendListener(ActionListener l)
Adds the listener for send events.protected String
check()
Checks whether we can send an email.void
clear()
Resets the dialog to default settings.PlaceholderFile[]
getAttachments()
Returns the attachments.EmailAddress[]
getBCC()
Returns the BCC recipients.String
getBody()
Returns the "body".EmailAddress[]
getCC()
Returns the CC recipients.EmailAddress
getFrom()
Returns the current from address.String
getLastSendResult()
Returns the last result obtained when sending an email.String
getSignature()
Returns the "signature".String
getSubject()
Returns the "subject".EmailAddress[]
getTO()
Returns the recipients.void
grabFocus()
The body text area grabs the focus.protected void
initGUI()
Initializes the widgets.protected void
initialize()
Initializes the members.protected void
notifySendListeners()
Sends out an event to all send listeners.void
removeSendListener(ActionListener l)
Removes the listener for send events.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
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.BasePanel
afterHide, afterShow, beforeHide, beforeShow, closeParent, finishInit, getParentChild, getParentDialog, getParentFrame, getParentInternalFrame, getParentTitle, initFileChooser, main, printErrorMessage, printException, saveComponent, setEnabledCascade, setEnabledCascade, setParentTitle, setVisible
-
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
-
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, unregisterKeyboardAction, update
-
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, 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, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
-
-
-
Field Detail
-
m_TextFrom
protected BaseTextField m_TextFrom
the "from".
-
m_GAEPanelTO
protected GenericArrayEditorPanel m_GAEPanelTO
the "to recipients".
-
m_GAEPanelCC
protected GenericArrayEditorPanel m_GAEPanelCC
the "cc recipients".
-
m_GAEPanelBCC
protected GenericArrayEditorPanel m_GAEPanelBCC
the "bcc recipients".
-
m_GAEPanelAttachments
protected GenericArrayEditorPanel m_GAEPanelAttachments
the attachments.
-
m_TextSubject
protected BaseTextField m_TextSubject
the subject.
-
m_TextBody
protected BaseTextArea m_TextBody
the body.
-
m_TextSignature
protected BaseTextArea m_TextSignature
the signature.
-
m_ButtonSend
protected BaseButton m_ButtonSend
the button for sending.
-
m_TabbedPane
protected BaseTabbedPane m_TabbedPane
the tabbed pane for recipients and attachments.
-
m_LastSendResult
protected String m_LastSendResult
the last "send" result.
-
m_Listeners
protected HashSet<ActionListener> m_Listeners
the send listeners.
-
-
Method Detail
-
initialize
protected void initialize()
Initializes the members.- Overrides:
initialize
in classBasePanel
-
clear
public void clear()
Resets the dialog to default settings.
-
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 "body".- Returns:
- the body
-
setSignature
public void setSignature(String value)
Sets the "signature".- Parameters:
value
- the signature
-
getSignature
public String getSignature()
Returns the "signature".- Returns:
- the signature
-
check
protected String check()
Checks whether we can send an email.- Returns:
- null if the email can get sent, otherwise error message
-
send
public String send()
Attempts to send the email.- Returns:
- null if successfully sent
-
getLastSendResult
public String getLastSendResult()
Returns the last result obtained when sending an email.- Returns:
- null if successfully (or nothing yet) sent, otherwise the error message
-
addSendListener
public void addSendListener(ActionListener l)
Adds the listener for send events.- Parameters:
l
- the listener to add
-
removeSendListener
public void removeSendListener(ActionListener l)
Removes the listener for send events.- Parameters:
l
- the listener to remove
-
notifySendListeners
protected void notifySendListeners()
Sends out an event to all send listeners.
-
grabFocus
public void grabFocus()
The body text area grabs the focus.- Overrides:
grabFocus
in classJComponent
-
-