public class JsContentRenderer extends java.lang.Object implements ContentRenderer
ContentRenderer
that renders
the content as a JavaScript property (i.e., name: 'value').Constructor and Description |
---|
JsContentRenderer() |
Modifier and Type | Method and Description |
---|---|
java.lang.CharSequence |
getBuffer()
Returns the content being rendered.
|
void |
render(java.lang.String name,
boolean value)
Renders a boolean property.
|
void |
render(java.lang.String name,
byte value)
Renders a byte property.
|
void |
render(java.lang.String name,
char value)
Renders a char property.
|
void |
render(java.lang.String name,
java.util.Date value)
Renders a Date property.
|
void |
render(java.lang.String name,
double value)
Renders a double property.
|
void |
render(java.lang.String name,
float value)
Renders a double property.
|
void |
render(java.lang.String name,
int value)
Renders an integer property.
|
void |
render(java.lang.String name,
long value)
Renders a long property.
|
void |
render(java.lang.String name,
java.lang.Object value)
Renders an arbitrary object.
|
void |
render(java.lang.String name,
short value)
Renders a short property.
|
void |
render(java.lang.String name,
java.lang.String value)
Renders a string property.
|
void |
renderClientAttributes(java.util.Map<java.lang.String,java.lang.String> attrs)
Renders the client's DOM attributes for the peer widgets.
|
void |
renderDirectly(java.lang.String name,
java.lang.Object value)
Renders the JavaScript code snippet.
|
void |
renderWidgetAttributes(java.util.Map<java.lang.String,java.lang.String> attrs) |
void |
renderWidgetListeners(java.util.Map<java.lang.String,java.lang.String> listeners)
Renders the JavaScript code snippet for event listeners
registered for the peer widget.
|
void |
renderWidgetOverrides(java.util.Map<java.lang.String,java.lang.String> overrides)
Renders the JavaScript codes snippet to override the methods
and properties of the peer widget.
|
public java.lang.CharSequence getBuffer()
public void render(java.lang.String name, java.lang.String value)
render
in interface ContentRenderer
name
- the property name. Note: it must be a legal JavaScript
variable name.public void render(java.lang.String name, java.util.Date value)
render
in interface ContentRenderer
name
- the property name. Note: it must be a legal JavaScript
variable name.public void render(java.lang.String name, java.lang.Object value)
render
in interface ContentRenderer
public void render(java.lang.String name, int value)
render
in interface ContentRenderer
name
- the property name. Note: it must be a legal JavaScript
variable name.public void render(java.lang.String name, long value)
render
in interface ContentRenderer
name
- the property name. Note: it must be a legal JavaScript
variable name.public void render(java.lang.String name, short value)
render
in interface ContentRenderer
name
- the property name. Note: it must be a legal JavaScript
variable name.public void render(java.lang.String name, byte value)
render
in interface ContentRenderer
name
- the property name. Note: it must be a legal JavaScript
variable name.public void render(java.lang.String name, boolean value)
render
in interface ContentRenderer
name
- the property name. Note: it must be a legal JavaScript
variable name.public void render(java.lang.String name, double value)
render
in interface ContentRenderer
name
- the property name. Note: it must be a legal JavaScript
variable name.public void render(java.lang.String name, float value)
render
in interface ContentRenderer
name
- the property name. Note: it must be a legal JavaScript
variable name.public void render(java.lang.String name, char value)
render
in interface ContentRenderer
name
- the property name. Note: it must be a legal JavaScript
variable name.public void renderDirectly(java.lang.String name, java.lang.Object value)
renderDirectly
in interface ContentRenderer
public void renderWidgetListeners(java.util.Map<java.lang.String,java.lang.String> listeners)
renderWidgetListeners
in interface ContentRenderer
listeners
- the map of listeners to register at the peer widget.
The key is the event name (such as onClick), and the value the code
snippet (such as this.getFellow('inf').setValue('new')
).
They are both String instances.public void renderWidgetOverrides(java.util.Map<java.lang.String,java.lang.String> overrides)
renderWidgetOverrides
in interface ContentRenderer
overrides
- a map of methods and properties. Notice that the value
must be a valid JavaScript snippet that can be evaluated to
a value. In fact, the map will be generated as follows.{name1: value1, name2: value2}
.
Examples of values: function () {}
, 123
,
new Date()
, and "a literal string"
public void renderWidgetAttributes(java.util.Map<java.lang.String,java.lang.String> attrs)
renderWidgetAttributes
in interface ContentRenderer
public void renderClientAttributes(java.util.Map<java.lang.String,java.lang.String> attrs)
ContentRenderer
renderClientAttributes
in interface ContentRenderer
attrs
- the map of attributes. The key is the attribute's name,
while the value is the attribute's value. They are both instances of String.Copyright © 2005-2011 Potix Corporation. All Rights Reserved.