| org.outerj.daisy.frontend.editor.FieldEditor
All known Subclasses: org.outerj.daisy.frontend.editor.AbstractFieldEditor,
FieldEditor | public interface FieldEditor (Code) | | Interface for field editors, that is, editors for Daisy document fields
on the "fields" page of the document editor.
|
Method Summary | |
void | generateFormDefinitionFragment(ContentHandler contentHandler, Locale locale) Generate a piece of CForm definition XML, to be embedded in a larger form definition.
This should not geenrate start and end document events.
The generated form definition XML is inserted within a container widget with
a unique name, so the field editor does not have to bother about producing
a unique name.
The produced form definition fragment should be 'stable', that is, always
produce the same result for the same FieldTypeUse, and not depend on factors
such as 'time of the day'. | void | generateFormTemplateFragment(ContentHandler contentHandler, Locale locale) Generate a piece of JX-based CForms template for this field. | FieldTypeUse | getFieldTypeUse() Returns the FieldTypeUse for which this FieldEditor serves. | boolean | hasValue(Widget widget) Returns true if this field has a value (used for field-requiredness validation). | void | init(Widget parentWidget, FieldEditorContext fieldEditorContext) Allows to perform initialisation of the field editor.
Parameters: parentWidget - the widget within which the form definition fragmentproduced by FieldEditor.generateFormDefinitionFragmentis inserted. | void | load(Document document) Loads the field value from the document. | void | setValidationError(ValidationError error) This method is called to set the validation error in case this field
is required but does not have a value yet. | void | store(Document document) Stores the field value to the document. |
generateFormDefinitionFragment | void generateFormDefinitionFragment(ContentHandler contentHandler, Locale locale) throws Exception(Code) | | Generate a piece of CForm definition XML, to be embedded in a larger form definition.
This should not geenrate start and end document events.
The generated form definition XML is inserted within a container widget with
a unique name, so the field editor does not have to bother about producing
a unique name.
The produced form definition fragment should be 'stable', that is, always
produce the same result for the same FieldTypeUse, and not depend on factors
such as 'time of the day'. This is because the form definitions are cached
and shared between multiple for instances and users.
|
generateFormTemplateFragment | void generateFormTemplateFragment(ContentHandler contentHandler, Locale locale) throws Exception(Code) | | Generate a piece of JX-based CForms template for this field.
This should not generate start and end document events.
The remark about stability of the {#generateFormDefinitionFragment} also applies here.
|
getFieldTypeUse | FieldTypeUse getFieldTypeUse()(Code) | | Returns the FieldTypeUse for which this FieldEditor serves.
|
hasValue | boolean hasValue(Widget widget)(Code) | | Returns true if this field has a value (used for field-requiredness validation).
|
init | void init(Widget parentWidget, FieldEditorContext fieldEditorContext)(Code) | | Allows to perform initialisation of the field editor.
Parameters: parentWidget - the widget within which the form definition fragmentproduced by FieldEditor.generateFormDefinitionFragmentis inserted. So if you generated a widget withID "foo", it can be accessed using parentWidget.getChild("foo"). Parameters: fieldEditorContext - provides access to the (current users') Repository object,among other things. |
load | void load(Document document) throws Exception(Code) | | Loads the field value from the document. This method is only called
if the document actually has a value for the field, so it is safe
to assume document.getField() returns non-null when used for the
field type for which this editor serves.
|
setValidationError | void setValidationError(ValidationError error)(Code) | | This method is called to set the validation error in case this field
is required but does not have a value yet.
Note that the requiredness-validation only happens after the individual
field editors have been successfully validated, so this will not conflict
with any validation the field editor does itself.
|
store | void store(Document document) throws Exception(Code) | | Stores the field value to the document. If the field has
no value but it is present in the document, it is the
responsibility of the field editor implementation to delete the field
from the document.
|
|
|