|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.tapestry5.internal.services.ajax.JavaScriptSupportImpl
public class JavaScriptSupportImpl
| Constructor Summary | |
|---|---|
JavaScriptSupportImpl(DocumentLinker linker,
JavaScriptStackSource javascriptStackSource,
JavaScriptStackPathConstructor stackPathConstructor)
|
|
JavaScriptSupportImpl(DocumentLinker linker,
JavaScriptStackSource javascriptStackSource,
JavaScriptStackPathConstructor stackPathConstructor,
IdAllocator idAllocator,
boolean partialMode)
|
|
| Method Summary | |
|---|---|
void |
addInitializerCall(InitializationPriority priority,
String functionName,
JSONArray parameter)
Adds a call to a client-side function inside the Tapestry.Initializer namespace. |
void |
addInitializerCall(InitializationPriority priority,
String functionName,
JSONObject parameter)
Adds a call to a client-side function inside the Tapestry.Initializer namespace. |
void |
addInitializerCall(InitializationPriority priority,
String functionName,
String parameter)
Adds a call to a client-side function inside the Tapestry.Initializer namespace. |
void |
addInitializerCall(String functionName,
JSONArray parameter)
Adds a call to a client-side function inside the Tapestry.Initializer namespace. |
void |
addInitializerCall(String functionName,
JSONObject parameter)
Adds a call to a client-side function inside the Tapestry.Initializer namespace. |
void |
addInitializerCall(String functionName,
String parameter)
Adds a call to a client-side function inside the Tapestry.Initializer namespace. |
void |
addScript(InitializationPriority priority,
String format,
Object... arguments)
Adds initialization script at the specified priority. |
void |
addScript(String format,
Object... arguments)
Adds initialization script at InitializationPriority.NORMAL priority. |
String |
allocateClientId(ComponentResources resources)
As with JavaScriptSupport.allocateClientId(String) but uses the id of the component extracted from the resources. |
String |
allocateClientId(String id)
Allocates a unique id based on the component's id. |
void |
autofocus(FieldFocusPriority priority,
String fieldId)
Invoked to set focus on a rendered field. |
void |
commit()
|
void |
importJavaScriptLibrary(Asset asset)
Imports a JavaScript library as part of the rendered page. |
void |
importJavaScriptLibrary(String libraryURL)
Import a Javascript library with an arbitrary URL. |
void |
importStack(String stackName)
Imports a JavaScriptStack by name, a related set of JavaScript libraries and stylesheets. |
void |
importStylesheet(Asset stylesheet)
A convenience method that wraps the Asset as a StylesheetLink. |
void |
importStylesheet(StylesheetLink stylesheetLink)
Imports a Cascading Style Sheet file as part of the rendered page. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public JavaScriptSupportImpl(DocumentLinker linker,
JavaScriptStackSource javascriptStackSource,
JavaScriptStackPathConstructor stackPathConstructor)
public JavaScriptSupportImpl(DocumentLinker linker,
JavaScriptStackSource javascriptStackSource,
JavaScriptStackPathConstructor stackPathConstructor,
IdAllocator idAllocator,
boolean partialMode)
linker - responsible for assembling all the information gathered by JavaScriptSupport and
attaching it to the Document (for a full page render) or to the JSON response (in a partial render)javascriptStackSource - source of information about JavaScriptStacks, used when handling the import
of libraries and stacks (often, to handle transitive dependencies)stackPathConstructor - encapsulates the knowledge of how to represent a stack (which may be converted
from a series of JavaScript libraries into a single virtual JavaScript library)idAllocator - used when allocating unique ids (it is usually pre-initialized in an Ajax request to ensure
that newly allocated ids do not conflict with previous renders and partial updates)partialMode - if true, then the JSS configures itself for a partial page render (part of an Ajax request)
which automatically assumes the "core" library has been added (to the original page render)
and makes other minor changes to behavior.| Method Detail |
|---|
public void commit()
public void addInitializerCall(InitializationPriority priority,
String functionName,
JSONObject parameter)
JavaScriptSupport
addInitializerCall in interface JavaScriptSupportpriority - priority to use when adding the scriptfunctionName - name of client-side function (within Tapestry.Initializer namespace) to executeparameter - object to pass to the client-side function
public void addInitializerCall(String functionName,
JSONArray parameter)
JavaScriptSupportInitializationPriority.NORMAL priority.
addInitializerCall in interface JavaScriptSupportfunctionName - name of client-side function (within Tapestry.Initializer namespace) to executeparameter - array of parameters to pass to the client-side function
public void addInitializerCall(InitializationPriority priority,
String functionName,
JSONArray parameter)
JavaScriptSupportInitializationPriority.NORMAL priority.
addInitializerCall in interface JavaScriptSupportfunctionName - name of client-side function (within Tapestry.Initializer namespace) to executeparameter - array of parameters to pass to the client-side function
public void addInitializerCall(String functionName,
JSONObject parameter)
JavaScriptSupportInitializationPriority.NORMAL priority.
addInitializerCall in interface JavaScriptSupportfunctionName - name of client-side function (within Tapestry.Initializer namespace) to executeparameter - object to pass to the client-side function
public void addInitializerCall(InitializationPriority priority,
String functionName,
String parameter)
JavaScriptSupport
addInitializerCall in interface JavaScriptSupportpriority - priority to use when adding the scriptfunctionName - name of client-side function (within Tapestry.Initializer namespace) to executeparameter - string to pass to function (typically, a client id)
public void addInitializerCall(String functionName,
String parameter)
JavaScriptSupportInitializationPriority.NORMAL priority.
addInitializerCall in interface JavaScriptSupportfunctionName - name of client-side function (within Tapestry.Initializer namespace) to executeparameter - string to pass to function (typically, a client id)
public void addScript(InitializationPriority priority,
String format,
Object... arguments)
JavaScriptSupport
addScript in interface JavaScriptSupportpriority - priority to use when adding the scriptformat - format string (as per String.format(String, Object...)arguments - arguments referenced by format specifiers
public void addScript(String format,
Object... arguments)
JavaScriptSupportInitializationPriority.NORMAL priority.
addScript in interface JavaScriptSupportformat - format string (as per String.format(String, Object...)arguments - arguments referenced by format specifierspublic String allocateClientId(ComponentResources resources)
JavaScriptSupportJavaScriptSupport.allocateClientId(String) but uses the id of the component extracted from the resources.
allocateClientId in interface JavaScriptSupportresources - of the component which requires an id
public String allocateClientId(String id)
JavaScriptSupport
allocateClientId in interface JavaScriptSupportid - the component id from which a unique id will be generated
IdAllocatorpublic void importJavaScriptLibrary(Asset asset)
JavaScriptSupport
importJavaScriptLibrary in interface JavaScriptSupportImportpublic void importJavaScriptLibrary(String libraryURL)
JavaScriptSupport
importJavaScriptLibrary in interface JavaScriptSupportpublic void importStylesheet(Asset stylesheet)
JavaScriptSupportStylesheetLink.
importStylesheet in interface JavaScriptSupportstylesheet - asset for the stylesheetJavaScriptSupport.importStylesheet(StylesheetLink)public void importStylesheet(StylesheetLink stylesheetLink)
JavaScriptSupport
importStylesheet in interface JavaScriptSupportstylesheetLink - encapsulates the link URL plus any additional optionspublic void importStack(String stackName)
JavaScriptSupportJavaScriptStack by name, a related set of JavaScript libraries and stylesheets.
Stacks are contributions to the JavaScriptStackSource service. When
JavaScript aggregation in enabled, the stack will be represented by
a single virtual URL; otherwise the individual asset URLs of the stack
will be added to the document.
importStack in interface JavaScriptSupportstackName - the name of the stack (case is ignored); the stack must exist
public void autofocus(FieldFocusPriority priority,
String fieldId)
JavaScriptSupportFieldFocusPriority.OVERRIDE can be used to force a particular field to receive
focus.
autofocus in interface JavaScriptSupportpriority - focus is set only if the provided priority is greater than the current priorityfieldId - id of client-side element to take focus
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||