org.ceryle.wiki.plugin.form
Class FormControl

java.lang.Object
  extended by org.ceryle.wiki.plugin.form.FormControl
All Implemented Interfaces:
Comparable

public class FormControl
extends Object
implements Comparable

A form control struct, currently supporting content for input and textarea controls. Using a dot delimiter, controls can have both a prefix and suffix, permitting filtering on prefix and sorting via the suffix. E.g., "PFX.name.3" sorts after "PFX.name.2". Both prefix and suffice are optional, though certain features rely on them.

Using an example:


Field Summary
 String id
          The value of the control ID (derived from the suffix, also used for sorting).
 String label
          The value of the control's displayable label (no prefix or suffix).
 String name
          The value of the original control name, containing any prefix and/or suffix.
 String propname
          The value of the property name (with prefix but no sort value).
 Object size
          The value of the control's size, either a String containing an integer, or a two-element int[] array containing the row and column specification for a textarea.
 String sort
          The value of the sort name (no prefix, with the suffix moved to the beginning).
 String value
          The value of the control's value.
 
Constructor Summary
FormControl(String controlname, String controlvalue, Object controlsize)
          Constructor with the form name, value, size (input length as a String or text area {row,col} specification as an int[]).
 
Method Summary
 int compareTo(Object o)
          Implements the Comparable interface to compare this FormControl with another.
 void setSize(Object controlsize)
          Set the field size.
 String toString()
          Return a String representation of this FormControl, including all field data.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

name

public String name
The value of the original control name, containing any prefix and/or suffix.


propname

public String propname
The value of the property name (with prefix but no sort value).


label

public String label
The value of the control's displayable label (no prefix or suffix).


sort

public String sort
The value of the sort name (no prefix, with the suffix moved to the beginning).


id

public String id
The value of the control ID (derived from the suffix, also used for sorting).


value

public String value
The value of the control's value. This is the contents of either the <input> element's value attribute, or the element content of a <textarea>.


size

public Object size
The value of the control's size, either a String containing an integer, or a two-element int[] array containing the row and column specification for a textarea.

Constructor Detail

FormControl

public FormControl(String controlname,
                   String controlvalue,
                   Object controlsize)
Constructor with the form name, value, size (input length as a String or text area {row,col} specification as an int[]).

Parameters:
controlname - the base name of the control, containing any prefix or suffix.
controlvalue - the value of the control's value attribute.
controlsize - the control's size, either a String containing an integer or a two-element int[] array.
Method Detail

setSize

public void setSize(Object controlsize)
Set the field size.


compareTo

public int compareTo(Object o)
Implements the Comparable interface to compare this FormControl with another.

Specified by:
compareTo in interface Comparable

toString

public String toString()
Return a String representation of this FormControl, including all field data.

Overrides:
toString in class Object


The Ceryle Project. Copyright ©2001-2007 Murray Altheim, All Rights Reserved. See LICENSE included with distribution.