|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.directwebremoting.ui.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()
|
|
| Method Summary | |
|---|---|
static void |
addClassName(java.lang.String elementId,
java.lang.String className)
$(ele).className += "X", that we can call from Java easily. |
static void |
addOptions(java.lang.String elementId,
java.util.Collection<?> array,
java.lang.String property)
Add options to a list from an array or map. |
static 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. |
static void |
addOptions(java.lang.String elementId,
java.lang.String[] array)
Add options to a list from an array or map. |
static void |
addRows(java.lang.String elementId,
java.util.Collection<java.util.Collection<java.lang.String>> data)
Create rows inside a the table, tbody, thead or tfoot element (given by id). |
static void |
addRows(java.lang.String elementId,
java.util.Collection<java.util.Collection<java.lang.String>> data,
java.lang.String options)
Create rows inside a the table, tbody, thead or tfoot element (given by id). |
static void |
addRows(java.lang.String elementId,
java.lang.String[][] data)
Create rows inside a the table, tbody, thead or tfoot element (given by id). |
static 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). |
static void |
cloneNode(java.lang.String elementId)
Clone a given node. |
static void |
cloneNode(java.lang.String elementId,
java.lang.String idPrefix,
java.lang.String idSuffix)
Clone a given node. |
static void |
removeAllOptions(java.lang.String elementId)
Remove all the options from a select list (specified by id) |
static void |
removeAllRows(java.lang.String elementId)
Remove all the children of a given node. |
static 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 |
static void |
removeNode(java.lang.String elementId)
Sets a CSS style on an element |
static void |
setClassName(java.lang.String elementId,
java.lang.String className)
$(ele).className = "X", that we can call from Java easily |
static void |
setStyle(java.lang.String elementId,
java.lang.String selector,
java.lang.String value)
Sets a CSS style on an element |
static void |
setValue(java.lang.String elementId,
java.lang.Object value)
Set the value an HTML element to the specified value. |
static void |
setValue(java.lang.String elementId,
java.lang.Object value,
boolean escapeHtml)
Set the value an HTML element to the specified value. |
static 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. |
static void |
toggleClassName(java.lang.String elementId,
java.lang.String className)
$(ele).className |= "X", that we can call from Java easily. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Util()
| Method Detail |
|---|
public static void setValue(java.lang.String elementId,
java.lang.Object value)
elementId - The HTML element to update (by id)value - The text to insert into the HTML element
public static void setValue(java.lang.String elementId,
java.lang.Object value,
boolean escapeHtml)
elementId - The HTML element to update (by id)value - The text to insert into the HTML elementescapeHtml - Should we escape HTML characters?
public static void setValues(java.util.Map<?,?> values,
boolean escapeHtml)
values - The map of elementIds to values to alterescapeHtml - Should we escape HTML characters?
public static void addOptions(java.lang.String elementId,
java.lang.String[] array)
elementId - The HTML element to update (by id)array - An array of strings to use as both value and text of options
public static void addOptions(java.lang.String elementId,
java.util.Collection<?> array,
java.lang.String property)
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 text
public static void addOptions(java.lang.String elementId,
java.util.Collection<?> array,
java.lang.String valueProperty,
java.lang.String textProperty)
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 static void removeAllOptions(java.lang.String elementId)
elementId - The HTML element to update (by id)
public static void addRows(java.lang.String elementId,
java.lang.String[][] data,
java.lang.String options)
elementId - The HTML element to update (by id)data - The cells to add to the tableoptions - See link above for documentation on the options
public static void addRows(java.lang.String elementId,
java.lang.String[][] data)
elementId - The HTML element to update (by id)data - The cells to add to the table
public static void addRows(java.lang.String elementId,
java.util.Collection<java.util.Collection<java.lang.String>> data,
java.lang.String options)
elementId - The HTML element to update (by id)data - The cells to add to the tableoptions - See link above for documentation on the options
public static void addRows(java.lang.String elementId,
java.util.Collection<java.util.Collection<java.lang.String>> data)
elementId - The HTML element to update (by id)data - The cells to add to the tablepublic static void removeAllRows(java.lang.String elementId)
elementId - The HTML element to update (by id)public static void cloneNode(java.lang.String elementId)
elementId - The HTML element to update (by id)
public static void cloneNode(java.lang.String elementId,
java.lang.String idPrefix,
java.lang.String idSuffix)
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 static void removeNode(java.lang.String elementId)
elementId - The HTML element to update (by id)
public static 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 element
public static 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 element
public static 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 element
public static 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/off
public static 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 ยจ 2008 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||