Filter:   InfoImg
download IPropertySelectionModel.java
Language: Java
LOC: 9
Project Info
Tapestry: Java Web Components(tapestry)
Server: SourceForge
Type: cvs
...k\src\net\sf\tapestry\form\
   AbstractFormComponent.java
   AbstractTextField.java
   Button.java
   Button.jwc
   Checkbox.java
   Checkbox.jwc
   DatePicker.html
   DatePicker.java
   DatePicker.js
   DatePicker.jwc
   DatePicker.script
   ...ertySelectionModel.java
   Form.java
   Form.jwc
   FormEventType.java
   Hidden.java
   Hidden.jwc
   IFormComponent.java
   ImageSubmit.java
   ImageSubmit.jwc
   ...ertySelectionModel.java
   ...ySelectionRenderer.java
   ListEdit.java
   ListEdit.jwc
   Option.java
   Option.jwc
   package.html
   PropertySelection.java
   PropertySelection.jwc
   Radio.java
   Radio.jwc
   RadioGroup.java
   RadioGroup.jwc
   ...ySelectionRenderer.java
   Select.java
   Select.jwc
   ...ySelectionRenderer.java
   ...ertySelectionModel.java
   Submit.java
   Submit.jwc
   TextArea.java
   TextArea.jwc
   TextField.java
   TextField.jwc
   Upload.java
   Upload.jwc

package net.sf.tapestry.form;

/**
 *  Used by a {@link PropertySelection} to provide labels for options.
 *
 *  <p>The component requires three different representations
 *  of each option:
 *  <ul>
 *  <li>The option value, a Java object that will eventually be assigned to
 *  a property
 *  <li>The label, a String which is incorprated into the HTML to identify the
 *  option to the user
 *  <li>The value, a String which is used to represent the option as the value
 *  of the &lt;option&gt; or &lt;input type=radio&gt; generated by the
 *  {@link PropertySelection}.
 *  </ul>
 *
 *  <p>The option is usually either an {@link net.sf.tapestry.util.Enum} 
 *  (see {@link EnumPropertySelectionModel})
 *  or some kind of business object.  The label is often a property of the
 *  option object (for example, for a list of customers, it could be the customer name).
 *
 *  <p>It should be easy to convert between the value and the option.  It may simply
 *  be an index into an array.  For business objects, it is often the primary key
 *  of the object, expressed as a String.
 *
 *  @version $Id: IPropertySelectionModel.java,v 1.4 2002/11/27 17:58:47 hship Exp $
 *  @author Howard Lewis Ship
 *
 **/

public interface IPropertySelectionModel
{
    /**
     *  Returns the number of possible options.
     *
     **/

    public int getOptionCount();

    /**
     *  Returns one possible option.
     *
     **/

    public Object getOption(int index);

    /**
     *  Returns the label for an option.  It is the responsibility of the
     *  adaptor to make this value localized.
     *
     **/

    public String getLabel(int index);

    /**
     *  Returns a String used to represent the option in the HTML (as the
     *  value of an &lt;option&gt; or &lt;input type=radio&gt;.
     *
     **/

    public String getValue(int index);

    /**
     *  Returns the option corresponding to a value.  This is used when
     *  interpreting submitted form parameters.
     *
     **/

    public Object translateValue(String value);
}