org.riotfamily.forms
Interface Element

All Known Subinterfaces:
ContainerElement, ContentElement, DHTMLElement, Editor, SelectElement, ValueWrapperEditor
All Known Implementing Classes:
AbstractChooser, AbstractConditionalElement, AbstractEditorBase, AbstractElement, AbstractFileUpload, AbstractFileUpload.UploadElement, AbstractLocalizedElement, AbstractMultiSelectElement, AbstractResourceElement, AbstractSelectElement, AbstractSingleSelectElement, AbstractTextElement, AutocompleteTextField, Button, Calendar, Checkbox, CheckboxGroup, ColorPicker, CompositeElement, Container, ContentListEditor, ContentListItem, ContentMapEditor, EditableIfNew, ElementGroup, ElementGroup.ExpandButton, ElementSwitch, FileUpload, FileUpload.PreviewElement, ImageCheckbox, ImageCheckboxGroup, ImageRadioButtonGroup, ListEditor, ListItem, MapEditor, MapEditor.MapItem, MultiSelectBox, NestedForm, NumberField, ObjectChooser, PagePropertiesEditor, PagePropertyElement, PasswordField, RadioButtonGroup, RestrictedElement, SelectBox, SitePropertiesEditor, SitePropertyElement, SwitchCase, TemplateElement, Textarea, TextField, TinyMCE

public interface Element

Interface to be implemented by all form elements. If you want to create a new element you will most likely want to subclass one of the abstract base classes in the de.neteye.forms.element.support package.


Method Summary
 void focus()
          Focuses the element.
 String getEventTriggerId()
           
 Form getForm()
          Returns the form that contains the element.
 FormContext getFormContext()
          Returns the FormContext.
 String getId()
          Returns the previously assigned id.
 Element getParent()
          Returns the element's parent.
 String getStyleClass()
          Returns the elements style class.
 boolean isCompositeElement()
          Returns whether the element is composed of multiple widgets.
 boolean isEnabled()
          Returns whether the element will accept user input.
 boolean isRequired()
          Returns whether the element is mandatory and must be filled out by the user.
 boolean isVisible()
           
 void processRequest(FormRequest request)
          This method is invoked whenever a HTTP request needs to be processed.
 void render(PrintWriter writer)
          Renders the element to the given writer.
 void setEnabled(boolean enabled)
          Enables (or disables) the element.
 void setForm(Form form)
          Sets a reference to the form that contains the element.
 void setFormContext(FormContext formContext)
          Sets the FormContext.
 void setId(String id)
          Sets the element's unique id.
 void setParent(Element parent)
          Sets the element's parent.
 void setRequired(boolean required)
          Sets whether the element is required.
 

Method Detail

setId

void setId(String id)
Sets the element's unique id. Ids are assigned when an element is registered with a form.

See Also:
Form.registerElement(Element)

getId

String getId()
Returns the previously assigned id.


getEventTriggerId

String getEventTriggerId()

setForm

void setForm(Form form)
Sets a reference to the form that contains the element.


getForm

Form getForm()
Returns the form that contains the element.


setFormContext

void setFormContext(FormContext formContext)
Sets the FormContext. Invoked by Form.registerElement(Element) or Form.setFormContext(FormContext).


getFormContext

FormContext getFormContext()
Returns the FormContext.


setParent

void setParent(Element parent)
Sets the element's parent. E.g. the parent element is taken into account to determine the enabled state of the element.


getParent

Element getParent()
Returns the element's parent.


processRequest

void processRequest(FormRequest request)
This method is invoked whenever a HTTP request needs to be processed. Elements may implement this method to change their internal state according to parameters found in the request.


render

void render(PrintWriter writer)
Renders the element to the given writer.


getStyleClass

String getStyleClass()
Returns the elements style class.


focus

void focus()
Focuses the element.


isEnabled

boolean isEnabled()
Returns whether the element will accept user input. The state should be considered during rendering, i.e. disabled elements should look different than enabled ones.


setEnabled

void setEnabled(boolean enabled)
Enables (or disables) the element.


isRequired

boolean isRequired()
Returns whether the element is mandatory and must be filled out by the user.


setRequired

void setRequired(boolean required)
Sets whether the element is required.


isVisible

boolean isVisible()

isCompositeElement

boolean isCompositeElement()
Returns whether the element is composed of multiple widgets. The information may be used by templates to render composite elements in the same style as element groups or nested forms.