pl.mbdev.openstage
Class IppKey

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

public class IppKey
extends Xml

Element that allows direct input of the pressed keys values to the remote 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 IppKey.BufferKeys
          Setting of buffering of input of the IppKey element.
static class IppKey.Keypad
          Keypad key presses may be ignored or not, while IppKey element is present on the screen.
static class IppKey.SendKeys
          The input from IppKey element may be sent to the remote server or not.
 
Field Summary
private  IppKey.BufferKeys bufferKeys
          Current buffering mode, value from IppKey.BufferKeys.
private  int bufferLength
          Length of the buffer of characters.
private  boolean keypad
          If true, the key presses of keypad are handled by the IppKey element.
private  boolean sendKeys
          Will the keys be sent to the server.
private  java.lang.Character termKey
          Character, which will terminate the input when it is pressed.
private  java.lang.String urlKey
          Key from the key-value pair, where the value is the set of digits, or one digit if the buffering is turned off.
 
Constructor Summary
IppKey()
          Creates a default IppKey element, which disables
IppKey(boolean keypad, boolean sendKeys, IppKey.BufferKeys bufferKeys, int bufferLength, java.lang.Character termKey, java.lang.String urlKey)
          Constructs new IppKey element with all parameters available.
IppKey(int bufferLength, java.lang.Character termKey, java.lang.String urlKey)
          Creates an IppKey element that enables buffered input and has custom key.
IppKey(java.lang.String urlKey)
          Creates an IppKey element that enables not buffered input and has custom key.
 
Method Summary
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

keypad

private final boolean keypad
If true, the key presses of keypad are handled by the IppKey element.


sendKeys

private final boolean sendKeys
Will the keys be sent to the server.


bufferKeys

private final IppKey.BufferKeys bufferKeys
Current buffering mode, value from IppKey.BufferKeys.


bufferLength

private final int bufferLength
Length of the buffer of characters.


termKey

private java.lang.Character termKey
Character, which will terminate the input when it is pressed. Relevant only when the keys are buffered. If null, the keys are submitted after the buffer is filled.

When there is no buffer, the pressed key data is transmitted immediately after the first key is pressed.


urlKey

private java.lang.String urlKey
Key from the key-value pair, where the value is the set of digits, or one digit if the buffering is turned off. Default key is digit, if it is not set.

Constructor Detail

IppKey

public IppKey()
Creates a default IppKey element, which disables


IppKey

public IppKey(int bufferLength,
              java.lang.Character termKey,
              java.lang.String urlKey)
Creates an IppKey element that enables buffered input and has custom key.

Parameters:
bufferLength - length of the buffer of characters
termKey - character, which will terminate the input when it is pressed
urlKey - key from the key-value pair, where the value is the set of digits, default key is 'digit', if this parameter is null

IppKey

public IppKey(java.lang.String urlKey)
Creates an IppKey element that enables not buffered input and has custom key.

Parameters:
urlKey - key from the key-value pair, where the value is one digit because the buffering is turned off; default key is digit, if this parameter is null

IppKey

public IppKey(boolean keypad,
              boolean sendKeys,
              IppKey.BufferKeys bufferKeys,
              int bufferLength,
              java.lang.Character termKey,
              java.lang.String urlKey)
Constructs new IppKey element with all parameters available.

Parameters:
keypad - if true, the key presses of keypad are handled by the IppKey element
sendKeys - will the keys be sent to the server
bufferKeys - buffering mode, value from IppKey.BufferKeys
bufferLength - length of the buffer of characters
termKey - character, which will terminate the input when it is pressed
urlKey - key from the key-value pair, where the value is the set of digits, or one digit if the buffering is turned off; default key is digit, if this parameter is null
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