|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.wicket.util.string.JavaScriptUtils
public class JavaScriptUtils
Provide some helpers to write javascript related tags to the response object.
| Field Summary | |
|---|---|
static java.lang.String |
SCRIPT_CLOSE_TAG
Script close tag |
static java.lang.String |
SCRIPT_CONTENT_PREFIX
Script open tag. |
static java.lang.String |
SCRIPT_CONTENT_SUFFIX
Script close tag. |
static java.lang.String |
SCRIPT_OPEN_TAG
Script open tag |
| Constructor Summary | |
|---|---|
JavaScriptUtils(Response response)
Constructor without id for backward compatibility |
|
JavaScriptUtils(Response response,
java.lang.String id)
Construct. |
|
| Method Summary | |
|---|---|
void |
close()
Write the script close tag to the response. |
static java.lang.CharSequence |
escapeQuotes(java.lang.CharSequence input)
Escape single and double quotes so that they can be part of e.g. |
void |
println(java.lang.CharSequence script)
|
void |
write(java.lang.CharSequence script)
|
static void |
writeCloseTag(Response response)
|
static void |
writeJavaScript(Response response,
java.lang.CharSequence text)
Write the simple text to the response object surrounded by a script tag. |
static void |
writeJavaScript(Response response,
java.lang.CharSequence text,
java.lang.String id)
Write the simple text to the response object surrounded by a script tag. |
static void |
writeJavaScriptUrl(Response response,
java.lang.CharSequence url)
Write a reference to a javascript file to the response object |
static void |
writeJavaScriptUrl(Response response,
java.lang.CharSequence url,
java.lang.String id)
Write a reference to a javascript file to the response object |
static void |
writeJavaScriptUrl(Response response,
java.lang.CharSequence url,
java.lang.String id,
boolean defer,
java.lang.String charset)
Write a reference to a javascript file to the response object |
static void |
writeOpenTag(Response response)
|
static void |
writeOpenTag(Response response,
java.lang.String id)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String SCRIPT_OPEN_TAG
public static final java.lang.String SCRIPT_CLOSE_TAG
public static final java.lang.String SCRIPT_CONTENT_PREFIX
public static final java.lang.String SCRIPT_CONTENT_SUFFIX
| Constructor Detail |
|---|
public JavaScriptUtils(Response response,
java.lang.String id)
response - The response objectid - public JavaScriptUtils(Response response)
response - The response object| Method Detail |
|---|
public static java.lang.CharSequence escapeQuotes(java.lang.CharSequence input)
input - input
public static void writeJavaScriptUrl(Response response,
java.lang.CharSequence url,
java.lang.String id)
response - The HTTP responseurl - The javascript file URLid - Unique identifier of element
public static void writeJavaScriptUrl(Response response,
java.lang.CharSequence url,
java.lang.String id,
boolean defer,
java.lang.String charset)
response - The HTTP responseurl - The javascript file URLid - Unique identifier of elementdefer - specifies that the execution of a script should be deferred (delayed) until after
the page has been loaded.charset - a non null value specifies the charset attribute of the script tag
public static void writeJavaScriptUrl(Response response,
java.lang.CharSequence url)
response - The HTTP responseurl - The javascript file URL
public static void writeJavaScript(Response response,
java.lang.CharSequence text,
java.lang.String id)
response - The HTTP: responsetext - The text to added in between the script tagsid - Unique identifier of element
public static void writeJavaScript(Response response,
java.lang.CharSequence text)
response - The HTTP: responsetext - The text to added in between the script tags
public static void writeOpenTag(Response response,
java.lang.String id)
response - id - public static void writeOpenTag(Response response)
response - public static void writeCloseTag(Response response)
response - public void write(java.lang.CharSequence script)
script - Response.write(java.lang.CharSequence)public void println(java.lang.CharSequence script)
script - Response#println(java.lang.CharSequence)public void close()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||