org.odftoolkit.simple.form
Class OOForm

java.lang.Object
  extended by org.odftoolkit.simple.Component
      extended by org.odftoolkit.simple.form.OOForm
All Implemented Interfaces:
Form

public class OOForm
extends Component
implements Form

This class implements the interface of Form according to the implementation of OpenOffice.org.

Since:
0.8

Field Summary
protected  OfficeFormsElement mFormContainerElement
           
 
Method Summary
 Button createButton(ControlContainer parent, FrameRectangle rectangle, String name, String label)
          Create a button control in this form.
 FormControl createCheckBox(ControlContainer parent, FrameRectangle rectangle, String name, String label, String value)
          Create a check box in this form.
 FormControl createComboBox(ControlContainer parent, FrameRectangle rectangle, String name, String defaultText, boolean isDropDown)
          Create a combo box in this form.
 FormControl createCurrencyField(ControlContainer parent, FrameRectangle rectangle, String name, String defaultValue)
          Create a currency field in this form.
 FormControl createDateField(ControlContainer parent, FrameRectangle rectangle, String name, String defaultValue)
          Create a time field in this form.
 FormControl createLabel(ControlContainer parent, FrameRectangle rectangle, String name, String text)
          Create a label control in this form.
 FormControl createListBox(ControlContainer parent, FrameRectangle rectangle, String name, boolean isMultiSelection, boolean isDropDown)
          Create a list box in this form.
 FormControl createNumericField(ControlContainer parent, FrameRectangle rectangle, String name, String defaultValue)
          Create a numeric field in this form.
 FormControl createPatternField(ControlContainer parent, FrameRectangle rectangle, String name, String defaultValue)
          Create a pattern field in this form.
 FormControl createRadioButton(ControlContainer parent, FrameRectangle rectangle, String name, String label, String value)
          Create a radio button in this form.
 FormControl createTextBox(ControlContainer parent, FrameRectangle rectangle, String name, String defaultText, boolean isMultipleLine)
          Create a textbox in this form.
 FormControl createTimeField(ControlContainer parent, FrameRectangle rectangle, String name, String defaultValue)
          Create a time field in this form.
 String getCommand()
          Get the command to execute on a data source
 FormTypeDefinition.FormCommandType getCommandType()
          Get the type of command to execute on a data source
 String getControlImplementation()
          Get the implementation of the created control
 String getDataSource()
          Get the name of data source
 String getFormName()
          Get the form name
static Form getInstance(FormFormElement element)
          Get a form instance by an instance of FormFormElement.
 FormFormElement getOdfElement()
          Return the instance of OdfElement which presents this structure.
 Document getOwnerDocument()
          Get the owner document of this component
 void setCommand(String command)
          Set a command to execute on a data source
 void setCommandType(FormTypeDefinition.FormCommandType commandType)
          Set the type of command to execute on a data source.
 void setControlImplementation(String controlImpl)
          Set the implementation of the created control
 void setDataSource(String dataSource)
          Set the data source to be used by the form
 void setFormName(String name)
          Set the name of this form
 
Methods inherited from class org.odftoolkit.simple.Component
getComponentByElement, registerComponent, unregisterComponent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mFormContainerElement

protected OfficeFormsElement mFormContainerElement
Method Detail

getOwnerDocument

public Document getOwnerDocument()
Description copied from class: Component
Get the owner document of this component

Overrides:
getOwnerDocument in class Component
Returns:
- the owner document

getInstance

public static Form getInstance(FormFormElement element)
Get a form instance by an instance of FormFormElement.

Parameters:
element -
Returns:

createButton

public Button createButton(ControlContainer parent,
                           FrameRectangle rectangle,
                           String name,
                           String label)
Description copied from interface: Form
Create a button control in this form.

Specified by:
createButton in interface Form
Parameters:
parent - - the element that contains this form control
rectangle - - the bounding rectangle used by this button
name - - the name of the control
label - - the text label of the button
Returns:
an instance of button

createLabel

public FormControl createLabel(ControlContainer parent,
                               FrameRectangle rectangle,
                               String name,
                               String text)
Description copied from interface: Form
Create a label control in this form.

Specified by:
createLabel in interface Form
Parameters:
parent - - the element that contains this form control
rectangle - - the bounding rectangle used by this button
name - - the name of the control
text - -default text of the label
Returns:
an instance of label

createTextBox

public FormControl createTextBox(ControlContainer parent,
                                 FrameRectangle rectangle,
                                 String name,
                                 String defaultText,
                                 boolean isMultipleLine)
Description copied from interface: Form
Create a textbox in this form.

Specified by:
createTextBox in interface Form
Parameters:
parent - - the element that contains this form control
rectangle - - the bounding rectangle used by this button
name - - the name of the control
defaultText - -default text of the textbox
isMultipleLine - - if this textbox supports multiple lines input
Returns:
an instance of text box

createListBox

public FormControl createListBox(ControlContainer parent,
                                 FrameRectangle rectangle,
                                 String name,
                                 boolean isMultiSelection,
                                 boolean isDropDown)
Description copied from interface: Form
Create a list box in this form.

Specified by:
createListBox in interface Form
Parameters:
parent - - the element that contains this form control
rectangle - - the bounding rectangle used by this button
name - - the name of the control
isMultiSelection - - support multi-selection or not
isDropDown - - the drop-down list is visible or not
Returns:
an instance of list box

createComboBox

public FormControl createComboBox(ControlContainer parent,
                                  FrameRectangle rectangle,
                                  String name,
                                  String defaultText,
                                  boolean isDropDown)
