Class FormsReader
- java.lang.Object
-
- writer2latex.office.FormsReader
-
public class FormsReader extends java.lang.ObjectThis class reads the collection of all forms in an OOo document (the
office:formselement).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:controlelements 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 Constructor Description FormsReader()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddControl(ControlReader control)Add a controljava.lang.StringgetAttribute(java.lang.String sName)Get an attribute of the forms.ControlReadergetControl(java.lang.String sId)Get a control by idjava.util.Iterator<ControlReader>getControlsIterator()Get aIteratorover all controls.FormReadergetForm(java.lang.String sName)Get a form by namejava.util.Iterator<FormReader>getFormsIterator()Get aIteratorover all forms.voidread(org.w3c.dom.Element formsElement)Read the content of anoffice:formselement
-
-
-
Method Detail
-
read
public void read(org.w3c.dom.Element formsElement)
Read the content of an
office:formselement- Parameters:
formsElement- a DOM element, which must beoffice:formsnode
-
getAttribute
public java.lang.String getAttribute(java.lang.String sName)
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
public java.util.Iterator<FormReader> getFormsIterator()
Get a
Iteratorover all forms.- Returns:
- a
Iteratorover all forms
-
getForm
public FormReader getForm(java.lang.String sName)
Get a form by name
- Parameters:
sName- theform:nameof the form- Returns:
- the form as a
FormReaderobject
-
getControlsIterator
public java.util.Iterator<ControlReader> getControlsIterator()
Get a
Iteratorover all controls.- Returns:
- a
Iteratorover all controls
-
getControl
public ControlReader getControl(java.lang.String sId)
Get a control by id
- Parameters:
sId- theform:control-idof the control- Returns:
- the control as a
ControlReaderobject
-
addControl
protected void addControl(ControlReader control)
Add a control
- Parameters:
control- aControlReaderrepresenting the control
-
-