org.olat.core.gui.components.form.flexible.impl
Class FormLayoutContainer

java.lang.Object
  extended by org.olat.core.gui.components.form.flexible.impl.FormItemImpl
      extended by org.olat.core.gui.components.form.flexible.impl.FormLayoutContainer
All Implemented Interfaces:
InlineElement, FormBaseComponentIdProvider, FormItem, FormItemContainer, FormLayouter, Disposable

public class FormLayoutContainer
extends FormItemImpl
implements FormItemContainer, FormLayouter, Disposable

Description:
TODO: patrickb Class Description for FormVelocityContainer

Initial Date: 22.11.2006

Author:
patrickb

Field Summary
 
Fields inherited from interface org.olat.core.gui.components.form.flexible.FormItem
ERRORC, EXAMPLEC, LABELC
 
Fields inherited from interface org.olat.core.gui.components.form.flexible.FormBaseComponentIdProvider
DISPPREFIX
 
Method Summary
 void add(FormItem formComp)
          add a formelement or container by adding subcomponents name_LABEL name_ERROR name_EXAMPLE
 void add(java.lang.String name, java.util.Collection<FormItem> foItems)
           
 void add(java.lang.String name, FormItem formComp)
          add with different name
 void addDependencyRule(FormItemDependencyRule depRule)
          add a dependency rule between a form item source and typically one or more form item targets.
 void contextPut(java.lang.String key, java.lang.Object value)
          add a variable which can be accessed within the form layout
 void contextRemove(java.lang.String key)
           
static FormLayoutContainer createButtonLayout(java.lang.String name, Translator formTranslator)
          Create a layout container that should be only used to render buttons using a b_button_group css wrapper.
static FormLayoutContainer createCustomFormLayout(java.lang.String name, Translator formTranslator, java.lang.String page)
           
static FormLayoutContainer createDefaultFormLayout(java.lang.String name, Translator formTranslator)
          Create a default layout container with the standard label - element alignment.
static FormLayoutContainer createHorizontalFormLayout(java.lang.String name, Translator formTranslator)
          Create a layout container that renders the form elements and its labels vertically.
static FormLayouter createSelbox(java.lang.String name, Translator formTranslator)
          workaround FIXME:pb
static FormLayoutContainer createVerticalFormLayout(java.lang.String name, Translator formTranslator)
          Create a layout container that renders the form elements and its labels vertically.
 void dispose()
          Dispose all child elements from this container
 void evalDependencyRuleSetFor(UserRequest ureq, FormItem dispatchFormItem)
           
 void evalFormRequest(UserRequest ureq)
          gets called if the implementing component is part of a form which gets partly submitted -> extract data for you and store it temporarly for redisplay without a validation
 Component getComponent(java.lang.String name)
           
 FormItem getFormComponent(java.lang.String name)
           
 java.util.Map<java.lang.String,FormItem> getFormComponents()
          the form components managed by this container
 void put(java.lang.String name, Component component)
          add a component named name to the form layout
 void register(FormItem formComp)
          register only, does not addsubcomponents, does not expose formItem in the velocity.
 void remove(Component component)
          removes a component from the container.
 void remove(FormItem toBeRemoved)
          remove the component from this container
 void remove(java.lang.String formCompName)
          remove the component with the give name from this container
 void replace(FormItem toBeReplaced, FormItem with)
           
 void reset()
          reset the data in the field to a initial/predefined value.
 void setDirty(boolean dirty)
          mark formlayouter as dirty, e.g.
 void setEnabled(boolean isEnabled)
          item is enabled/disabled, e.g.
 void setTranslator(Translator translator)
           
 void validate(java.util.List validationResults)
          validate the data in the field, create error messages or update any component.
 
