public interface PaintTarget extends Serializable
Modifier and Type | Interface and Description |
---|---|
static class |
PaintTarget.PaintStatus
Result of starting to paint a Component (
startPaintable(Component, String) ). |
Modifier and Type | Method and Description |
---|---|
void |
addAttribute(String name,
boolean value)
Adds a boolean attribute to component.
|
void |
addAttribute(String name,
Component value)
Adds a Component type attribute.
|
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 name,
Map<?,?> value)
Adds a
Map attribute to the 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 an upload stream type variable.
|
void |
addVariable(VariableOwner owner,
String name,
boolean value)
Adds a boolean type variable.
|
void |
addVariable(VariableOwner owner,
String name,
Component value)
Adds a Component 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 an int type variable.
|
void |
addVariable(VariableOwner owner,
String name,
long value)
Adds a long type variable.
|
void |
addVariable(VariableOwner owner,
String name,
StreamVariable value)
Adds details about
StreamVariable to the UIDL stream. |
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 |
endPaintable(Component paintable)
Prints paintable element end tag.
|
void |
endTag(String tagName)
Prints element end tag.
|
String |
getTag(ClientConnector paintable) |
boolean |
isFullRepaint() |
PaintTarget.PaintStatus |
startPaintable(Component paintable,
String tag)
Prints element start tag of a paintable section.
|
void |
startTag(String tagName)
Prints element start tag.
|
void addSection(String sectionTagName, String sectionData) throws PaintException
sectionTagName
- the name of the tag.sectionData
- the section data.PaintException
- if the paint operation failed.PaintTarget.PaintStatus startPaintable(Component paintable, String tag) throws PaintException
If the Component
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.
This method may also add only a reference to the paintable and queue the paintable to be painted separately.
Each paintable being painted should be closed by a matching
endPaintable(Component)
regardless of the PaintTarget.PaintStatus
returned.
paintable
- the paintable to start.tag
- the name of the start tag.PaintTarget.PaintStatus
- ready to paint or already cached on the
client (also used for sub paintables that are painted later
separately)PaintException
- if the paint operation failed.startTag(String)
void endPaintable(Component paintable) throws PaintException
startPaintable(Component, String)
should be matched by
endPaintable(Component)
. If the parent tag is closed before
every child tag is closed a PaintException is raised.paintable
- the paintable to close.PaintException
- if the paint operation failed.void startTag(String tagName) throws PaintException
Todo: Checking of input values
tagName
- the name of the start tag.PaintException
- if the paint operation failed.void endTag(String tagName) throws PaintException
tagName
- the name of the end tag.PaintException
- if the paint operation failed.void addAttribute(String name, boolean value) throws PaintException
name
- the Attribute name.value
- the Attribute value.PaintException
- if the paint operation failed.void addAttribute(String name, int value) throws PaintException
name
- the Attribute name.value
- the Attribute value.PaintException
- if the paint operation failed.void addAttribute(String name, Resource value) throws PaintException
name
- the Attribute namevalue
- the Attribute valuePaintException
- if the paint operation failed.void addVariable(VariableOwner owner, String name, StreamVariable value) throws PaintException
StreamVariable
to the UIDL stream. E.g. 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 Vaadin specific protocol. Before
actually using the urls on the client side, they should be passed via
ApplicationConnection.translateVaadinUri(String)
.
Note that in current terminal implementation StreamVariables are cleaned from the terminal only when:
StreamVariable.StreamingStartEvent.disposeStreamVariable()
owner
- the ReceiverOwner that can track the progress of streaming to
the given StreamVariablename
- an identifying name for the StreamVariablevalue
- the StreamVariable to paintPaintException
- if the paint operation failed.void addAttribute(String name, long value) throws PaintException
name
- the Attribute name.value
- the Attribute value.PaintException
- if the paint operation failed.void addAttribute(String name, float value) throws PaintException
name
- the Attribute name.value
- the Attribute value.PaintException
- if the paint operation failed.void addAttribute(String name, double value) throws PaintException
name
- the Attribute name.value
- the Attribute value.PaintException
- if the paint operation failed.void addAttribute(String name, String value) throws PaintException
name
- the Boolean attribute name.value
- the Boolean attribute value.PaintException
- if the paint operation failed.void addAttribute(String name, Map<?,?> value) throws PaintException
Map
attribute to the component. Attributes must be added
before any content is written.
TODO: specify how the map is addedname
- value
- PaintException
void addAttribute(String name, Component value) throws PaintException
name
- the name of the attributevalue
- the Component to be referenced on client sidePaintException
void addVariable(VariableOwner owner, String name, String value) throws PaintException
owner
- the Listener for variable changes.name
- the Variable name.value
- the Variable initial value.PaintException
- if the paint operation failed.void addVariable(VariableOwner owner, String name, int value) throws PaintException
owner
- the Listener for variable changes.name
- the Variable name.value
- the Variable initial value.PaintException
- if the paint operation failed.void addVariable(VariableOwner owner, String name, long value) throws PaintException
owner
- the Listener for variable changes.name
- the Variable name.value
- the Variable initial value.PaintException
- if the paint operation failed.void addVariable(VariableOwner owner, String name, float value) throws PaintException
owner
- the Listener for variable changes.name
- the Variable name.value
- the Variable initial value.PaintException
- if the paint operation failed.void addVariable(VariableOwner owner, String name, double value) throws PaintException
owner
- the Listener for variable changes.name
- the Variable name.value
- the Variable initial value.PaintException
- if the paint operation failed.void addVariable(VariableOwner owner, String name, boolean value) throws PaintException
owner
- the Listener for variable changes.name
- the Variable name.value
- the Variable initial value.PaintException
- if the paint operation failed.void addVariable(VariableOwner owner, String name, String[] value) throws PaintException
owner
- the Listener for variable changes.name
- the Variable name.value
- the Variable initial value.PaintException
- if the paint operation failed.void addVariable(VariableOwner owner, String name, Component value) throws PaintException
owner
- the Listener for variable changesname
- the name of the variablevalue
- the initial value of the variablePaintException
- if the paint oparation failsvoid addUploadStreamVariable(VariableOwner owner, String name) throws PaintException
owner
- the Listener for variable changes.name
- the Variable name.PaintException
- if the paint operation failed.void addXMLSection(String sectionTagName, String sectionData, String namespace) throws PaintException
Prints full XML section. The section data must be XML and it is surrounded by XML start and end-tags.
sectionTagName
- the tag name.sectionData
- the section data to be printed.namespace
- the namespace.PaintException
- if the paint operation failed.void addUIDL(String uidl) throws PaintException
uidl
- the UIDL to be added.PaintException
- if the paint operation failed.void addText(String text) throws PaintException
text
- the Text to addPaintException
- if the paint operation failed.void addCharacterData(String text) throws PaintException
text
- the Character data to addPaintException
- if the paint operation failed.String getTag(ClientConnector paintable)
ClientConnector
type. Terminal may define how to present
the connector.boolean isFullRepaint()
Copyright © 2018 Vaadin Ltd. All rights reserved.