Package muntjac :: Package terminal :: Module paint_target :: Class IPaintTarget
[hide private]
[frames] | no frames]

Class IPaintTarget

source code

object --+
         |
        IPaintTarget

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


Authors:
Vaadin Ltd., Richard Lincoln

Version: 1.1.2

Instance Methods [hide private]
 
addSection(self, sectionTagName, sectionData)
Prints single XMLsection.
source code
 
startTag(self, paintable, tag=None)
Prints element start tag of a paintable section.
source code
 
paintReference(self, paintable, referenceName)
Paints a component reference as an attribute to current tag.
source code
 
endTag(self, tagName)
Prints element end tag.
source code
 
addAttribute(self, *args)
Adds a boolean attribute to component.
source code
 
addVariable(self, *args)
Adds details about StreamVariable to the UIDL stream.
source code
 
addUploadStreamVariable(self, owner, name)
Adds a upload stream type variable.
source code
 
addXMLSection(self, sectionTagName, sectionData, namespace)
Prints single XML section.
source code
 
addUIDL(self, uidl)
Adds UIDL directly.
source code
 
addText(self, text)
Adds text node.
source code
 
addCharacterData(self, text)
Adds CDATA node to target UIDL-tree.
source code
 
getTag(self, paintable)
Returns: the "tag" string used in communication to present given IPaintable type.
source code
 
isFullRepaint(self)
@return true if a full repaint has been requested.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

addSection(self, sectionTagName, sectionData)

source code 

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.
Raises:

startTag(self, paintable, tag=None)

source code 

Prints element start tag of a paintable section. Starts a paintable section using the given tag. The IPaintTarget 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.
Raises:

paintReference(self, paintable, referenceName)

source code 

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 was experimental api and got replaced by addAttribute.

Parameters:
  • paintable - the Paintable to reference
  • referenceName - @raise PaintException

Deprecated: use addAttribute or addVariable instead

endTag(self, tagName)

source code 

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.
Raises:

addAttribute(self, *args)

source code 

Adds a boolean attribute to component. Attributes must be added before any content is written.

Raises:

addVariable(self, *args)

source code 

Adds details about StreamVariable to the UIDL stream. Eg. in web terminals Receivers are typically rendered for the client side as URLs, where the client side implementation can do an http post request.

The urls in UIDL message may use Muntjac specific protocol. Before actually using the urls on the client side, they should be passed via ApplicationConnection.translateMuntjacUri.

Note that in current terminal implementation StreamVariables are cleaned from the terminal only when:

  • a StreamVariable with same name replaces an old one
  • the variable owner is no more attached
  • the developer signals this by calling StreamingStartEvent.disposeStreamVariable

Most commonly a component developer can just ignore this issue, but with strict memory requirements and lots of StreamVariables implementations that reserve a lot of memory this may be a critical issue.

Parameters:
  • args - tuple of the form
    • (owner, name, value)
      1. the ReceiverOwner that can track the progress of streaming to the given StreamVariable
      2. an identifying name for the StreamVariable
      3. the StreamVariable to paint
Raises:

addUploadStreamVariable(self, owner, name)

source code 

Adds a upload stream type variable.

Parameters:
  • owner - the Listener for variable changes.
  • name - the Variable name.
Raises:

addXMLSection(self, sectionTagName, sectionData, namespace)

source code 

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.
Raises:

addUIDL(self, uidl)

source code 

Adds UIDL directly. The UIDL must be valid in accordance with the UIDL.dtd

Parameters:
  • uidl - the UIDL to be added.
Raises:

addText(self, text)

source code 

Adds text node. All the contents of the text are XML-escaped.

Parameters:
  • text - the Text to add
Raises:

addCharacterData(self, text)

source code 

Adds CDATA node to target UIDL-tree.

Parameters:
  • text - the Character data to add
Raises:

getTag(self, paintable)

source code 
Returns:
the "tag" string used in communication to present given IPaintable type. Terminal may define how to present paintable.

isFullRepaint(self)

source code 

@return true if a full repaint has been requested. E.g. refresh in a browser window or such.