com.itmill.toolkit.terminal
Interface PaintTarget

All Known Implementing Classes:
JsonPaintTarget

public interface PaintTarget

This interface defines the methods for painting XML to the UIDL stream.

Since:
3.0
Version:
5.3.0
Author:
IT Mill Ltd.

Method Summary
 void addAttribute(String name, boolean value)
          Adds a boolean attribute to component.
 void addAttribute(String name, double value)
          Adds a double attribute to component.
 void addAttribute(String name, float value)
          Adds a float attribute to component.
 void addAttribute(String name, int value)
          Adds a integer attribute to component.
 void addAttribute(String name, long value)
          Adds a long attribute to component.
 void addAttribute(String string, Object[] keys)
           
 void addAttribute(String name, Resource value)
          Adds a resource attribute to component.
 void addAttribute(String name, String value)
          Adds a string attribute to component.
 void addCharacterData(String text)
          Adds CDATA node to target UIDL-tree.
 void addSection(String sectionTagName, String sectionData)
          Prints single XMLsection.
 void addText(String text)
          Adds text node.
 void addUIDL(String uidl)
          Adds UIDL directly.
 void addUploadStreamVariable(VariableOwner owner, String name)
          Adds a upload stream type variable.
 void addVariable(VariableOwner owner, String name, boolean value)
          Adds a boolean type variable.
 void addVariable(VariableOwner owner, String name, double value)
          Adds a double type variable.
 void addVariable(VariableOwner owner, String name, float value)
          Adds a float type variable.
 void addVariable(VariableOwner owner, String name, int value)
          Adds a int type variable.
 void addVariable(VariableOwner owner, String name, long value)
          Adds a long type variable.
 void addVariable(VariableOwner owner, String name, String value)
          Adds a string type variable.
 void addVariable(VariableOwner owner, String name, String[] value)
          Adds a string array type variable.
 void addXMLSection(String sectionTagName, String sectionData, String namespace)
          Prints single XML section.
 void endTag(String tagName)
          Prints element end tag.
 void paintReference(Paintable paintable, String referenceName)
          Paints a component reference as an attribute to current tag.
 boolean startTag(Paintable paintable, String tag)
          Prints element start tag of a paintable section.
 void startTag(String tagName)
          Prints element start tag.
 

Method Detail

addSection

void addSection(String sectionTagName,
                String sectionData)
                throws PaintException
Prints single XMLsection. Prints full XML section. The section data is escaped from XML tags and surrounded by XML start and end-tags.

Parameters:
sectionTagName - the name of the tag.
sectionData - the scetion data.
Throws:
PaintException - if the paint operation failed.

startTag

boolean startTag(Paintable paintable,
                 String tag)
                 throws PaintException
Prints element start tag of a paintable section. Starts a paintable section using the given tag. The PaintTarget may implement a caching scheme, that checks the paintable has actually changed or can a cached version be used instead. This method should call the startTag method.

If the Paintable is found in cache and this function returns true it may omit the content and close the tag, in which case cached content should be used.

Parameters:
paintable - the paintable to start.
tag - the name of the start tag.
Returns:
true if paintable found in cache, false otherwise.
Throws:
PaintException - if the paint operation failed.
Since:
3.1
See Also:
startTag(String)

paintReference

void paintReference(Paintable paintable,
                    String referenceName)
                    throws PaintException
Paints a component reference as an attribute to current tag. This method is meant to enable component interactions on client side. With reference the client side component can communicate directly to other component. Note! This is still an experimental feature and API is likely to change in future.

Parameters:
paintable - the Paintable to reference
referenceName -
Throws:
PaintException
Since:
5.2

startTag

void startTag(String tagName)
              throws PaintException
Prints element start tag.
 Todo:
 Checking of input values
 

Parameters:
tagName - the name of the start tag.
Throws:
PaintException - if the paint operation failed.

endTag

void endTag(String tagName)
            throws PaintException
Prints element end tag. If the parent tag is closed before every child tag is closed an PaintException is raised.

Parameters:
tagName - the name of the end tag.
Throws:
PaintException - if the paint operation failed.

addAttribute

void addAttribute(String name,
                  boolean value)
                  throws PaintException
Adds a boolean attribute to component. Atributes must be added before any content is written.

Parameters:
name - the Attribute name.
value - the Attribute value.
Throws:
PaintException - if the paint operation failed.

addAttribute

void addAttribute(String name,
                  int value)
                  throws PaintException
Adds a integer attribute to component. Atributes must be added before any content is written.

Parameters:
name - the Attribute name.
value - the Attribute value.
Throws:
PaintException - if the paint operation failed.

addAttribute

void addAttribute(String name,
                  Resource value)
                  throws PaintException