Methods inherited from class org.olat.core.gui.components.form.flexible.impl.FormItemImpl
addActionListener, clearError, doDispatchFormRequest, getAction, getActionListenersFor, getComponent, getEmptyDisplayText, getErrorC, getErrorText, getExampleC, getExampleText, getFormDispatchId, getLabelC, getLabelText, getName, getRootForm, getTranslator, getUserObject, hasError, hasExample, hasFocus, hasLabel, isEnabled, isInlineEditingOn, isMandatory, isVisible, setEmptyDisplayText, setErrorComponent, setErrorKey, setExampleKey, setFocus, setLabel, setLabelComponent, setMandatory, setRootForm, setUserObject, setVisible, showError, showExample, showLabel, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.olat.core.gui.components.form.flexible.FormItemContainer
setRootForm
 
Methods inherited from interface org.olat.core.gui.components.form.flexible.FormItem
addActionListener, clearError, doDispatchFormRequest, getAction, getActionListenersFor, getComponent, getErrorC, getErrorText, getExampleC, getExampleText, getLabelC, getLabelText, getName, getRootForm, getTranslator, getUserObject, hasError, hasExample, hasFocus, hasLabel, isEnabled, isMandatory, isVisible, setErrorComponent, setErrorKey, setExampleKey, setFocus, setLabel, setLabelComponent, setMandatory, setUserObject, setVisible, showError, showExample, showLabel
 
Methods inherited from interface org.olat.core.gui.components.form.flexible.FormBaseComponentIdProvider
getFormDispatchId
 
Methods inherited from interface org.olat.core.gui.components.form.flexible.FormLayouter
getComponent
 

Method Detail

evalFormRequest

public void evalFormRequest(UserRequest ureq)
Description copied from class: FormItemImpl
gets called if the implementing component is part of a form which gets partly submitted -> extract data for you and store it temporarly for redisplay without a validation

Specified by:
evalFormRequest in interface FormItem
Specified by:
evalFormRequest in class FormItemImpl
See Also:
org.olat.core.gui.components.form.flexible.FormComponent#rememberFormRequest(org.olat.core.gui.UserRequest, long[], int)

validate

public void validate(java.util.List validationResults)
Description copied from interface: FormItem
validate the data in the field, create error messages or update any component.

This method must be implemented by a specialised form item provider.

Specified by:
validate in interface FormItem
Specified by:
validate in class FormItemImpl
See Also:
org.olat.core.gui.components.form.flexible.FormComponent#validate(java.util.List)

reset

public void reset()
Description copied from interface: FormItem
reset the data in the field to a initial/predefined value. This method is called if in a form a reset request is issued. It is the counterpart to the validate call which

Specified by:
reset in interface FormItem
Specified by:
reset in class FormItemImpl
See Also:
FormItem.reset()

add

public void add(FormItem formComp)
Description copied from interface: FormItemContainer
add a formelement or container by adding subcomponents

Specified by:
add in interface FormItemContainer
See Also:
org.olat.core.gui.components.form.flexible.FormContainer#add(java.lang.String, org.olat.core.gui.components.form.flexible.FormComponentImpl)

add

public void add(java.lang.String name,
                FormItem formComp)
Description copied from interface: FormItemContainer
add with different name

Specified by:
add in interface FormItemContainer

add

public void add(java.lang.String name,
                java.util.Collection<FormItem> foItems)
Specified by:
add in interface FormItemContainer

register

public void register(FormItem formComp)
Description copied from interface: FormItemContainer
register only, does not addsubcomponents, does not expose formItem in the velocity. In 99% of the cases you should use an addXX method instead.

Specified by:
register in interface FormItemContainer
See Also:
FormItemContainer.register(org.olat.core.gui.components.form.flexible.FormItem)

remove

public void remove(FormItem toBeRemoved)
Description copied from interface: FormItemContainer
remove the component from this container

Specified by:
remove in interface FormItemContainer

replace

public void replace(FormItem toBeReplaced,
                    FormItem with)

remove

public void remove(java.lang.String formCompName)
remove the component with the give name from this container

Specified by:
remove in interface FormItemContainer
Parameters:
name -

getFormComponents

public java.util.Map<java.lang.String,FormItem> getFormComponents()
Description copied from interface: FormItemContainer
the form components managed by this container

Specified by:
getFormComponents in interface FormItemContainer
Returns:

getFormComponent

public FormItem getFormComponent(java.lang.String name)
Specified by:
getFormComponent in interface FormItemContainer
Returns:

