|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.olat.user.AbstractUserPropertyHandler
de.bps.olat.user.propertyhandlers.GenericCheckboxPropertyHandler
public class GenericCheckboxPropertyHandler
Description: Checkbox property handler.
Initial Date: 06.08.2008
| Constructor Summary | |
|---|---|
GenericCheckboxPropertyHandler()
|
|
| Method Summary | |
|---|---|
FormItem |
addFormItem(java.util.Locale locale,
User user,
java.lang.String usageIdentifyer,
boolean isAdministrativeUser,
FormItemContainer formItemContainer)
Adds a flexi-form Item for this UserPropertyHandler. |
FormElement |
getFormElement(java.util.Locale locale,
User user,
java.lang.String usageIdentifyer,
boolean isAdministrativeUser)
Create a (non-flexi) form element for this UserPropertyHandler. |
java.lang.String |
getStringValue(FormElement ui)
Get the value from this form element formatted as string. |
java.lang.String |
getStringValue(FormItem formItem)
Get the value from this form item formatted as string. |
java.lang.String |
getStringValue(java.lang.String displayValue,
java.util.Locale locale)
Get the value from this GUI formatted string The returned value is formatted in a way it can be stored in the database, thus it might not be the right value to display to a user. |
boolean |
isValid(FormElement ui,
java.util.Map formContext)
Check if this form is valid |
boolean |
isValid(FormItem formItem,
java.util.Map formContext)
Checks if a form item for a property has a valid value and sets the appropriate error key if necessary. |
boolean |
isValidValue(java.lang.String value,
ValidationError validationError,
java.util.Locale locale)
Checks if the given value is a valid value for this property (e.g. |
void |
updateFormElementFromUser(FormElement ui,
User user)
Put the current value from this UserPropertyHandler into the given form element |
void |
updateUserFromFormElement(User user,
FormElement ui)
Reads the value of the given form element and updates the user |
void |
updateUserFromFormItem(User user,
FormItem formItem)
Reads the value of the given form item and updates the user |
| Methods inherited from class org.olat.user.AbstractUserPropertyHandler |
|---|
getColumnDescriptor, getGroup, getName, getUserProperty, getUserPropertyAsHTML, i18nColumnDescriptorLabelKey, i18nFormElementGroupKey, i18nFormElementLabelKey, isDeletable, setDeletable, setGroup, setName, setUserProperty, toString |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public GenericCheckboxPropertyHandler()
| Method Detail |
|---|
public FormItem addFormItem(java.util.Locale locale,
User user,
java.lang.String usageIdentifyer,
boolean isAdministrativeUser,
FormItemContainer formItemContainer)
UserPropertyHandler
locale - The current users localeuser - The user containing data to be prefilled or NULL if it should
be left emptyusageIdentifyer - The identifyer of the form where this form element
is usedisAdministrativeUser - true: Form element will be set to
administrative mode. false: the element is set to user mode. In
some cases the field is then read-onlyformItemContainer - Container to which Form Item has to be added
UserPropertyHandler.addFormItem(java.util.Locale, org.olat.core.id.User, java.lang.String, boolean, org.olat.core.gui.components.form.flexible.FormItemContainer)
public FormElement getFormElement(java.util.Locale locale,
User user,
java.lang.String usageIdentifyer,
boolean isAdministrativeUser)
UserPropertyHandler
locale - The current users localeuser - The user containing data to be prefilled or NULL if it should
be left emptyusageIdentifyer - The identifyer of the form where this form element
is usedisAdministrativeUser - true: Form element will be set to
administrative mode. false: the element is set to user mode. In
some cases the field is then read-only
UserPropertyHandler.getFormElement(java.util.Locale, org.olat.core.id.User, java.lang.String, boolean)public java.lang.String getStringValue(FormElement ui)
UserPropertyHandler
UserPropertyHandler.getStringValue(org.olat.core.gui.formelements.FormElement)public java.lang.String getStringValue(FormItem formItem)
UserPropertyHandler
UserPropertyHandler.getStringValue(org.olat.core.gui.components.form.flexible.FormItem)
public java.lang.String getStringValue(java.lang.String displayValue,
java.util.Locale locale)
UserPropertyHandler
locale - The locale to be used to parse the display value
UserPropertyHandler.getStringValue(java.lang.String, java.util.Locale)
public boolean isValid(FormElement ui,
java.util.Map formContext)
UserPropertyHandler
ui - The form element previously created with the getFormElement
methodformContext - Map containing some variables used in this form context,
e.g. for cross form value checks. NULL to not use any form context
variables
UserPropertyHandler.isValid(org.olat.core.gui.formelements.FormElement, java.util.Map)
public boolean isValid(FormItem formItem,
java.util.Map formContext)
UserPropertyHandlerUserPropertyHandler.isValidValue(String, ValidationError, Locale)
since it takes the value of the form item associated with this user
property into account. Do all validations which depend on a form item here.
formItem - The flexi form item previously created with the addFormItem
methodformContext - Map containing some variables used in this form context,
e.g. for cross form value checks. NULL to not use any form context
variables
UserPropertyHandler.isValid(org.olat.core.gui.components.form.flexible.FormItem, java.util.Map)
public boolean isValidValue(java.lang.String value,
ValidationError validationError,
java.util.Locale locale)
UserPropertyHandlerUserPropertyHandler.isValid(FormItem, Map), so all validations
which do not depend on a form item can be done here.
value - The value to be checkedvalidationError - Callback to get the error key in case of
validation=false
UserPropertyHandler.isValidValue(java.lang.String, org.olat.core.gui.components.form.ValidationError, java.util.Locale)
public void updateFormElementFromUser(FormElement ui,
User user)
UserPropertyHandler
ui - The form element previously created with the getFormElement
methoduser - The user that contains the dataUserPropertyHandler.updateFormElementFromUser(org.olat.core.gui.formelements.FormElement, org.olat.core.id.User)
public void updateUserFromFormElement(User user,
FormElement ui)
UserPropertyHandler
user - The user to be updatedui - The form element previously created with the getFormElement
methodUserPropertyHandler.updateUserFromFormElement(org.olat.core.id.User, org.olat.core.gui.formelements.FormElement)
public void updateUserFromFormItem(User user,
FormItem formItem)
UserPropertyHandler
user - The user to be updatedformItem - The form item previously created with the addFormItem
methodUserPropertyHandler.updateUserFromFormItem(org.olat.core.id.User, org.olat.core.gui.components.form.flexible.FormItem)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||