Class FormsReader
This class reads the collection of all forms in an OOo document
(the office:forms element).
An OOo document may contain any number of forms; these are declared
within this element. In OOo, unlike eg. html, the form declaration is
separated from the presentation. This element contains the
declaration. The presentation is given by inclusion of
draw:control elements in the document flow. These refer to form
controls by id.
Note: A form is identified by a unique name, a control is identified by a (globally) unique id.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddControl(ControlReader control) Add a controlgetAttribute(String sName) Get an attribute of the forms.getControl(String sId) Get a control by idGet aIteratorover all controls.Get a form by nameGet aIteratorover all forms.voidRead the content of anoffice:formselement
-
Constructor Details
-
FormsReader
public FormsReader()
-
-
Method Details
-
read
Read the content of an
office:formselement- Parameters:
formsElement- a DOM element, which must beoffice:formsnode
-
getAttribute
Get an attribute of the forms. If the attribute does not exist, this method returns
null.- Parameters:
sName- the name of the attribute- Returns:
- the value of the attribute, or
null
-
getFormsIterator
Get a
Iteratorover all forms.- Returns:
- a
Iteratorover all forms
-
getForm
Get a form by name
- Parameters:
sName- theform:nameof the form- Returns:
- the form as a
FormReaderobject
-
getControlsIterator
Get a
Iteratorover all controls.- Returns:
- a
Iteratorover all controls
-
getControl
Get a control by id
- Parameters:
sId- theform:control-idof the control- Returns:
- the control as a
ControlReaderobject
-
addControl
Add a control
- Parameters:
control- aControlReaderrepresenting the control
-