pl.mbdev.openstage
Class IppList

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

public class IppList
extends Xml

Used to create lists of elements, one or more of which then can be selected, according to the list type.

 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 IppList.Type
          Defines possible types of IppList.
 
Field Summary
private  int columns
          Number of columns of this list.
private  int optionsCount
          Number of options present in this list.
private  IppList.Type type
          Type of the list, value from IppList.Type.
 
Constructor Summary
IppList(java.lang.String title, java.lang.String url, IppList.Type type, int columns)
          Creates a new, empty IppList.
IppList(java.lang.String title, java.lang.String url, IppList.Type type, int columns, Option[] options)
          Creates a new list with all parameters available to set.
 
Method Summary
 void add(Option o)
          Adds an option to this IppList.
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

type

private IppList.Type type
Type of the list, value from IppList.Type.


optionsCount

private int optionsCount
Number of options present in this list.


columns

private int columns
Number of columns of this list.

Constructor Detail

IppList

public IppList(java.lang.String title,
               java.lang.String url,
               IppList.Type type,
               int columns)
Creates a new, empty IppList.

Parameters:
title - title of the list
url - URL, to which the selected data of this list will be sent after it is submitted
type - type of the IppList, value from IppList.Type
columns - integer between 1 and 3

IppList

public IppList(java.lang.String title,
               java.lang.String url,
               IppList.Type type,
               int columns,
               Option[] options)
Creates a new list with all parameters available to set.

Parameters:
title - title of the list
url - URL, to which the selected data of this list will be sent after it is submitted
type - type of the IppList, value from IppList.Type
columns - integer between 1 and 3
options - array that holds list of Options to be added to this list
Method Detail

add

public void add(Option o)
Adds an option to this IppList. The number of OptionText elements inside the Option, must be equal to the number of columns of the list.

Parameters:
o - option, an object of type Option

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