org.odftoolkit.simple.form
Interface FormContainer

All Known Implementing Classes:
AbstractFormContainer, TextDocument

public interface FormContainer

FormContainer is a container which maintains Form(s) as element(s).

Since:
0.8

Method Summary
 Form createForm(String name)
          create and add a form into this container.
 boolean getApplyDesignMode()
          Get the attribute form:apply-design-mode which specifies whether forms are presented in editable or non-editable state.
 boolean getAutomaticFocus()
          Get the attribute form:automatic-focus which specifies whether the consumer loading the document should set the focus to a form control.
 Form getFormByName(String name)
          Return a form whose name is a given value.
 OfficeFormsElement getFormContainerElement()
          Get the ODF element OfficeFormsElement which can have FormFormElement as child element directly according to ODF specification.
 Iterator<Form> getFormIterator()
          Get an iterator to traverse each form in this container.
 boolean removeForm(Form form)
          Remove the form and its binding shape.
 void setApplyDesignMode(boolean isDesignMode)
          Set the attribute form:apply-design-mode which specifies whether forms are presented in editable or non-editable state.
 void setAutomaticFocus(boolean isAutoFocus)
          Set the attribute form:automatic-focus which specifies whether the consumer loading the document should set the focus to a form control.
 

Method Detail

getFormContainerElement

OfficeFormsElement getFormContainerElement()
Get the ODF element OfficeFormsElement which can have FormFormElement as child element directly according to ODF specification. This element will help to find the position to insert a new FormFormElement element.

Returns:
the element of office:forms

createForm

Form createForm(String name)
create and add a form into this container.

Parameters:
name - - form name, represents attribute form:name
Returns:
an instance of Form

removeForm

boolean removeForm(Form form)
Remove the form and its binding shape.

Parameters:
form - - the form to be removed
Returns:
true if the form is removed successfully, false if errors happen.

getFormByName

Form getFormByName(String name)
Return a form whose name is a given value.

Parameters:
name - - the name of the form
Returns:
a form whose name is a given value

getFormIterator

Iterator<Form> getFormIterator()
Get an iterator to traverse each form in this container.

Returns:
form iterator

getApplyDesignMode

boolean getApplyDesignMode()
Get the attribute form:apply-design-mode which specifies whether forms are presented in editable or non-editable state.

Returns:
true if forms in document are presented in editable state;false if forms in document are presented in completed state

getAutomaticFocus

boolean getAutomaticFocus()
Get the attribute form:automatic-focus which specifies whether the consumer loading the document should set the focus to a form control.

Returns:
true if sets the focus to a form control after loading the document; false if else.

setApplyDesignMode

void setApplyDesignMode(boolean isDesignMode)
Set the attribute form:apply-design-mode which specifies whether forms are presented in editable or non-editable state.

Parameters:
isDesignMode - - true if forms in document are presented in editable state; false if forms in document are presented in completed state

setAutomaticFocus

void setAutomaticFocus(boolean isAutoFocus)
Set the attribute form:automatic-focus which specifies whether the consumer loading the document should set the focus to a form control.

Parameters:
isAutoFocus - -true if sets the focus to a form control after loading the document; false if else.


Copyright © 2010-2017 The Apache Software Foundation. All Rights Reserved.