org.odftoolkit.simple.form
Interface Form

All Known Implementing Classes:
OOForm

public interface Form

This class represents form object. It provides method to get/set form properties, content, layout and styles. A form is a container to hold controls like buttons, combo boxes, labels, fields, check boxes, radio buttons, text boxes, list boxes and etc.

Since:
0.8

Method Summary
 FormControl 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 date 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
 FormFormElement getOdfElement()
          Get the instance of FormFormElemnt element.
 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
 

Method Detail

createButton

FormControl createButton(ControlContainer parent,
                         FrameRectangle rectangle,
                         String name,
                         String label)
Create a button control in this 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

FormControl createLabel(ControlContainer parent,
                        FrameRectangle rectangle,
                        String name,
                        String text)
Create a label control in this 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

FormControl createTextBox(ControlContainer parent,
                          FrameRectangle rectangle,
                          String name,
                          String defaultText,
                          boolean isMultipleLine)
Create a textbox in this 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

FormControl createListBox(ControlContainer parent,
                          FrameRectangle rectangle,
                          String name,
                          boolean isMultiSelection,
                          boolean isDropDown)
Create a list box in this 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

FormControl createComboBox(ControlContainer parent,
                           FrameRectangle rectangle,
                           String name,
                           String defaultText,
                           boolean isDropDown)
Create a combo box in this 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

FormControl createRadioButton(ControlContainer parent,
                              FrameRectangle rectangle,
                              String name,
                              String label,
                              String value)
Create a radio button in this 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

FormControl createCheckBox(ControlContainer parent,
                           FrameRectangle rectangle,
                           String name,
                           String label,
                           String value)
Create a check box in this 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

FormControl createDateField(ControlContainer parent,
                            FrameRectangle rectangle,
                            String name,
                            String defaultValue)
Create a date field in this 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 date field

createTimeField

FormControl createTimeField(ControlContainer parent,
                            FrameRectangle rectangle,
                            String name,
                            String defaultValue)
Create a time field in this 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 time field

createNumericField

FormControl createNumericField(ControlContainer parent,
                               FrameRectangle rectangle,
                               String name,
                               String defaultValue)
Create a numeric field in this 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

FormControl createPatternField(ControlContainer parent,
                               FrameRectangle rectangle,
                               String name,
                               String defaultValue)
Create a pattern field in this 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

FormControl createCurrencyField(ControlContainer parent,
                                FrameRectangle rectangle,
                                String name,
                                String defaultValue)
Create a currency field in this 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

setFormName

void setFormName(String name)
Set the name of this form

Parameters:
name - - the form name

getFormName

String getFormName()
Get the form name

Returns:
the form name

setControlImplementation

void setControlImplementation(String controlImpl)
Set the implementation of the created control

Parameters:
controlImpl - - implementation of control

getControlImplementation

String getControlImplementation()
Get the implementation of the created control

Returns:
a control implementation

setDataSource

void setDataSource(String dataSource)
Set the data source to be used by the form

Parameters:
dataSource - - name of data source

getDataSource

String getDataSource()
Get the name of data source

Returns:
the name of data source used by the form

setCommandType

void setCommandType(FormTypeDefinition.FormCommandType commandType)
Set the type of command to execute on a data source.

Parameters:
commandType - the command type

getCommandType

FormTypeDefinition.FormCommandType getCommandType()
Get the type of command to execute on a data source

Returns:
the command type

setCommand

void setCommand(String command)
Set a command to execute on a data source

Parameters:
command -

getCommand

String getCommand()
Get the command to execute on a data source

Returns:
the command

getOdfElement

FormFormElement getOdfElement()
Get the instance of FormFormElemnt element.

Returns:
the instance of FormFormElemnt


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