adapforms.form.elements
Class FormElement

java.lang.Object
  extended by adapforms.form.elements.FormElement
Direct Known Subclasses:
BeanElement, GroupElement, HelpTextElement, RepeatElement, ValueHoldingElement

public abstract class FormElement
extends java.lang.Object

A single elementary part of the structure of an adaptive form. Most elements hold one or more values (see ValueHoldingElement), but some element types are for structural purposes only.

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

Constructor Summary
protected FormElement(java.lang.String id, SimpleLabel label)
           
 
Method Summary
abstract  FormElement clone(java.lang.String id, SimpleLabel label)
          Create a clone of the element, given a new ID and label.
protected  void cloneFinalize(FormElement clone)
          When cloning an element, use this method to clone all common superclass parameters.
 java.lang.String getElementID()
          Get the ID of the element.
 SimpleLabel getLabel()
          Get the human-friendly label/title of the element.
 java.lang.String[] getRolesRead()
          List of user roles allowed to read the value held in this element.
 java.lang.String getUIFlags()
          Get User Interface (UI) specific flags, or null if none are set.
 BooleanExpression isRelevant()
          Determine if the element is relevant by default, that is, on form instantiation time.
 void setRelevant(BooleanExpression value)
           
 void setRolesRead(java.lang.String[] read)
          See getRolesRead().
 void setUIFlags(java.lang.String flags)
          Set the UI flags for this element.
abstract  java.lang.String toString()
          Used for pretty-printing the element.
protected  java.lang.String toStringHelper(java.lang.String append)
          Helper method for toString() in subclasses.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FormElement

protected FormElement(java.lang.String id,
                      SimpleLabel label)
Method Detail

getElementID

public final java.lang.String getElementID()
Get the ID of the element. This can be seen as the local part of the complete path designating this element.


getRolesRead

public final java.lang.String[] getRolesRead()
List of user roles allowed to read the value held in this element.


setRolesRead

public final void setRolesRead(java.lang.String[] read)
See getRolesRead().


getLabel

public final SimpleLabel getLabel()
Get the human-friendly label/title of the element. If no label is present, null is returned.


getUIFlags

public final java.lang.String getUIFlags()
Get User Interface (UI) specific flags, or null if none are set.
The semantics and format of the flags are decided by the specific UI engine in use.


setUIFlags

public final void setUIFlags(java.lang.String flags)
Set the UI flags for this element.

Parameters:
flags - New flags, or null to remove
See Also:
getUIFlags()

isRelevant

public final BooleanExpression isRelevant()
Determine if the element is relevant by default, that is, on form instantiation time.


setRelevant

public final void setRelevant(BooleanExpression value)
See Also:
isRelevant()

clone

public abstract FormElement clone(java.lang.String id,
                                  SimpleLabel label)
Create a clone of the element, given a new ID and label.

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


cloneFinalize

protected void cloneFinalize(FormElement clone)
When cloning an element, use this method to clone all common superclass parameters.

Parameters:
clone - The clone
See Also:
clone(String, SimpleLabel)

toString

public abstract java.lang.String toString()
Used for pretty-printing the element. See Form.prettyPrintStructure().

Overrides:
toString in class java.lang.Object

toStringHelper

protected java.lang.String toStringHelper(java.lang.String append)
Helper method for toString() in subclasses.