org.odftoolkit.simple.form
Class AbstractFormContainer

java.lang.Object
  extended by org.odftoolkit.simple.form.AbstractFormContainer
All Implemented Interfaces:
FormContainer

public abstract class AbstractFormContainer
extends Object
implements FormContainer

AbstractFormContainer is an abstract implementation of the FormContainer interface, with a default implementation for every method defined in FormContainer, except getFormContainerElement(). A subclass must implement the abstract method getFormContainerElement().

Since:
0.8

Constructor Summary
AbstractFormContainer()
           
 
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.
abstract  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.
 FormProvider getProvider()
          Get the form provider of 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.
 void setProvider(FormProvider provider)
          Set the form provider of this container.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractFormContainer

public AbstractFormContainer()
Method Detail

getFormContainerElement

public abstract OfficeFormsElement getFormContainerElement()
Description copied from interface: FormContainer
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.

Specified by:
getFormContainerElement in interface FormContainer
Returns:
the element of office:forms

createForm

public Form createForm(String name)
Description copied from interface: FormContainer
create and add a form into this container.

Specified by:
createForm in interface FormContainer
Parameters:
name - - form name, represents attribute form:name
Returns:
an instance of Form

removeForm

public boolean removeForm(Form form)
Description copied from interface: FormContainer
Remove the form and its binding shape.

Specified by:
removeForm in interface FormContainer
Parameters:
form - - the form to be removed
Returns:
true if the form is removed successfully, false if errors happen.

getFormByName

public Form getFormByName(String name)
Description copied from interface: FormContainer
Return a form whose name is a given value.

Specified by:
getFormByName in interface FormContainer
Parameters:
name - - the name of the form
Returns:
a form whose name is a given value

getFormIterator

public Iterator<Form> getFormIterator()
Description copied from interface: FormContainer
Get an iterator to traverse each form in this container.

Specified by:
getFormIterator in interface FormContainer
Returns:
form iterator

getApplyDesignMode

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

Specified by:
getApplyDesignMode in interface FormContainer
Returns:
true if forms in document are presented in editable state;false if forms in document are presented in completed state

getAutomaticFocus

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

Specified by:
getAutomaticFocus in interface FormContainer
Returns:
true if sets the focus to a form control after loading the document; false if else.

setApplyDesignMode

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

Specified by:
setApplyDesignMode in interface FormContainer
Parameters:
isDesignMode - - true if forms in document are presented in editable state; false if forms in document are presented in completed state

setAutomaticFocus

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

Specified by:
setAutomaticFocus in interface FormContainer
Parameters:
isAutoFocus - -true if sets the focus to a form control after loading the document; false if else.

setProvider

public void setProvider(FormProvider provider)
Set the form provider of this container.

Parameters:
provider - - which is used to instantiate a form

getProvider

public FormProvider getProvider()
Get the form provider of this container.

Returns:
provider - a default provider followed by OO definition will be created if users don't appointed one.


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