public class GenericCheckboxPropertyHandler extends AbstractUserPropertyHandler
Initial Date: 06.08.2008
限定符和类型 | 方法和说明 |
---|---|
FormItem |
addFormItem(java.util.Locale locale,
User user,
java.lang.String usageIdentifyer,
boolean isAdministrativeUser,
FormItemContainer formItemContainer)
org.olat.presentation.framework.components.form.flexible.FormItemContainer)
|
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. syntax checking).
|
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
|
getColumnDescriptor, getGroup, getName, getUserProperty, getUserPropertyAsHTML, i18nColumnDescriptorLabelKey, i18nFormElementGroupKey, i18nFormElementLabelKey, isDeletable, setDeletable, setGroup, setName, setUserProperty, toString
public FormItem addFormItem(java.util.Locale locale, User user, java.lang.String usageIdentifyer, boolean isAdministrativeUser, FormItemContainer formItemContainer)
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 addedpublic 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-onlypublic java.lang.String getStringValue(FormElement ui)
UserPropertyHandler
public java.lang.String getStringValue(FormItem formItem)
UserPropertyHandler
public java.lang.String getStringValue(java.lang.String displayValue, java.util.Locale locale)
UserPropertyHandler
locale
- The locale to be used to parse the display valuepublic 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 variablespublic boolean isValid(FormItem formItem, java.util.Map formContext)
UserPropertyHandler
UserPropertyHandler.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 variablespublic boolean isValidValue(java.lang.String value, ValidationError validationError, java.util.Locale locale)
UserPropertyHandler
UserPropertyHandler.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=falsepublic void updateFormElementFromUser(FormElement ui, User user)
UserPropertyHandler
ui
- The form element previously created with the getFormElement methoduser
- The user that contains the datapublic void updateUserFromFormElement(User user, FormElement ui)
UserPropertyHandler
user
- The user to be updatedui
- The form element previously created with the getFormElement methodpublic void updateUserFromFormItem(User user, FormItem formItem)
UserPropertyHandler
user
- The user to be updatedformItem
- The form item previously created with the addFormItem method