pl.mbdev.openstage
Class IppItem

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

public class IppItem
extends Xml

Used to attach IppCommands to single entries of the IppForm. This is achieved by adding one or multiple commands, as well as a single form item to the IppItem, and then adding such IppItem to IppForm.

You can add commands directly to IppStringItem, IppImageItem, IppTextField and other items, to which you do cannot normally add them, and they will be automatically wrapped in IppItem.

 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

Field Summary
private  int commandCount
          Number of commands (see IppCommand) present in this IppItem.
private  boolean hasItem
          True if this IppItem already has an attached item.
 
Constructor Summary
IppItem()
          Constructs new, empty IppItem.
 
Method Summary
 void add(IppButton b)
          Attaches the provided IppButton to this IppItem.
 void add(IppChoiceGroup cg)
          Attaches the provided IppChoiceGroup to this IppItem.
 void add(IppCommand c)
          Adds IppCommand to this IppItem.
 void add(IppDateField d)
          Attaches the provided IppDateField to this IppItem.
 void add(IppGauge g)
          Attaches the provided IppGauge to this IppItem.
 void add(IppImageItem ii)
          Attaches the provided IppImageItem to this IppItem.
 void add(IppSpacer s)
          Attaches the provided IppSpacer to this IppItem.
 void add(IppStringItem si)
          Attaches the provided IppStringItem to this IppItem.
 void add(IppTextField t)
          Attaches the provided IppTextField to this IppItem.
protected  Xml add(Xml o)
          Adds the provided XML object to sub-objects of this object, and returns it.
protected  java.lang.StringBuffer attributesToXmlString()
          Should be overridden by classes that have some attributes.
 
Methods inherited from class pl.mbdev.openstage.Xml
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

hasItem

private boolean hasItem
True if this IppItem already has an attached item.


commandCount

private int commandCount
Number of commands (see IppCommand) present in this IppItem.

Constructor Detail

IppItem

public IppItem()
Constructs new, empty IppItem.

Method Detail

add

public void add(IppStringItem si)
Attaches the provided IppStringItem to this IppItem.

Parameters:
si - string item, IppStringItem

add

public void add(IppImageItem ii)
Attaches the provided IppImageItem to this IppItem.

Parameters:
ii - image item IppImageItem

add

public void add(IppSpacer s)
Attaches the provided IppSpacer to this IppItem.

Parameters:
s - spacer, IppSpacer

add

public void add(IppTextField t)
Attaches the provided IppTextField to this IppItem.

Parameters:
t - text field, IppTextField

add

public void add(IppChoiceGroup cg)
Attaches the provided IppChoiceGroup to this IppItem.

Parameters:
cg - choice group, IppChoiceGroup

add

public void add(IppDateField d)
Attaches the provided IppDateField to this IppItem.

Parameters:
d - date field, IppDateField

add

public void add(IppButton b)
Attaches the provided IppButton to this IppItem.

Parameters:
b - button, IppButton

add

public void add(IppGauge g)
Attaches the provided IppGauge to this IppItem.

Parameters:
g - gauge, IppGauge

add

protected Xml add(Xml o)
Description copied from class: Xml
Adds the provided XML object to sub-objects of this object, and returns it.

Overrides:
add in class Xml
Parameters:
o - any kind of XML object from OpenStage SDK
Returns:
the object provided in the parameter

add

public void add(IppCommand c)
Adds IppCommand to this IppItem.

Parameters:
c - command

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