org.olat.core.gui.components.form.flexible.impl.elements
Class FormLinkImpl

java.lang.Object
  extended by org.olat.core.gui.components.form.flexible.impl.FormItemImpl
      extended by org.olat.core.gui.components.form.flexible.impl.elements.FormLinkImpl
All Implemented Interfaces:
FormLink, InlineElement, FormBaseComponentIdProvider, FormItem

public class FormLinkImpl
extends FormItemImpl
implements FormLink

Description:
Links / Buttons within the flexi form have to be form items. This implementation of the FormLink interface adapts the Link component from the GUI Framework to the flexi form substructure.

implementation note:
although a form link is created by new ... the corresponding Link creation is deferred until the root form is available. E.g. this is typically the case when the form link is added to a layout or form.

Initial Date: 10.12.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
 
Constructor Summary
FormLinkImpl(java.lang.String name)
          creates a form link with the given name which acts also as command, i18n and component name.
FormLinkImpl(java.lang.String name, java.lang.String i18n)
          creates a form link with a given name and a i18n key.
FormLinkImpl(java.lang.String name, java.lang.String cmd, java.lang.String i18n, int presentation)
          creates a form link with a different representation as they are defined by Link.BUTTON Link.BUTTON_SMALL Link.BUTTON_XSMALL Link.LINK_BACK etc.
 
Method Summary
 void dispatchFormRequest(UserRequest ureq)
          override to implement your behaviour
 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
 void reset()
          reset the data in the field to a initial/predefined value.
 void setCustomDisabledLinkCSS(java.lang.String customDisabledLinkCSS)
          Set the css that is used for the disabled link status
 void setCustomEnabledLinkCSS(java.lang.String customEnabledLinkCSS)
           
 void setI18nKey(java.lang.String i18n)
          Set the i18n key for the link text
 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, setEnabled, setErrorComponent, setErrorKey, setExampleKey, setFocus, setLabel, setLabelComponent, setMandatory, setRootForm, setTranslator, 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.FormItem
addActionListener, clearError, doDispatchFormRequest, getAction, getActionListenersFor, getComponent, getErrorC, getErrorText, getExampleC, getExampleText, getLabelC, getLabelText, getName, getRootForm, getTranslator, getUserObject, hasError, hasExample, hasFocus, hasLabel, isEnabled, isMandatory, isVisible, setEnabled, setErrorComponent, setErrorKey, setExampleKey, setFocus, setLabel, setLabelComponent, setMandatory, setRootForm, setTranslator, setUserObject, setVisible, showError, showExample, showLabel
 
Methods inherited from interface org.olat.core.gui.components.form.flexible.FormBaseComponentIdProvider
getFormDispatchId
 

Constructor Detail

FormLinkImpl

public FormLinkImpl(java.lang.String name)
creates a form link with the given name which acts also as command, i18n and component name.

Parameters:
name -

FormLinkImpl

public FormLinkImpl(java.lang.String name,
                    java.lang.String i18n)
creates a form link with a given name and a i18n key. The name is used also as component name and as command string.

Parameters:
name -
i18n -

FormLinkImpl

public FormLinkImpl(java.lang.String name,
                    java.lang.String cmd,
                    java.lang.String i18n,
                    int presentation)
creates a form link with a different representation as they are defined by Link.BUTTON Link.BUTTON_SMALL Link.BUTTON_XSMALL Link.LINK_BACK etc.

Parameters:
name -
cmd -
i18n -
presentation -
Method Detail

dispatchFormRequest

public void dispatchFormRequest(UserRequest ureq)
Description copied from class: FormItemImpl
override to implement your behaviour


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

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()

setCustomEnabledLinkCSS

public void setCustomEnabledLinkCSS(java.lang.String customEnabledLinkCSS)
Specified by:
setCustomEnabledLinkCSS in interface FormLink
Parameters:
customEnabledLinkCSS - The customEnabledLinkCSS to set.
See Also:
FormLink.setCustomEnabledLinkCSS(java.lang.String)

setCustomDisabledLinkCSS

public void setCustomDisabledLinkCSS(java.lang.String customDisabledLinkCSS)
Description copied from interface: FormLink
Set the css that is used for the disabled link status

Specified by:
setCustomDisabledLinkCSS in interface FormLink
See Also:
FormLink.setCustomDisabledLinkCSS(java.lang.String)

setI18nKey

public void setI18nKey(java.lang.String i18n)
Description copied from interface: FormLink
Set the i18n key for the link text

Specified by:
setI18nKey in interface FormLink
See Also:
FormLink.setI18nKey(java.lang.String)