org.olat.core.gui.formelements
Class AbstractTextElement

java.lang.Object
  extended by org.olat.core.gui.formelements.AbstractFormElement
      extended by org.olat.core.gui.formelements.AbstractTextElement
All Implemented Interfaces:
FormElement
Direct Known Subclasses:
TextAreaElement, TextElement

public abstract class AbstractTextElement
extends AbstractFormElement

Initial Date: Apr 20, 2004

Author:
gnaegi Comment: Base class that implements common methods used in TextElements, TextAreaElements and PasswordElements.

Constructor Summary
AbstractTextElement()
           
 
Method Summary
 PopupData getPopupData()
           
 java.lang.String getValue()
           
 boolean isDirty()
           
 boolean isEmpty()
          Check if the text element is empty
 boolean isEmpty(java.lang.String errorKey)
          Check if the text element is empty
 boolean isEqual(java.lang.String otherValue, java.lang.String errorKey)
          compares a text value with another value
 boolean matches(java.lang.String regExp, java.lang.String errorKey)
           
 boolean notEmpty(java.lang.String errorKey)
           
 boolean notLongerThan(int maxLength, java.lang.String errorKey)
           
 void setPopupData(PopupData popupData)
          if set, a button will be placed to the right of the textelement.
 void setValue(java.lang.String value)
          Sets the value.
 void setValues(java.lang.String[] values)
          (non-Javadoc)
 
Methods inherited from class org.olat.core.gui.formelements.AbstractFormElement
clearError, getError, getExample, getLabelKey, getName, getVisualMarked, isError, isMandatory, isReadOnly, setError, setErrorKey, setErrorKeyWithParams, setExample, setLabelKey, setMandatory, setName, setReadOnly, setVisualMarked
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractTextElement

public AbstractTextElement()
Method Detail

getValue

public java.lang.String getValue()
Returns:
String

setValue

public void setValue(java.lang.String value)
Sets the value. if null is given, an empty string is assumed.

Parameters:
value - The value to set

notEmpty

public boolean notEmpty(java.lang.String errorKey)
Parameters:
errorKey -
Returns:

notLongerThan

public boolean notLongerThan(int maxLength,
                             java.lang.String errorKey)
Parameters:
maxLength -
errorKey -
Returns:

isEqual

public boolean isEqual(java.lang.String otherValue,
                       java.lang.String errorKey)
compares a text value with another value

Parameters:
otherValue -
errorKey -
Returns:
true if they are equal

isEmpty

public boolean isEmpty()
Check if the text element is empty

Returns:
boolean true if is empty, false otherwhise

isEmpty

public boolean isEmpty(java.lang.String errorKey)
Check if the text element is empty

Parameters:
errorKey -
Returns:
boolean true if is empty, false otherwhise

matches

public boolean matches(java.lang.String regExp,
                       java.lang.String errorKey)
Parameters:
regExp -
errorKey -
Returns:

setValues

public void setValues(java.lang.String[] values)
(non-Javadoc)

See Also:
FormElement.setValues(java.lang.String[])

isDirty

public boolean isDirty()
Returns:
See Also:
FormElement.isDirty()

getPopupData

public PopupData getPopupData()
Returns:

setPopupData

public void setPopupData(PopupData popupData)
if set, a button will be placed to the right of the textelement. the buttons labelKey, the command/action of the button, the id of the textelement, and the width and height of the popup window are determined by the attributes in popupData

Parameters:
popupData -