pl.mbdev.openstage
Class IppForm

java.lang.Object
  extended by pl.mbdev.openstage.Xml
      extended by pl.mbdev.openstage.IppForm

public class IppForm
extends Xml

Important type of XML object, used to send user-created data from the OpenStage phone to the external server.

 Copyright 2011 Mateusz Bysiek,
     mb@mbdev.pl, http://mbdev.pl/
 
 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
 You may obtain a copy of the License at
 
     http://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.
 

Author:
Mateusz Bysiek

Nested Class Summary
static class IppForm.Proportion
          Available values of proportion parameter in the constructor of IppForm, they define proportions between left and right column of the form.
 
Field Summary
private  int itemCount
          Number of items currently present in this form.
private  IppForm.Proportion proportion
          Value from IppForm.Proportion, defines proportion between width of left and right column.
private  java.lang.String title
          Title of the form.
private  java.lang.String url
          URL address to which the values from the form can be sent via SELECT command (see IppCommand and IppCommand.Type).
 
Constructor Summary
IppForm(java.lang.String title, java.lang.String url)
          Constructs new form with no initial items or commands, and with default column proportions (left 50%, right 50%).
IppForm(java.lang.String title, java.lang.String url, IppForm.Proportion proportion)
          Constructs new form with no initial items or commands.
 
Method Summary
 void add(IppItem i)
          Adds the provided IppItem to this IppForm.
 Xml add(XmlFormItem fi)
          Adds the provided form item (any subclass of the XmlFormItem) to this IppForm.
protected  java.lang.StringBuffer attributesToXmlString()
          Should be overridden by classes that have some attributes.
 
Methods inherited from class pl.mbdev.openstage.Xml
add, add, addAndReturn, attributeToXml, firstAttributesToXmlString, getContents, getLogicalRoot, getParent, getSubNode, getSubNodeIndex, getSubNodes, getXmlHeader, isEmpty, logicalAdd, sendTo, setContents, setParent, subObjectsCount, subObjectsToXmlString, toXmlString, wrapWithIppItem
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

itemCount

private int itemCount
Number of items currently present in this form.


title

private java.lang.String title
Title of the form.


url

private java.lang.String url
URL address to which the values from the form can be sent via SELECT command (see IppCommand and IppCommand.Type).


proportion

private IppForm.Proportion proportion
Value from IppForm.Proportion, defines proportion between width of left and right column.

Constructor Detail

IppForm

public IppForm(java.lang.String title,
               java.lang.String url)
Constructs new form with no initial items or commands, and with default column proportions (left 50%, right 50%).

Parameters:
title - title of the form
url - URL address to which the values from this form, and hidden fields (see IppHidden) can be sent via SELECT command (see IppCommand and IppCommand.Type)

IppForm

public IppForm(java.lang.String title,
               java.lang.String url,
               IppForm.Proportion proportion)
Constructs new form with no initial items or commands.

Parameters:
title - title of the form
url - URL address to which the values from the form can be sent via SELECT command (see IppCommand and IppCommand.Type)
proportion - value from IppForm.Proportion, defines proportion between width of left and right column
Method Detail

add

public void add(IppItem i)
Adds the provided IppItem to this IppForm.

Parameters:
i - IppItem

add

public Xml add(XmlFormItem fi)
Adds the provided form item (any subclass of the XmlFormItem) to this IppForm.

Parameters:
fi - form item: IppStringItem, IppImageItem, IppSpacer, IppTextField, IppChoiceGroup, IppDateField, IppButton or IppGauge
Returns:
the added form item, or its logical root if it was wrapped with IppItem

attributesToXmlString

protected java.lang.StringBuffer attributesToXmlString()
Description copied from class: Xml
Should be overridden by classes that have some attributes.

Overrides:
attributesToXmlString in class Xml
Returns:
XML-text containing all attributes of the object