adams.gui.goe
Class EmailAddressEditor

java.lang.Object
  extended by java.beans.PropertyEditorSupport
      extended by adams.gui.goe.AbstractPropertyEditorSupport
          extended by adams.gui.goe.EmailAddressEditor
All Implemented Interfaces:
CustomStringRepresentationHandler, MultiSelectionEditor, PropertyEditor

public class EmailAddressEditor
extends AbstractPropertyEditorSupport
implements CustomStringRepresentationHandler, MultiSelectionEditor

A PropertyEditor for EmailAddress objects.

Version:
$Revision: 6908 $
Author:
FracPete (fracpete at waikato dot ac dot nz)
See Also:
EmailAddress

Field Summary
protected  JButton m_ButtonClose
          the close button.
protected  JButton m_ButtonOK
          the OK button.
protected  SelectEmailAddressPanel m_SelectPanel
          The panel used for selecting fields.
 
Fields inherited from class adams.gui.goe.AbstractPropertyEditorSupport
APPROVE_OPTION, CANCEL_OPTION, m_ChosenOption, m_CustomEditor, m_WindowAdapter
 
Constructor Summary
EmailAddressEditor()
           
 
Method Summary
protected  JComponent createCustomEditor()
          Gets the custom editor component.
 Object fromCustomStringRepresentation(String str)
          Returns an object created from the custom string representation.
 String getJavaInitializationString()
          Returns a representation of the current property value as java source.
 Object[] getSelectedObjects(Container parent)
          Returns the selected objects.
protected  void initForDisplay()
          Initializes the display of the value.
 void paintValue(Graphics gfx, Rectangle box)
          Paints a representation of the current Object.
 String toCustomStringRepresentation(Object obj)
          Returns a custom string representation of the object.
static String toString(AbstractOption option, Object object)
          Returns the field as string.
static Object valueOf(AbstractOption option, String str)
          Returns a EmailAddress generated from the string.
 
Methods inherited from class adams.gui.goe.AbstractPropertyEditorSupport
addWindowAdapter, cleanUp, closeDialog, createPopup, createWindowAdapter, getChosenOption, getCustomEditor, initialize, isPaintable, resetChosenOption, setValue, supportsCustomEditor
 
Methods inherited from class java.beans.PropertyEditorSupport
addPropertyChangeListener, firePropertyChange, getAsText, getSource, getTags, getValue, removePropertyChangeListener, setAsText, setSource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_SelectPanel

protected SelectEmailAddressPanel m_SelectPanel
The panel used for selecting fields.


m_ButtonOK

protected JButton m_ButtonOK
the OK button.


m_ButtonClose

protected JButton m_ButtonClose
the close button.

Constructor Detail

EmailAddressEditor

public EmailAddressEditor()
Method Detail

toString

public static String toString(AbstractOption option,
                              Object object)
Returns the field as string.

Parameters:
option - the current option
object - the EmailAddress object to convert
Returns:
the generated string

valueOf

public static Object valueOf(AbstractOption option,
                             String str)
Returns a EmailAddress generated from the string. All "\t" strings are turned automatically into tab characters.

Parameters:
option - the current option
str - the string to convert to a field
Returns:
the generated EmailAddress object

toCustomStringRepresentation

public String toCustomStringRepresentation(Object obj)
Returns a custom string representation of the object.

Specified by:
toCustomStringRepresentation in interface CustomStringRepresentationHandler
Parameters:
obj - the object to turn into a string
Returns:
the string representation

fromCustomStringRepresentation

public Object fromCustomStringRepresentation(String str)
Returns an object created from the custom string representation.

Specified by:
fromCustomStringRepresentation in interface CustomStringRepresentationHandler
Parameters:
str - the string to turn into an object
Returns:
the object

getJavaInitializationString

public String getJavaInitializationString()
Returns a representation of the current property value as java source.

Specified by:
getJavaInitializationString in interface PropertyEditor
Overrides:
getJavaInitializationString in class PropertyEditorSupport
Returns:
a value of type 'String'

createCustomEditor

protected JComponent createCustomEditor()
Gets the custom editor component.

Specified by:
createCustomEditor in class AbstractPropertyEditorSupport
Returns:
the editor

initForDisplay

protected void initForDisplay()
Initializes the display of the value.

Overrides:
initForDisplay in class AbstractPropertyEditorSupport

paintValue

public void paintValue(Graphics gfx,
                       Rectangle box)
Paints a representation of the current Object.

Specified by:
paintValue in interface PropertyEditor
Overrides:
paintValue in class PropertyEditorSupport
Parameters:
gfx - the graphics context to use
box - the area we are allowed to paint into

getSelectedObjects

public Object[] getSelectedObjects(Container parent)
Returns the selected objects.

Specified by:
getSelectedObjects in interface MultiSelectionEditor
Parameters:
parent - the parent container
Returns:
the objects


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