atg.core.util
Class Enum.LocaleEnumEditor

java.lang.Object
  extended by java.beans.PropertyEditorSupport
      extended by atg.core.util.Enum.EnumEditor
          extended by atg.core.util.Enum.LocaleEnumEditor
All Implemented Interfaces:
java.beans.PropertyEditor
Direct Known Subclasses:
ScheduledOrderAction.LocaleScheduledOrderActionEditor
Enclosing class:
Enum

public abstract static class Enum.LocaleEnumEditor
extends Enum.EnumEditor

Utility class to allow Enum objects to be used as properties of JavaBeans; the editor exposes tag values obtained by looking up the Enum values' logical names in a ResourceBundle. By default, the ResourceBundle is assumed to have the same name as the Enum subclass with the suffix "Tags" appended to the class name.


Constructor Summary
Enum.LocaleEnumEditor()
           
 
Method Summary
 java.lang.String getAsText()
          Get the current value as a String.
protected abstract  java.lang.Class getEnumClass()
           
protected  java.util.ResourceBundle getEnumResourceBundle()
           
 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, 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.LocaleEnumEditor

public Enum.LocaleEnumEditor()
Method Detail

getEnumClass

protected abstract java.lang.Class getEnumClass()
Specified by:
getEnumClass in class Enum.EnumEditor
Returns:
The Enum subclass this instance is the editor for.

getEnumResourceBundle

protected java.util.ResourceBundle getEnumResourceBundle()
Returns:
A ResourceBundle that will be used as a map between this editor's tag values and the String names of the underlying ordinals. The default implementation expects the resource bundle to be named identically to the Enum class but with the suffix "Tags" appended to the class name.

getTags

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

getAsText

public java.lang.String getAsText()
Get the current value as a String.

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

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 Enum.EnumEditor