gov.virginia.dcjs.gui.field
Class ComboBoxField

java.lang.Object
  extended bygov.virginia.dcjs.gui.field.DisplayField
      extended bygov.virginia.dcjs.gui.field.ComboBoxField
All Implemented Interfaces:
FieldInterface

public class ComboBoxField
extends DisplayField


Field Summary
protected  int CHARWIDTH
           
 int TYPE
           
 
Constructor Summary
ComboBoxField()
           
ComboBoxField(javax.swing.JComboBox box)
           
ComboBoxField(javax.swing.JComboBox box, Relation items)
           
ComboBoxField(Relation items)
           
ComboBoxField(Relation items, int key, boolean showKey)
           
 
Method Summary
 java.lang.String getContent()
          Obtain the wrapped field's content in a String format * @return String representation of the wrapped field's contents
 javax.swing.JComponent getField()
          Obtain the JComboBox as a component * @return Field being wrapped
 int getType()
          Obtain the current type constant of the field * @return FieldType constant of the field
 int getWidth()
          Obtain the current width of the field * @return Width in pseudo characters of the field
 boolean isContentEditable()
          Determine whether or not the contents of this field can be modified * by the user.
 boolean isContentValid()
          Obtain from the wrapper class whether or not the class it * wraps contains contents in keeping within the object's context * @return True when the containing class has acceptable content
 void loadText(java.lang.String text)
          Add the specified text to the field in a manner consistent * with the field's data context.
 void setContent(java.lang.String content)
          Translate the String provided into content suitable to the * wrapped class * @param content What the field is to display
 void setContentEditable(boolean edit)
          Provide whether or not the contents of this field can be modified * by the user.
 void setField(javax.swing.JComponent field)
          Provide the JComboBox to be wrapped * @param field JComboBox this object is to wrap
 void setItems(Relation items)
          Populate the Combo Box list items with the contents of * the provided Relation * @param items List items for this combo box to offer * @deprecated Use setItems(Relation, int, boolean) instead
 void setItems(Relation items, int key, boolean showKey)
          Populate the Combo Box list items with the contents of * the provided Relation * @param items List items for this combo box to offer * @param key Column to store in database * @parem showKey True if the key column data is to be * shown to the user, false to hide the key column
 void setWidth(int width)
          Provide the width of the field * @param width Width in pseudo characters of the field
 java.lang.String toString()
           
 
Methods inherited from class gov.virginia.dcjs.gui.field.DisplayField
getCapacity, setCapacity
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TYPE

public final int TYPE
See Also:
Constant Field Values

CHARWIDTH

protected final int CHARWIDTH
See Also:
Constant Field Values
Constructor Detail

ComboBoxField

public ComboBoxField()

ComboBoxField

public ComboBoxField(javax.swing.JComboBox box)

ComboBoxField

public ComboBoxField(Relation items)

ComboBoxField

public ComboBoxField(Relation items,
                     int key,
                     boolean showKey)

ComboBoxField

public ComboBoxField(javax.swing.JComboBox box,
                     Relation items)
Method Detail

setItems

public void setItems(Relation items)
Populate the Combo Box list items with the contents of * the provided Relation * @param items List items for this combo box to offer * @deprecated Use setItems(Relation, int, boolean) instead


setItems

public void setItems(Relation items,
                     int key,
                     boolean showKey)
Populate the Combo Box list items with the contents of * the provided Relation * @param items List items for this combo box to offer * @param key Column to store in database * @parem showKey True if the key column data is to be * shown to the user, false to hide the key column


isContentValid

public boolean isContentValid()
Obtain from the wrapper class whether or not the class it * wraps contains contents in keeping within the object's context * @return True when the containing class has acceptable content


getContent

public java.lang.String getContent()
Obtain the wrapped field's content in a String format * @return String representation of the wrapped field's contents

Specified by:
getContent in class DisplayField

setContent

public void setContent(java.lang.String content)
Translate the String provided into content suitable to the * wrapped class * @param content What the field is to display

Specified by:
setContent in class DisplayField

getField

public javax.swing.JComponent getField()
Obtain the JComboBox as a component * @return Field being wrapped

Specified by:
getField in class DisplayField

setField

public void setField(javax.swing.JComponent field)
Provide the JComboBox to be wrapped * @param field JComboBox this object is to wrap

Specified by:
setField in class DisplayField

getType

public int getType()
Obtain the current type constant of the field * @return FieldType constant of the field

Specified by:
getType in class DisplayField

getWidth

public int getWidth()
Obtain the current width of the field * @return Width in pseudo characters of the field

Specified by:
getWidth in class DisplayField

setWidth

public void setWidth(int width)
Provide the width of the field * @param width Width in pseudo characters of the field

Specified by:
setWidth in class DisplayField

isContentEditable

public boolean isContentEditable()
Determine whether or not the contents of this field can be modified * by the user. * @return True if the user can modify the field contents

Specified by:
isContentEditable in class DisplayField

setContentEditable

public void setContentEditable(boolean edit)
Provide whether or not the contents of this field can be modified * by the user. * @param edit True if the user can modify the field contents

Specified by:
setContentEditable in class DisplayField

loadText

public void loadText(java.lang.String text)
Add the specified text to the field in a manner consistent * with the field's data context. * @param text Contents to add to field


toString

public java.lang.String toString()