atg.core.util
Class Enum.EnumEditor

java.lang.Object
  extended by java.beans.PropertyEditorSupport
      extended by atg.core.util.Enum.EnumEditor
All Implemented Interfaces:
java.beans.PropertyEditor
Direct Known Subclasses:
Enum.LocaleEnumEditor, GearHeightEnum.GearHeightEnumEditor, GearWidthEnum.GearWidthEnumEditor, PropertyTypeEnum.PropertyTypeEditor, RegionHeightEnum.RegionHeightEnumEditor, RegionWidthEnum.RegionWidthEnumEditor, ScheduledOrderAction.ScheduledOrderActionEditor
Enclosing class:
Enum

public abstract static class Enum.EnumEditor
extends java.beans.PropertyEditorSupport

Utility class to allow Enum objects to be used as properties of JavaBeans; the editor exposes tag values equal to the Enum values' logical names.


Constructor Summary
Enum.EnumEditor()
           
 
Method Summary
protected abstract  java.lang.Class getEnumClass()
           
 java.lang.String[] getTags()
           
 void setAsText(java.lang.String n)
          Set the current value using the Enum subclass object's name.
 
Methods inherited from class java.beans.PropertyEditorSupport
addPropertyChangeListener, firePropertyChange, getAsText, getCustomEditor, getJavaInitializationString, getSource, getValue, isPaintable, paintValue, removePropertyChangeListener, setSource, setValue, supportsCustomEditor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Enum.EnumEditor

public Enum.EnumEditor()
Method Detail

getEnumClass

protected abstract java.lang.Class getEnumClass()
Returns:
The Enum subclass this instance is the editor for. This method is only necessary because we can't guarantee that setValue will be called before other methods (like getTags).

getTags

public java.lang.String[] getTags()
Specified by:
getTags in interface java.beans.PropertyEditor
Overrides:
getTags in class java.beans.PropertyEditorSupport
Returns:
An array of the names of each Enum subclass instance in order of instantiation.

setAsText

public void setAsText(java.lang.String n)
Set the current value using the Enum subclass object's name.

Specified by:
setAsText in interface java.beans.PropertyEditor
Overrides:
setAsText in class java.beans.PropertyEditorSupport