|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.riotfamily.forms.AbstractElement
org.riotfamily.forms.AbstractEditorBase
org.riotfamily.forms.CompositeElement
public abstract class CompositeElement
Abstract superclass for elements that consist of several child elements.
Calls to processRequest()
and render()
are
automatically delegated to the components. Additionally the components are
initialized, i.e. setParent()
, setForm()
and
Form.registerElement()
are called.
Field Summary |
---|
Fields inherited from class org.riotfamily.forms.AbstractElement |
---|
log |
Constructor Summary | |
---|---|
CompositeElement()
Empty default constructor. |
|
CompositeElement(List<? extends Element> components)
Empty default constructor. |
Method Summary | |
---|---|
protected void |
addComponent(Element element)
Adds the given element to the list of components. |
protected void |
afterFormSet()
Invokes initComponent(Element) on all components and
finally calls initCompositeElement() . |
void |
focus()
Delegates the call to the first component. |
protected List<Element> |
getComponents()
|
protected void |
initComponent(Element element)
Sets a reference to the form and registers the element by calling Form.registerElement(Element) . |
protected void |
initCompositeElement()
Subclasses may override this method to perform initialization tasks. |
boolean |
isCompositeElement()
Helper method to check for composite elements in templates. |
boolean |
isEmpty()
|
void |
processRequest(FormRequest request)
Calls processRequestInternal() and afterwards
processRequestComponents() to process the components. |
protected void |
processRequestCompontents(FormRequest request)
Processes the request for all the components |
protected void |
processRequestInternal(FormRequest request)
Called before processRequest() is invoked on the contained elements. |
protected void |
removeComponent(Element element)
Removes the given component. |
protected void |
renderInternal(PrintWriter writer)
|
void |
setBeanFactory(BeanFactory beanFactory)
|
Methods inherited from class org.riotfamily.forms.AbstractEditorBase |
---|
addChangeListener, afterBindingSet, fireChangeEvent, getEditorBinding, getFieldName, getHint, getLabel, getParamName, hasListeners, setEditorBinding, setFieldName, setParamName |
Methods inherited from class org.riotfamily.forms.AbstractElement |
---|
afterFormContextSet, getEventTriggerId, getForm, getFormContext, getFormListener, getId, getParent, getStyleClass, getSystemStyleClass, getWrapperStyleClass, isEnabled, isRequired, 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 |
Constructor Detail |
---|
public CompositeElement()
public CompositeElement(List<? extends Element> components)
Method Detail |
---|
public void setBeanFactory(BeanFactory beanFactory)
setBeanFactory
in interface BeanFactoryAware
protected List<Element> getComponents()
protected void addComponent(Element element)
initComponent(Element)
is
invoked, otherwise initialization is deferred until
AbstractElement.setForm(Form)
is called.
element
- the element to addprotected void removeComponent(Element element)
public boolean isEmpty()
protected final void afterFormSet()
initComponent(Element)
on all components and
finally calls initCompositeElement()
.
afterFormSet
in class AbstractElement
protected void initCompositeElement()
public void processRequest(FormRequest request)
processRequestInternal()
and afterwards
processRequestComponents()
to process the components.
processRequest
in interface Element
processRequest
in class AbstractElement
protected void processRequestCompontents(FormRequest request)
protected void initComponent(Element element)
Form.registerElement(Element)
.
IllegalStateException
- if form is nullprotected void processRequestInternal(FormRequest request)
protected void renderInternal(PrintWriter writer)
renderInternal
in class AbstractElement
public void focus()
focus
in interface Element
focus
in class AbstractElement
public boolean isCompositeElement()
true
isCompositeElement
in interface Element
isCompositeElement
in class AbstractElement
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |