|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.directwebremoting.proxy.ScriptProxy
org.directwebremoting.proxy.dwr.Util
public class Util
Util is a server-side proxy that allows Java programmers to call client side Javascript from Java.
Each Util object is associated with a list of ScriptSessions and the proxy code is creates will be dynamically forwarded to all those browsers.
Currently this class contains only the write-only DOM manipulation functions
from Util. It is possible that we could add the read methods, however
the complexity in the callback and the fact that you are probably not going
to need it means that we'll leave it for another day. Specifically,
getValue
, getValues
and getText
have
been left out as being read functions and useLoadingMessage
etc
have been left out as not being DOM related.
Constructor Summary | |
---|---|
Util()
Http thread constructor, that affects no browsers. |
|
Util(java.util.Collection scriptSessions)
Http thread constructor that alters a number of browsers |
|
Util(ScriptSession scriptSession)
Http thread constructor that alters a single browser |
Method Summary | |
---|---|
void |
addClassName(java.lang.String elementId,
java.lang.String className)
$(ele).className += "X", that we can call from Java easily. |
void |
addOptions(java.lang.String elementId,
java.util.Collection array,
java.lang.String property)
Add options to a list from an array or map. |
void |
addOptions(java.lang.String elementId,
java.util.Collection array,
java.lang.String valueProperty,
java.lang.String textProperty)
Add options to a list from an array or map. |
void |
addOptions(java.lang.String elementId,
java.lang.String[] array)
Add options to a list from an array or map. |
void |
addRows(java.lang.String elementId,
java.lang.String[][] data)
Create rows inside a the table, tbody, thead or tfoot element (given by id). |
void |
addRows(java.lang.String elementId,
java.lang.String[][] data,
java.lang.String options)
Create rows inside a the table, tbody, thead or tfoot element (given by id). |
void |
cloneNode(java.lang.String elementId)
Clone a given node. |
void |
cloneNode(java.lang.String elementId,
java.lang.String idPrefix,
java.lang.String idSuffix)
Clone a given node. |
void |
removeAllOptions(java.lang.String elementId)
Remove all the options from a select list (specified by id) |
void |
removeAllRows(java.lang.String elementId)
Remove all the children of a given node. |
void |
removeClassName(java.lang.String elementId,
java.lang.String className)
$(ele).className -= "X", that we can call from Java easily From code originally by Gavin Kistner |
void |
removeNode(java.lang.String elementId)
Sets a CSS style on an element |
void |
setClassName(java.lang.String elementId,
java.lang.String className)
$(ele).className = "X", that we can call from Java easily |
void |
setStyle(java.lang.String elementId,
java.lang.String selector,
java.lang.String value)
Sets a CSS style on an element |
void |
setValue(java.lang.String elementId,
java.lang.Object value)
Set the value an HTML element to the specified value. |
void |
setValue(java.lang.String elementId,
java.lang.Object value,
boolean escapeHtml)
Set the value an HTML element to the specified value. |
void |
setValues(java.util.Map values,
boolean escapeHtml)
Given a map, call setValue() for all the entries in the map using the entry key as an element id. |
void |
toggleClassName(java.lang.String elementId,
java.lang.String className)
$(ele).className |= "X", that we can call from Java easily. |
Methods inherited from class org.directwebremoting.proxy.ScriptProxy |
---|
addFunctionCall, addFunctionCall, addFunctionCall, addFunctionCall, addFunctionCall, addFunctionCall, addScript, addScriptSession, addScriptSessions |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Util()
ScriptProxy.addScriptSession(ScriptSession)
or to
ScriptProxy.addScriptSessions(Collection)
will be needed
public Util(ScriptSession scriptSession)
scriptSession
- The browser to alterpublic Util(java.util.Collection scriptSessions)
scriptSessions
- A collection of ScriptSessions that we should act on.Method Detail |
---|
public void setValue(java.lang.String elementId, java.lang.Object value)
More.
elementId
- The HTML element to update (by id)value
- The text to insert into the HTML elementpublic void setValue(java.lang.String elementId, java.lang.Object value, boolean escapeHtml)
More.
elementId
- The HTML element to update (by id)value
- The text to insert into the HTML elementescapeHtml
- Should we escape HTML characters?public void setValues(java.util.Map values, boolean escapeHtml)
More.
values
- The map of elementIds to values to alterescapeHtml
- Should we escape HTML characters?public void addOptions(java.lang.String elementId, java.lang.String[] array)
More.
elementId
- The HTML element to update (by id)array
- An array of strings to use as both value and text of optionspublic void addOptions(java.lang.String elementId, java.util.Collection array, java.lang.String property)
More.
elementId
- The HTML element to update (by id)array
- And array of objects from which to create optionsproperty
- The object property to use for the option value and textpublic void addOptions(java.lang.String elementId, java.util.Collection array, java.lang.String valueProperty, java.lang.String textProperty)
More.
elementId
- The HTML element to update (by id)array
- And array of objects from which to create optionsvalueProperty
- The object property to use for the option valuetextProperty
- The object property to use for the option textpublic void removeAllOptions(java.lang.String elementId)
More.
elementId
- The HTML element to update (by id)public void addRows(java.lang.String elementId, java.lang.String[][] data, java.lang.String options)
More.
elementId
- The HTML element to update (by id)data
- The cells to add to the tableoptions
- See link above for documentation on the optionspublic void addRows(java.lang.String elementId, java.lang.String[][] data)
More.
elementId
- The HTML element to update (by id)data
- The cells to add to the tablepublic void removeAllRows(java.lang.String elementId)
More.
elementId
- The HTML element to update (by id)public void cloneNode(java.lang.String elementId)
More.
elementId
- The HTML element to update (by id)public void cloneNode(java.lang.String elementId, java.lang.String idPrefix, java.lang.String idSuffix)
More.
elementId
- The HTML element to update (by id)idPrefix
- How do we prefix ids in the cloned version of the node treeidSuffix
- How do we suffix ids in the cloned version of the node treepublic void removeNode(java.lang.String elementId)
elementId
- The HTML element to update (by id)public void setClassName(java.lang.String elementId, java.lang.String className)
elementId
- The HTML element to update (by id)className
- The CSS class to set for the elementpublic void addClassName(java.lang.String elementId, java.lang.String className)
elementId
- The HTML element to update (by id)className
- The CSS class to add to the elementpublic void removeClassName(java.lang.String elementId, java.lang.String className)
elementId
- The HTML element to update (by id)className
- The CSS class to remove from the elementpublic void toggleClassName(java.lang.String elementId, java.lang.String className)
elementId
- The HTML element to update (by id)className
- The CSS class to toggle on/offpublic void setStyle(java.lang.String elementId, java.lang.String selector, java.lang.String value)
elementId
- The HTML element to update (by id)selector
- The CSS selector to updatevalue
- The new value for the CSS class on the given element
|
Copyright ? 2005 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |