adapforms.form.elements
Class RepeatElement

java.lang.Object
  extended by adapforms.form.elements.FormElement
      extended by adapforms.form.elements.RepeatElement
All Implemented Interfaces:
ElementContainer

public class RepeatElement
extends FormElement
implements ElementContainer

Repeated element container. Allows the entire sub-domain to be repeated a number of times.

The label is optional, see description of GroupElement.

Author:
Henrik Gammelmark, geemark@cs.au.dk

Constructor Summary
RepeatElement(java.lang.String id, SimpleLabel label, java.util.List<FormElement> elements)
           
 
Method Summary
 RepeatElement clone(java.lang.String id, SimpleLabel label)
          Create a clone of the element, given a new ID and label.
 java.util.List<FormElement> getElements()
          Ordered list of form elements contained in this instance.
 SimpleLabel getEntryLabel()
          The label to use for repeat entries.
 int getMaxRepeats()
          Maximum number of repeats required.
 int getMinRepeats()
          Minimum number of repeats required.
 void setEntryLabel(SimpleLabel entryLabel)
           
 void setMaxRepeats(int repeats)
          See getMaxRepeats().
 void setMinRepeats(int repeats)
          See getMinRepeats().
 java.lang.String toString()
          Used for pretty-printing the element.
 
Methods inherited from class adapforms.form.elements.FormElement
cloneFinalize, getElementID, getLabel, getRolesRead, getUIFlags, isRelevant, setRelevant, setRolesRead, setUIFlags, toStringHelper
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RepeatElement

public RepeatElement(java.lang.String id,
                     SimpleLabel label,
                     java.util.List<FormElement> elements)
Method Detail

clone

public RepeatElement clone(java.lang.String id,
                           SimpleLabel label)
Description copied from class: FormElement
Create a clone of the element, given a new ID and label.

Important: The method should call FormElement.cloneFinalize(FormElement) before returning. This adds common parameters to the clone.

Specified by:
clone in class FormElement

getElements

public java.util.List<FormElement> getElements()
Description copied from interface: ElementContainer
Ordered list of form elements contained in this instance.

Specified by:
getElements in interface ElementContainer

getMinRepeats

public int getMinRepeats()
Minimum number of repeats required.


setMinRepeats

public void setMinRepeats(int repeats)
See getMinRepeats().


getMaxRepeats

public int getMaxRepeats()
Maximum number of repeats required.


setMaxRepeats

public void setMaxRepeats(int repeats)
See getMaxRepeats().


toString

public java.lang.String toString()
Description copied from class: FormElement
Used for pretty-printing the element. See Form.prettyPrintStructure().

Specified by:
toString in class FormElement

getEntryLabel

public SimpleLabel getEntryLabel()
The label to use for repeat entries. If null, the element label will be reused.


setEntryLabel

public void setEntryLabel(SimpleLabel entryLabel)
See Also:
getEntryLabel()