com.primix.vlib
Class EntitySelectionModel

java.lang.Object
  |
  +--com.primix.vlib.EntitySelectionModel
All Implemented Interfaces:
IPropertySelectionModel

public class EntitySelectionModel
extends java.lang.Object
implements IPropertySelectionModel

This class is used as a property selection model to select a primary key. We assume that the primary keys are integers, which makes it easy to translate between the various representations.

Version:
$Id: EntitySelectionModel.java,v 1.5 2001/05/02 18:07:07 hship Exp $
Author:
Howard Ship

Constructor Summary
EntitySelectionModel()
           
 
Method Summary
 void add(java.lang.Integer key, java.lang.String label)
           
 java.lang.String getLabel(int index)
          Returns the label for an option.
 java.lang.Object getOption(int index)
          Returns one possible option.
 int getOptionCount()
          Returns the number of possible options.
 java.lang.String getValue(int index)
          Returns a String used to represent the option in the HTML (as the value of an <option> or <input type=radio>.
 java.lang.Object translateValue(java.lang.String value)
          Returns the option corresponding to a value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EntitySelectionModel

public EntitySelectionModel()
Method Detail

add

public void add(java.lang.Integer key,
                java.lang.String label)

getOptionCount

public int getOptionCount()
Description copied from interface: IPropertySelectionModel
Returns the number of possible options.
Specified by:
getOptionCount in interface IPropertySelectionModel

getOption

public java.lang.Object getOption(int index)
Description copied from interface: IPropertySelectionModel
Returns one possible option.
Specified by:
getOption in interface IPropertySelectionModel

getLabel

public java.lang.String getLabel(int index)
Description copied from interface: IPropertySelectionModel
Returns the label for an option. It is the responsibility of the adaptor to make this value localized.
Specified by:
getLabel in interface IPropertySelectionModel

getValue

public java.lang.String getValue(int index)
Description copied from interface: IPropertySelectionModel
Returns a String used to represent the option in the HTML (as the value of an <option> or <input type=radio>.
Specified by:
getValue in interface IPropertySelectionModel

translateValue

public java.lang.Object translateValue(java.lang.String value)
Description copied from interface: IPropertySelectionModel
Returns the option corresponding to a value. This is used when interpreting submitted form parameters.
Specified by:
translateValue in interface IPropertySelectionModel