contextPut

public void contextPut(java.lang.String key,
                       java.lang.Object value)
Description copied from interface: FormLayouter
add a variable which can be accessed within the form layout

Specified by:
contextPut in interface FormLayouter

contextRemove

public void contextRemove(java.lang.String key)

put

public void put(java.lang.String name,
                Component component)
Description copied from interface: FormLayouter
add a component named name to the form layout

Specified by:
put in interface FormLayouter

remove

public void remove(Component component)
Description copied from interface: FormLayouter
removes a component from the container.

Specified by:
remove in interface FormLayouter

getComponent

public Component getComponent(java.lang.String name)
Specified by:
getComponent in interface FormLayouter
Returns:
component named name

setDirty

public void setDirty(boolean dirty)
Description copied from interface: FormLayouter
mark formlayouter as dirty, e.g. gets rendered in next render process

Specified by:
setDirty in interface FormLayouter
See Also:
FormLayouter.setDirty(boolean)

addDependencyRule

public void addDependencyRule(FormItemDependencyRule depRule)
Description copied from interface: FormItemContainer
add a dependency rule between a form item source and typically one or more form item targets. See FormItemDependencyRule for more information.

Specified by:
addDependencyRule in interface FormItemContainer
See Also:
org.olat.core.gui.components.form.flexible.api.FormItemContainer#addDependencyRule(org.olat.core.gui.components.form.flexible.api.FormItemDependencyRule)

evalDependencyRuleSetFor

public void evalDependencyRuleSetFor(UserRequest ureq,
                                     FormItem dispatchFormItem)
Specified by:
evalDependencyRuleSetFor in interface FormItemContainer
See Also:
org.olat.core.gui.components.form.flexible.api.FormItemContainer#evalDependencyRuleSetFor(org.olat.core.gui.UserRequest, org.olat.core.gui.components.form.flexible.api.FormItem)

setEnabled

public void setEnabled(boolean isEnabled)
Description copied from interface: FormItem
item is enabled/disabled, e.g. editable/read only in contrast to setVisible this does NOT DISABLE label, example, error!

Specified by:
setEnabled in interface FormItem
Overrides:
setEnabled in class FormItemImpl
See Also:
org.olat.core.gui.components.form.flexible.FormItemImpl#setEnabled(boolean)

createDefaultFormLayout

public static FormLayoutContainer createDefaultFormLayout(java.lang.String name,
                                                          Translator formTranslator)
Create a default layout container with the standard label - element alignment.

Parameters:
name -
formTranslator -
Returns:

createHorizontalFormLayout

public static FormLayoutContainer createHorizontalFormLayout(java.lang.String name,
                                                             Translator formTranslator)
Create a layout container that renders the form elements and its labels vertically.

Parameters:
name -
formTranslator -
Returns:

createVerticalFormLayout

public static FormLayoutContainer createVerticalFormLayout(java.lang.String name,
                                                           Translator formTranslator)
Create a layout container that renders the form elements and its labels vertically. This means that the label of an element is forced to be on a separate line without any left indent.

Parameters:
name -
formTranslator -
Returns:

createButtonLayout

public static FormLayoutContainer createButtonLayout(java.lang.String name,
                                                     Translator formTranslator)
Create a layout container that should be only used to render buttons using a b_button_group css wrapper. Buttons are ususally rendered on one line without indent

Parameters:
name -
formTranslator -
Returns:

createSelbox

public static FormLayouter createSelbox(java.lang.String name,
                                        Translator formTranslator)
workaround FIXME:pb


createCustomFormLayout

public static FormLayoutContainer createCustomFormLayout(java.lang.String name,
                                                         Translator formTranslator,
                                                         java.lang.String page)
Parameters:
name -
formTranslator -
page -
Returns:

setTranslator

public void setTranslator(Translator translator)
Specified by:
setTranslator in interface FormItem
Overrides:
setTranslator in class FormItemImpl

dispose

public void dispose()
Dispose all child elements from this container

Specified by:
dispose in interface Disposable
See Also:
Disposable.dispose()