org.jurvis.swing.form
Class JvEnumeratorField

java.lang.Object
  extended by org.jurvis.swing.form.JvAbstractField
      extended by org.jurvis.swing.form.JvEnumeratorField
All Implemented Interfaces:
JvField

public class JvEnumeratorField
extends JvAbstractField

A JvField that displays the enumerated values of a JvEnumerator class. The values are displayed in a non-editable JComboBox.

Author:
Neil W. Weber
See Also:
JvField

Field Summary
protected  Class enumeratorClass
          The JvEnumerator class.
 
Fields inherited from class org.jurvis.swing.form.JvAbstractField
component, label, log
 
Constructor Summary
JvEnumeratorField(Class enumeratorClass, JLabel label, JComboBox comboBox)
          Construct a new JvEnumeratorField for the specified JvEnumerator class.
JvEnumeratorField(JvEnumerator enumerator, JLabel label, JComboBox comboBox)
          Construct a new JvEnumeratorField for the specified JvEnumerator.
 
Method Summary
 Object getValue()
          Gets the field value.
 void setValue(Object value)
          Set (or change) the object that is to be edited.
 
Methods inherited from class org.jurvis.swing.form.JvAbstractField
getAsText, getComponent, getLabel, getMessage, getName, getWrapper, isEditable, isEnabled, setEditable, setEnabled
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

enumeratorClass

protected Class enumeratorClass
The JvEnumerator class.

Constructor Detail

JvEnumeratorField

public JvEnumeratorField(JvEnumerator enumerator,
                         JLabel label,
                         JComboBox comboBox)
Construct a new JvEnumeratorField for the specified JvEnumerator. The JComboBox will be populated with the enumerators of the JvEnumerator unless the JComboBox is already populated.

Parameters:
enumerator - an instance of an JvEnumerator
label - the JLabel used to identify this field
comboBox - the actual GUI field editor

JvEnumeratorField

public JvEnumeratorField(Class enumeratorClass,
                         JLabel label,
                         JComboBox comboBox)
Construct a new JvEnumeratorField for the specified JvEnumerator class. The JComboBox will be populated with the enumerators of the JvEnumerator unless the JComboBox is already populated.

Parameters:
enumeratorClass - the Enumerator class
label - the JLabel used to identify this field
comboBox - the actual GUI field editor
Method Detail

getValue

public Object getValue()
Gets the field value.

Returns:
The value of the field. Primitive types such as "int" will be wrapped as the corresponding object type such as "java.lang.Integer".

setValue

public void setValue(Object value)
Set (or change) the object that is to be edited. Primitive types such as "int" must be wrapped as the corresponding object type such as "java.lang.Integer".

Parameters:
value - The new target object to be edited. Note that this object is not modified during editing, rather a new object is created to hold the modified value.


Copyright © 1999-2004 Neil W. Weber. All Rights Reserved.