Adds a resource attribute to component. Atributes must be added before any content is written.

Parameters:
name - the Attribute name
value - the Attribute value
Throws:
PaintException - if the paint operation failed.

addAttribute

void addAttribute(String name,
                  long value)
                  throws PaintException
Adds a long attribute to component. Atributes must be added before any content is written.

Parameters:
name - the Attribute name.
value - the Attribute value.
Throws:
PaintException - if the paint operation failed.

addAttribute

void addAttribute(String name,
                  float value)
                  throws PaintException
Adds a float attribute to component. Atributes must be added before any content is written.

Parameters:
name - the Attribute name.
value - the Attribute value.
Throws:
PaintException - if the paint operation failed.

addAttribute

void addAttribute(String name,
                  double value)
                  throws PaintException
Adds a double attribute to component. Atributes must be added before any content is written.

Parameters:
name - the Attribute name.
value - the Attribute value.
Throws:
PaintException - if the paint operation failed.

addAttribute

void addAttribute(String name,
                  String value)
                  throws PaintException
Adds a string attribute to component. Atributes must be added before any content is written.

Parameters:
name - the Boolean attribute name.
value - the Boolean attribute value.
Throws:
PaintException - if the paint operation failed.

addVariable

void addVariable(VariableOwner owner,
                 String name,
                 String value)
                 throws PaintException
Adds a string type variable.

Parameters:
owner - the Listener for variable changes.
name - the Variable name.
value - the Variable initial value.
Throws:
PaintException - if the paint operation failed.

addVariable

void addVariable(VariableOwner owner,
                 String name,
                 int value)
                 throws PaintException
Adds a int type variable.

Parameters:
owner - the Listener for variable changes.
name - the Variable name.
value - the Variable initial value.
Throws:
PaintException - if the paint operation failed.

addVariable

void addVariable(VariableOwner owner,
                 String name,
                 long value)
                 throws PaintException
Adds a long type variable.

Parameters:
owner - the Listener for variable changes.
name - the Variable name.
value - the Variable initial value.
Throws:
PaintException - if the paint operation failed.

addVariable

void addVariable(VariableOwner owner,
                 String name,
                 float value)
                 throws PaintException
Adds a float type variable.

Parameters:
owner - the Listener for variable changes.
name - the Variable name.
value - the Variable initial value.
Throws:
PaintException - if the paint operation failed.

addVariable

void addVariable(VariableOwner owner,
                 String name,
                 double value)
                 throws PaintException
Adds a double type variable.

Parameters:
owner - the Listener for variable changes.
name - the Variable name.
value - the Variable initial value.
Throws:
PaintException - if the paint operation failed.

addVariable

void addVariable(VariableOwner owner,
                 String name,
                 boolean value)
                 throws PaintException
Adds a boolean type variable.

Parameters:
owner - the Listener for variable changes.
name - the Variable name.
value - the Variable initial value.
Throws:
PaintException - if the paint operation failed.

addVariable

void addVariable(VariableOwner owner,
                 String name,
                 String[] value)
                 throws PaintException
Adds a string array type variable.

Parameters:
owner - the Listener for variable changes.
name - the Variable name.
value - the Variable initial value.
Throws:
PaintException - if the paint operation failed.

addUploadStreamVariable

void addUploadStreamVariable(VariableOwner owner,
                             String name)
                             throws PaintException
Adds a upload stream type variable.

Parameters:
owner - the Listener for variable changes.
name - the Variable name.
Throws:
PaintException - if the paint operation failed.

addXMLSection

void addXMLSection(String sectionTagName,
                   String sectionData,
                   String namespace)
                   throws PaintException
Prints single XML section.

Prints full XML section. The section data must be XML and it is surrounded by XML start and end-tags.

Parameters:
sectionTagName - the tag name.
sectionData - the section data to be printed.
namespace - the namespace.
Throws:
PaintException - if the paint operation failed.

addUIDL

void addUIDL(String uidl)
             throws PaintException
Adds UIDL directly. The UIDL must be valid in accordance with the UIDL.dtd

Parameters:
uidl - the UIDL to be added.
Throws:
PaintException - if the paint operation failed.

addText

void addText(String text)
             throws PaintException
Adds text node. All the contents of the text are XML-escaped.

Parameters:
text - the Text to add
Throws:
PaintException - if the paint operation failed.

addCharacterData

void addCharacterData(String text)
                      throws PaintException
Adds CDATA node to target UIDL-tree.

Parameters:
text - the Character data to add
Throws:
PaintException - if the paint operation failed.
Since:
3.1

addAttribute

void addAttribute(String string,
                  Object[] keys)


Copyright © 2000-2009 IT Mill Ltd. All Rights Reserved.