pl.mbdev.openstage
Class IppTextField

java.lang.Object
  extended by pl.mbdev.openstage.Xml
      extended by pl.mbdev.openstage.XmlFormItem
          extended by pl.mbdev.openstage.IppTextField

public class IppTextField
extends XmlFormItem

Can be added to IppForm and is in appearance similar to IppStringItem, but IppTextField can be edited. The value entered by the user can be then sent back to 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 IppTextField.Constraint
          Narrows the set of possible characters of the IppTextField, and sometimes changes the method by which they are entered.
static class IppTextField.DefaultValue
          Possible kinds of default values of IppTextField.
 
Field Summary
private  IppTextField.Constraint constraint
          Value from IppTextField.Constraint.
private  IppTextField.DefaultValue defaultValue
          One of the values from IppTextField.DefaultValue.
private  java.lang.String key
          Key from the key-value pair, where value is the content of the editable field.
private  java.lang.String label
          Label of the field, placed in left column.
private  XmlText xmlText
          Data of the text field must be here due to inheritance restrictions in Java.
 
Constructor Summary
IppTextField(java.lang.String label, java.lang.String key)
          Creates a password field.
IppTextField(java.lang.String label, java.lang.String text, int maxSize, IppTextField.Constraint constraint, boolean isPassword, IppTextField.DefaultValue defaultValue, java.lang.String key, boolean isUneditable)
          Creates IppTextField with all characteristics defined by the user.
IppTextField(java.lang.String label, java.lang.String text, java.lang.String key)
          Creates IppTextField with default characteristics, therefore the value will not be treated as confidential data.
IppTextField(java.lang.String label, java.lang.String text, java.lang.String key, boolean isUneditable)
          Creates an ordinary text field, which may not be editable.
 
Method Summary
protected  java.lang.StringBuffer attributesToXmlString()
          Should be overridden by classes that have some attributes.
 
Methods inherited from class pl.mbdev.openstage.XmlFormItem
add
 
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

label

private java.lang.String label
Label of the field, placed in left column.


constraint

private IppTextField.Constraint constraint
Value from IppTextField.Constraint.


defaultValue

private IppTextField.DefaultValue defaultValue
One of the values from IppTextField.DefaultValue.


key

private java.lang.String key
Key from the key-value pair, where value is the content of the editable field.


xmlText

private XmlText xmlText
Data of the text field must be here due to inheritance restrictions in Java.

Constructor Detail

IppTextField

public IppTextField(java.lang.String label,
                    java.lang.String text,
                    java.lang.String key)
Creates IppTextField with default characteristics, therefore the value will not be treated as confidential data.

Parameters:
label - label of the field, placed in left column
text - initial contents of the field
key - key of the key-value pair sent to the URL specified in IppForm, content of the editable text field is the value

IppTextField

public IppTextField(java.lang.String label,
                    java.lang.String key)
Creates a password field.

Parameters:
label - label of the field, placed in left column
key - key of the key-value pair sent to the URL specified in IppForm, content of the editable text field is the value

IppTextField

public IppTextField(java.lang.String label,
                    java.lang.String text,
                    java.lang.String key,
                    boolean isUneditable)
Creates an ordinary text field, which may not be editable.

Parameters:
label - label of the field, placed in left column
text - initial contents of the field
key - key of the key-value pair sent to the URL specified in IppForm, content of the editable or not editable text field is the value
isUneditable - field value cannot be edited by the user, if true

IppTextField

public IppTextField(java.lang.String label,
                    java.lang.String text,
                    int maxSize,
                    IppTextField.Constraint constraint,
                    boolean isPassword,
                    IppTextField.DefaultValue defaultValue,
                    java.lang.String key,
                    boolean isUneditable)
Creates IppTextField with all characteristics defined by the user.

Parameters:
label - label of the field, placed in left column
text - used only when defaultValue is set to TEXT
maxSize - maximum length of the input, ignored if negative
constraint - value from IppTextField.Constraint
isPassword - OpenStage will try to obscure the value of this field whenever possible
defaultValue - one of the values from IppTextField.DefaultValue
key - key from the key-value pair, where value is the content of the editable field
isUneditable - field value cannot be edited by the user, if true
Method Detail

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