Description copied from interface: Form
Create a combo box in this form.

Specified by:
createComboBox in interface Form
Parameters:
parent - - the element that contains this form control
rectangle - - the bounding rectangle used by this button
name - - the name of the control
defaultText - - the default text of combobox
isDropDown - - the drop-down list is visible or not
Returns:
an instance of combo box

createRadioButton

public FormControl createRadioButton(ControlContainer parent,
                                     FrameRectangle rectangle,
                                     String name,
                                     String label,
                                     String value)
Description copied from interface: Form
Create a radio button in this form.

Specified by:
createRadioButton in interface Form
Parameters:
parent - - the element that contains this form control
rectangle - - the bounding rectangle used by this button
name - - the name of the control
label - - the label of this radio button
value - - the value assign to this option
Returns:
an instance of radio button

createCheckBox

public FormControl createCheckBox(ControlContainer parent,
                                  FrameRectangle rectangle,
                                  String name,
                                  String label,
                                  String value)
Description copied from interface: Form
Create a check box in this form.

Specified by:
createCheckBox in interface Form
Parameters:
parent - - the element that contains this form control
rectangle - - the bounding rectangle used by this button
name - - the name of the control
label - - the label of this check box
value - - the value assign to this option
Returns:
an instance of check box

createDateField

public FormControl createDateField(ControlContainer parent,
                                   FrameRectangle rectangle,
                                   String name,
                                   String defaultValue)
Create a time field in this form.

Specified by:
createDateField in interface Form
Parameters:
parent - - the element that contains this form control
rectangle - - the bounding rectangle used by this button
name - - the name of the control
defaultValue - - the default value of this input field. It's a 6 digits number, e.g. 20121015 represents 2012-10-15.
Returns:
an instance of time field

createTimeField

public FormControl createTimeField(ControlContainer parent,
                                   FrameRectangle rectangle,
                                   String name,
                                   String defaultValue)
Create a time field in this form.

Specified by:
createTimeField in interface Form
Parameters:
parent - - the element that contains this form control
rectangle - - the bounding rectangle used by this button
name - - the name of the control
defaultValue - - the default value of this input field. It's a 6 digits number, e.g. 15304000 represents 15:30:40.
Returns:
an instance of time field

createNumericField

public FormControl createNumericField(ControlContainer parent,
                                      FrameRectangle rectangle,
                                      String name,
                                      String defaultValue)
Description copied from interface: Form
Create a numeric field in this form.

Specified by:
createNumericField in interface Form
Parameters:
parent - - the element that contains this form control
rectangle - - the bounding rectangle used by this button
name - - the name of the control
defaultValue - - the default value of this input field
Returns:
an instance of numeric field

createPatternField

public FormControl createPatternField(ControlContainer parent,
                                      FrameRectangle rectangle,
                                      String name,
                                      String defaultValue)
Description copied from interface: Form
Create a pattern field in this form.

Specified by:
createPatternField in interface Form
Parameters:
parent - - the element that contains this form control
rectangle - - the bounding rectangle used by this button
name - - the name of the control
defaultValue - - the default value of this input field
Returns:
an instance of pattern field

createCurrencyField

public FormControl createCurrencyField(ControlContainer parent,
                                       FrameRectangle rectangle,
                                       String name,
                                       String defaultValue)
Description copied from interface: Form
Create a currency field in this form.

Specified by:
createCurrencyField in interface Form
Parameters:
parent - - the element that contains this form control
rectangle - - the bounding rectangle used by this button
name - - the name of the control
defaultValue - - the default value of this input field
Returns:
an instance of currency field

setControlImplementation

public void setControlImplementation(String controlImpl)
Description copied from interface: Form
Set the implementation of the created control

Specified by:
setControlImplementation in interface Form
Parameters:
controlImpl - - implementation of control

setFormName

public void setFormName(String name)
Description copied from interface: Form
Set the name of this form

Specified by:
setFormName in interface Form
Parameters:
name - - the form name

setCommand

public void setCommand(String command)
Description copied from interface: Form
Set a command to execute on a data source

Specified by:
setCommand in interface Form

setCommandType

public void setCommandType(FormTypeDefinition.FormCommandType commandType)
Description copied from interface: Form
Set the type of command to execute on a data source.

Specified by:
setCommandType in interface Form
Parameters:
commandType - the command type

setDataSource

public void setDataSource(String dataSource)
Description copied from interface: Form
Set the data source to be used by the form

Specified by:
setDataSource in interface Form
Parameters:
dataSource - - name of data source

getOdfElement

public FormFormElement getOdfElement()
Description copied from class: Component
Return the instance of OdfElement which presents this structure.

Specified by:
getOdfElement in interface Form
Specified by:
getOdfElement in class Component
Returns:
the instance of OdfElement

getFormName

public String getFormName()
Description copied from interface: Form
Get the form name

Specified by:
getFormName in interface Form
Returns:
the form name

getCommand

public String getCommand()
Description copied from interface: Form
Get the command to execute on a data source

Specified by:
getCommand in interface Form
Returns:
the command

getCommandType

public FormTypeDefinition.FormCommandType getCommandType()
Description copied from interface: Form
Get the type of command to execute on a data source

Specified by:
getCommandType in interface Form
Returns:
the command type

getControlImplementation

public String getControlImplementation()
Description copied from interface: Form
Get the implementation of the created control

Specified by:
getControlImplementation in interface Form
Returns:
a control implementation

getDataSource

public String getDataSource()
Description copied from interface: Form
Get the name of data source

Specified by:
getDataSource in interface Form
Returns:
the name of data source used by the form


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