writer2latex.office
Class FormsReader

java.lang.Object
  extended by writer2latex.office.FormsReader

public class FormsReader
extends java.lang.Object

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
FormsReader()
           
 
Method Summary
protected  void addControl(ControlReader control)
          Add a control
 java.lang.String getAttribute(java.lang.String sName)
          Get an attribute of the forms.
 ControlReader getControl(java.lang.String sId)
          Get a control by id
 java.util.Iterator getControlsIterator()
          Get a Iterator over all controls.
 FormReader getForm(java.lang.String sName)
          Get a form by name
 java.util.Iterator getFormsIterator()
          Get a Iterator over all forms.
 void read(org.w3c.dom.Element formsElement)
          Read the content of an office:forms element
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FormsReader

public FormsReader()
Method Detail

read

public void read(org.w3c.dom.Element formsElement)

Read the content of an office:forms element

Parameters:
formsElement - a DOM element, which must be office:forms node

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 getFormsIterator()

Get a Iterator over all forms.

Returns:
a Iterator over all forms

getForm

public FormReader getForm(java.lang.String sName)

Get a form by name

Parameters:
sName - the form:name of the form
Returns:
the form as a FormReader object

getControlsIterator

public java.util.Iterator getControlsIterator()

Get a Iterator over all controls.

Returns:
a Iterator over all controls

getControl

public ControlReader getControl(java.lang.String sId)

Get a control by id

Parameters:
sId - the form:control-id of the control
Returns:
the control as a ControlReader object

addControl

protected void addControl(ControlReader control)

Add a control

Parameters:
control - a ControlReader representing the control