|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectechopointng.ui.util.RenderingContext
public class RenderingContext
RenderingContext is useful as a wrapper inside a
DomUpdateSupport or SynchronizePeer implementation to hold important context
such as the component being rendered or the ServerComponentUpdate in use.
This allows you to have sub methods that take a RenderingContext as a parameter and yet contain most of the context information you will require.
Remember that SynchronizePeer's are component static, ie. they are not meant to contain state information as member variables for a given component.
This class helps during the lifetime of a given "render invocation".
It also provides a number of helper methods to make writing UI Peer easier and to make the code cleaner.
| Constructor Summary | |
|---|---|
RenderingContext(RenderContext rc,
ServerComponentUpdate serverComponentUpdate,
Component component)
Constructs a RenderingContext that wraps the original
RenderContext as well as contains references to the ServerComponentUpdate
and Component being rendered. |
|
| Method Summary | |
|---|---|
void |
addAccessKeySupport(Component component,
org.w3c.dom.Element element)
This will add "access key" attributes to an Element if the specified component in facts implements AccessKeyable. |
void |
addAccessKeySupport(org.w3c.dom.Element element)
This will add "access key" attributes to an Element if the specified component in facts implements AccessKeyable |
void |
addAttributeableSupport(Component component,
org.w3c.dom.Element element)
This will add "custom" attributes to an Element from the iif the component implements the Attributeable
interface |
void |
addDisabledSupport(Component component,
org.w3c.dom.Element element)
This will add "disabled" attributes to an Element if the specified component is not enabled. |
void |
addDisabledSupport(org.w3c.dom.Element element)
This will add "disabled" attributes to an Element if the current component is not enabled. |
void |
addLibrary(Service service)
Adds a library and caused the client to wait for it to be loaded. |
void |
addStandardWebSupport(Component component,
org.w3c.dom.Element element)
This is a shortcut method for for the addXXXSupport methods |
void |
addStandardWebSupport(org.w3c.dom.Element element)
|
void |
addTabIndexSupport(Component component,
org.w3c.dom.Element element)
This method will add tab traversal code into the specified element, if the component is in fact a focus tab participant and implements TabStop. |
void |
addTabIndexSupport(org.w3c.dom.Element element)
This method will add tab traversal code into the specified element, if the current component is in fact a focus tab participant. |
void |
addToolTipSupport(Component component,
org.w3c.dom.Element element)
This will add "title" attributes to an Element if the specified component in facts implements ToolTipable. |
org.w3c.dom.Element |
createE(java.lang.String elementName)
Creates a DOM element based on the current Document in the RenderContext's server message. |
org.w3c.dom.Text |
createText(java.lang.String text)
Creates a Text node given the specified string. |
Component |
getComponent()
|
Connection |
getConnection()
Returns the Connection to which the
ServerMessage is being rendered. |
ContainerInstance |
getContainerInstance()
Returns the ContainerInstance for which the rendering
is being performed. |
org.w3c.dom.Document |
getDocument()
|
java.lang.String |
getElementId()
Returns the magic Echo component identifier for the current component. |
RenderState |
getRenderState()
Returns the RenderState associated with this RenderingContext if there is any. |
java.lang.Object |
getRP(java.lang.String propertyName)
A short hand method for getting rendered property values from the current Component. |
boolean |
getRP(java.lang.String propertyName,
boolean defaultValue)
A short hand method for getting rendered property values from the current Component, with a default if it is not set. |
byte |
getRP(java.lang.String propertyName,
byte defaultValue)
A short hand method for getting rendered property values from the current Component, with a default if it is not set. |
char |
getRP(java.lang.String propertyName,
char defaultValue)
A short hand method for getting rendered property values from the current Component, with a default if it is not set. |
double |
getRP(java.lang.String propertyName,
double defaultValue)
A short hand method for getting rendered property values from the current Component, with a default if it is not set. |
float |
getRP(java.lang.String propertyName,
float defaultValue)
A short hand method for getting rendered property values from the current Component, with a default if it is not set. |
int |
getRP(java.lang.String propertyName,
int defaultValue)
A short hand method for getting rendered property values from the current Component, with a default if it is not set. |
long |
getRP(java.lang.String propertyName,
long defaultValue)
A short hand method for getting rendered property values from the current Component, with a default if it is not set. |
java.lang.Object |
getRP(java.lang.String propertyName,
java.lang.Object defaultValue)
A short hand method for getting rendered property values from the current Component, with a default if it is not set. |
short |
getRP(java.lang.String propertyName,
short defaultValue)
A short hand method for getting rendered property values from the current Component, with a default if it is not set. |
java.lang.Object |
getRP(java.lang.String propertyName,
Style defaultStyle)
A short hand method for getting rendered property values from the current Component, with a default if it is not set. |
boolean |
getRP(java.lang.String propertyName,
Style defaultStyle,
boolean defaultValue)
A short hand method for getting rendered property values from the current Component, with a default if it is not set. |
double |
getRP(java.lang.String propertyName,
Style defaultStyle,
double defaultValue)
A short hand method for getting rendered property values from the current Component, with a default if it is not set. |
int |
getRP(java.lang.String propertyName,
Style defaultStyle,
int defaultValue)
A short hand method for getting rendered property values from the current Component, with a default if it is not set. |
ServerComponentUpdate |
getServerComponentUpdate()
|
ServerMessage |
getServerMessage()
Returns the ServerMessage to which output should be
rendered. |
void |
renderEventAdd(java.lang.String eventType,
java.lang.String elementId,
java.lang.String eventHandler)
Creates an eventadd operation to register a client event
listener of a particular type on an HTML element. |
void |
renderEventRemove(java.lang.String eventType,
java.lang.String elementId)
Creates an eventremove operation to unregister a client
event listener of a particular type on an HTML element. |
void |
renderSetProperty(java.lang.String elementId,
java.lang.String propertyName,
java.lang.String propertyValue)
Creates a storeproperty operation to store a non-rendered
named property in an HTMLElement of the client DOM. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public RenderingContext(RenderContext rc,
ServerComponentUpdate serverComponentUpdate,
Component component)
RenderingContext that wraps the original
RenderContext as well as contains references to the ServerComponentUpdate
and Component being rendered.
rc - -
the RenderContext in use at this time.serverComponentUpdate - -
the ServerComponentUpdate in use at this timecomponent - -
the Component being rendered| Method Detail |
|---|
public void addAccessKeySupport(Component component,
org.w3c.dom.Element element)
component - -
the Component to check for AccessKeyableelement - -
the Element to add the access key support to
public void addToolTipSupport(Component component,
org.w3c.dom.Element element)
ToolTipable.
component - -
the Component to check for ToolTipableelement - -
the Element to add the tool tip title support topublic void addAccessKeySupport(org.w3c.dom.Element element)
element - -
the Element to add the access key support to
public void addDisabledSupport(Component component,
org.w3c.dom.Element element)
component - -
the Component to check for enablednesselement - -
the Element to add the disabled attribute topublic void addDisabledSupport(org.w3c.dom.Element element)
element - -
the Element to add the disabled attribute to
public void addAttributeableSupport(Component component,
org.w3c.dom.Element element)
Attributeable
interface
component - -
the Component to check for Attributeable interfaceelement - -
the element to add the attributes topublic void addLibrary(Service service)
ServerMessage.addLibrary(String)
public void addStandardWebSupport(Component component,
org.w3c.dom.Element element)
addAccessKeySupport(Component, Element),
addDisabledSupport(Component, Element),
addTabIndexSupport(Component, Element)public void addStandardWebSupport(org.w3c.dom.Element element)
addStandardWebSupport(Component, Element)
public void addTabIndexSupport(Component component,
org.w3c.dom.Element element)
component - the component in questionelement - the element to add a a tabindex to, typically the highest
level element.public void addTabIndexSupport(org.w3c.dom.Element element)
element - the element to add a a tabindex to, typically the highest
level element.public org.w3c.dom.Element createE(java.lang.String elementName)
elementName - -
the tag name of the element to create
public org.w3c.dom.Text createText(java.lang.String text)
Text node given the specified string.
data - The data for the node.
Text object.public Component getComponent()
public Connection getConnection()
RenderContextConnection to which the
ServerMessage is being rendered.
getConnection in interface RenderContextRenderContext.getConnection()public ContainerInstance getContainerInstance()
RenderContextContainerInstance for which the rendering
is being performed.
getContainerInstance in interface RenderContextContainerInstanceRenderContext.getContainerInstance()public org.w3c.dom.Document getDocument()
public java.lang.String getElementId()
public RenderState getRenderState()
public java.lang.Object getRP(java.lang.String propertyName)
public boolean getRP(java.lang.String propertyName,
boolean defaultValue)
public boolean getRP(java.lang.String propertyName,
Style defaultStyle,
boolean defaultValue)
public byte getRP(java.lang.String propertyName,
byte defaultValue)
public char getRP(java.lang.String propertyName,
char defaultValue)
public double getRP(java.lang.String propertyName,
double defaultValue)
public double getRP(java.lang.String propertyName,
Style defaultStyle,
double defaultValue)
public float getRP(java.lang.String propertyName,
float defaultValue)
public int getRP(java.lang.String propertyName,
int defaultValue)
public int getRP(java.lang.String propertyName,
Style defaultStyle,
int defaultValue)
public long getRP(java.lang.String propertyName,
long defaultValue)
public java.lang.Object getRP(java.lang.String propertyName,
java.lang.Object defaultValue)
public short getRP(java.lang.String propertyName,
short defaultValue)
public java.lang.Object getRP(java.lang.String propertyName,
Style defaultStyle)
public ServerComponentUpdate getServerComponentUpdate()
public ServerMessage getServerMessage()
RenderContextServerMessage to which output should be
rendered.
getServerMessage in interface RenderContextServerMessageRenderContext.getServerMessage()
public void renderEventAdd(java.lang.String eventType,
java.lang.String elementId,
java.lang.String eventHandler)
eventadd operation to register a client event
listener of a particular type on an HTML element.
eventType - the type of event (the "on" prefix should be omitted, e.g.,
"onmousedown" would be expressed as "mousedown")elementId - the id of the listened-to DOM elementeventHandler - the name of the handler method to be invoked when the event
occurs, e.g., "EchoButton.processAction"EventUpdate#createEventAdd(ServerMessage, String, String, String)
public void renderEventRemove(java.lang.String eventType,
java.lang.String elementId)
eventremove operation to unregister a client
event listener of a particular type on an HTML element.
eventType - the type of event (the "on" prefix should be omitted, e.g.,
"onmousedown" would be expressed as "mousedown")elementId - the id of the listened-to DOM elementEventUpdate#createEventRemove(ServerMessage, String, String)
public void renderSetProperty(java.lang.String elementId,
java.lang.String propertyName,
java.lang.String propertyValue)
storeproperty operation to store a non-rendered
named property in an HTMLElement of the client DOM.
elementId - the id of the element on which to set the non-rendered
propertypropertyName - the name of the propertypropertyValue - the value of the property
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||