org.riotfamily.forms.element
Class AbstractConditionalElement

java.lang.Object
  extended by org.riotfamily.forms.AbstractElement
      extended by org.riotfamily.forms.element.AbstractConditionalElement
All Implemented Interfaces:
ContainerElement, Element
Direct Known Subclasses:
EditableIfNew, RestrictedElement

public abstract class AbstractConditionalElement
extends AbstractElement
implements ContainerElement


Field Summary
 
Fields inherited from class org.riotfamily.forms.AbstractElement
log
 
Constructor Summary
AbstractConditionalElement()
           
 
Method Summary
 void addElement(Element element)
          Implementation of the ContainerElement interface.
protected  void afterFormSet()
           
protected  Editor getEditor()
           
 List<Element> getElements()
           
 String getLabel()
           
 String getStyleClass()
          Returns the elements style class.
 boolean isCompositeElement()
          Returns whether the element is composed of multiple widgets.
protected abstract  boolean isEditable()
           
 boolean isRequired()
          Returns whether the element is mandatory and must be filled out by the user.
 void processRequest(FormRequest request)
          Subclasses may override this method to change their internal state according the given request.
 void removeElement(Element element)
           
protected  void renderInternal(PrintWriter writer)
           
 void setEditor(Editor editor)
           
 void setHide(boolean hide)
          Sets whether the editor should be hidden if the form is not new.
 
Methods inherited from class org.riotfamily.forms.AbstractElement
afterFormContextSet, focus, getEventTriggerId, getForm, getFormContext, getFormListener, getHint, getId, getParent, getSystemStyleClass, getWrapperStyleClass, isEnabled, isVisible, render, render, setEnabled, setForm, setFormContext, setHint, setId, setInline, setLabel, setParent, setReadOnly, setRequired, setStyleClass, setVisible, setWrap
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.riotfamily.forms.Element
focus, getEventTriggerId, getForm, getFormContext, getId, getParent, isEnabled, isVisible, render, setEnabled, setForm, setFormContext, setId, setParent, setRequired
 

Constructor Detail

AbstractConditionalElement

public AbstractConditionalElement()
Method Detail

afterFormSet

protected void afterFormSet()
Overrides:
afterFormSet in class AbstractElement

setEditor

public void setEditor(Editor editor)

getEditor

protected Editor getEditor()

setHide

public void setHide(boolean hide)
Sets whether the editor should be hidden if the form is not new.


addElement

public void addElement(Element element)
Implementation of the ContainerElement interface. This allows us to specify the editor as nested node in the XML configuration.

Specified by:
addElement in interface ContainerElement
See Also:
XmlEditorRepositoryDigester, ContainerElement.addElement(Element)

removeElement

public void removeElement(Element element)
Specified by:
removeElement in interface ContainerElement

getElements

public List<Element> getElements()
Specified by:
getElements in interface ContainerElement

processRequest

public void processRequest(FormRequest request)
Description copied from class: AbstractElement
Subclasses may override this method to change their internal state according the given request.

Specified by:
processRequest in interface Element
Overrides:
processRequest in class AbstractElement

getLabel

public String getLabel()
Overrides:
getLabel in class AbstractElement

isRequired

public boolean isRequired()
Description copied from class: AbstractElement
Returns whether the element is mandatory and must be filled out by the user.

Specified by:
isRequired in interface Element
Overrides:
isRequired in class AbstractElement

renderInternal

protected void renderInternal(PrintWriter writer)
Specified by:
renderInternal in class AbstractElement

getStyleClass

public String getStyleClass()
Description copied from interface: Element
Returns the elements style class.

Specified by:
getStyleClass in interface Element
Overrides:
getStyleClass in class AbstractElement

isCompositeElement

public boolean isCompositeElement()
Description copied from interface: Element
Returns whether the element is composed of multiple widgets. The information may be used by templates to render composite elements in the same style as element groups or nested forms.

Specified by:
isCompositeElement in interface Element
Overrides:
isCompositeElement in class AbstractElement

isEditable

protected abstract boolean isEditable()