Interface JavaScriptStack
-
- All Known Implementing Classes:
ExtensibleJavaScriptStack
public interface JavaScriptStack
A high level description of a group of related JavaScript libraries and stylesheets. The built-in "core" stack is used to define the core JavaScript libraries needed by Tapestry (though this has been largely replaced by JavaScript modules in Tapestry 5.4, and the may be no libraries in the core stack by Tapestry 5.5). Other component libraries may define additional stacks for related sets of resources, for example, to bundle together some portion of the ExtJS or YUI libraries. The JavaScript assets of a stack may (when enabled) be exposed to the client as a single URL (identifying the stack by name). The individual JavaScript assets are combined into a single virtual asset, which is then streamed to the client. The individual JavaScript libraries, or the combined virtual library, may be minimized and the content (both compressed and uncompressed) cached. Implementations may need to inject theThreadLocale
service in order to determine the current locale (if any of the JavaScript library or stylesheet assets are localized). They will generally need to inject theAssetSource
service as well. TheExtensibleJavaScriptStack
is the best way to create new stacks.- Since:
- 5.2.0
- See Also:
ThreadLocale
,ExtensibleJavaScriptStack
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description java.lang.String
getInitialization()
Deprecated.Deprecated in Tapestry 5.4; may be removed in a future release.JavaScriptAggregationStrategy
getJavaScriptAggregationStrategy()
Identifies how to aggregate JavaScript within the stack.java.util.List<Asset>
getJavaScriptLibraries()
Returns a list of localized assets for JavaScript libraries that form the stack.java.util.List<java.lang.String>
getModules()
Returns a list of modules to include with the stack, when aggregating the stack's JavaScript.java.util.List<java.lang.String>
getStacks()
Returns a list of JavaScriptStack names that this stack depends on.java.util.List<StylesheetLink>
getStylesheets()
Returns a list of localized links for stylesheets that form the stack.
-
-
-
Method Detail
-
getStacks
java.util.List<java.lang.String> getStacks()
Returns a list of JavaScriptStack names that this stack depends on. Each stack will be processed before the current stack (thus a dependency stack's libraries, stylesheets and initialization is emitted before the dependent stack).
-
getJavaScriptLibraries
java.util.List<Asset> getJavaScriptLibraries()
Returns a list of localized assets for JavaScript libraries that form the stack.
-
getStylesheets
java.util.List<StylesheetLink> getStylesheets()
Returns a list of localized links for stylesheets that form the stack.
-
getModules
java.util.List<java.lang.String> getModules()
Returns a list of modules to include with the stack, when aggregating the stack's JavaScript. It is still necessary to explicitly require such modules.- Since:
- 5.4
- See Also:
ModuleManager
,SymbolConstants.COMBINE_SCRIPTS
-
getJavaScriptAggregationStrategy
JavaScriptAggregationStrategy getJavaScriptAggregationStrategy()
Identifies how to aggregate JavaScript within the stack. The default isJavaScriptAggregationStrategy.COMBINE_AND_MINIMIZE
.- Since:
- 5.4
-
getInitialization
java.lang.String getInitialization()
Deprecated.Deprecated in Tapestry 5.4; may be removed in a future release. Implementations may return null.Returns static JavaScript initialization for the stack. This block of JavaScript code will be added to the page that imports the stack. The code executes outside of any other function (i.e., the code is not deferred until the DOM is loaded). As with the other methods, if localization is a factor, the result of this method should be localized.
-
-