public class JavaScriptModule extends Object
JavaScriptStack
s.Constructor and Description |
---|
JavaScriptModule(Environment environment,
EnvironmentalShadowBuilder environmentalBuilder) |
Modifier and Type | Method and Description |
---|---|
static void |
bind(ServiceBinder binder) |
JavaScriptSupport |
buildJavaScriptSupport()
Builds a proxy to the current
JavaScriptSupport inside this thread's Environment . |
void |
exposeJavaScriptSupportForFullPageRenders(OrderedConfiguration<MarkupRendererFilter> configuration,
JavaScriptStackSource javascriptStackSource,
JavaScriptStackPathConstructor javascriptStackPathConstructor,
Request request)
Adds page render filters, each of which provides an
Environmental
service. |
void |
exposeJavaScriptSupportForPartialPageRender(OrderedConfiguration<PartialMarkupRendererFilter> configuration,
JavaScriptStackSource javascriptStackSource,
JavaScriptStackPathConstructor javascriptStackPathConstructor,
Request request)
Contributes
PartialMarkupRendererFilter s used when rendering a
partial Ajax response. |
static void |
overrideGlyphiconWithFontAwesomeIfNeeded(MappedConfiguration<Class,Class> configuration,
Compatibility compatibility)
Overrides the
Glyphicon component with FontAwesomeIcon if Bootstrap 3
isn't enabled. |
static void |
prepareHTMLPageOnRender(OrderedConfiguration<MarkupRendererFilter> configuration)
Contributes 'ConfigureHTMLElement', which writes the attributes into the HTML tag to describe locale, etc.
|
static void |
provideBuiltinJavaScriptStacks(MappedConfiguration<String,JavaScriptStack> configuration,
JavaScriptStack coreStack,
JavaScriptStack internalStack)
Contributes the "core" and "internal"
JavaScriptStack s |
static void |
setupApplicationCatalogModules(MappedConfiguration<String,Object> configuration,
LocalizationSetter localizationSetter,
ComponentMessagesSource messagesSource,
ResourceChangeTracker resourceChangeTracker,
boolean compactJSON) |
static void |
setupBaseModules(MappedConfiguration<String,Object> configuration,
Resource underscoreShim,
Resource jqueryShim,
Resource typeahead,
Resource moment,
Resource transition,
Resource bootstrapUtil,
Compatibility compatibility) |
static void |
setupCompatibilityDefaults(MappedConfiguration<Trait,Boolean> configuration) |
static void |
setupCoreJavaScriptStack(OrderedConfiguration<StackExtension> configuration,
Compatibility compatibility,
String provider)
The core JavaScriptStack has a number of entries:
requirejs The RequireJS AMD JavaScript library
scriptaculous.js, effects.js Optional JavaScript libraries in compatibility mode (see
Trait.SCRIPTACULOUS )
t53-compatibility.js Optional JavaScript library (see Trait.INITIALIZERS )
underscore-library, underscore-module
The Underscore JavaScript library, and the shim that allows underscore to be injected
t5/core/init Optional module related to t53-compatibility.js
jquery-library The jQuery library
jquery-noconflict Switches jQuery to no-conflict mode (only present when the infrastructure is "prototype").
jquery A module shim that allows jQuery to be injected (and also switches jQuery to no-conflict mode)
bootstrap.css, tapestry.css, exception-frame.css, tapestry-console.css, tree.css
CSS files
t5/core/[...]
Additional JavaScript modules
jquery
Added if the infrastructure provider is "jquery".
User modules may replace or extend this list. |
static void |
setupFactoryDefaults(MappedConfiguration<String,Object> configuration) |
static void |
setupFoundationFramework(MappedConfiguration<String,Object> configuration,
String provider,
Resource domPrototype,
Resource domJQuery) |
static void |
setupInternalJavaScriptStack(OrderedConfiguration<StackExtension> configuration) |
static void |
setupModuleDispatchers(OrderedConfiguration<Dispatcher> configuration,
ModuleManager moduleManager,
OperationTracker tracker,
ResourceStreamer resourceStreamer,
PathConstructor pathConstructor,
JavaScriptStackSource javaScriptStackSource,
JavaScriptStackPathConstructor javaScriptStackPathConstructor,
LocalizationSetter localizationSetter,
String modulePathPrefix,
String assetPathPrefix) |
public JavaScriptModule(Environment environment, EnvironmentalShadowBuilder environmentalBuilder)
public static void bind(ServiceBinder binder)
@Contribute(value=JavaScriptStackSource.class) public static void provideBuiltinJavaScriptStacks(MappedConfiguration<String,JavaScriptStack> configuration, @Core JavaScriptStack coreStack, @Internal JavaScriptStack internalStack)
JavaScriptStack
s@Contribute(value=JavaScriptStack.class) @Core public static void setupCoreJavaScriptStack(OrderedConfiguration<StackExtension> configuration, Compatibility compatibility, @Symbol(value="tapestry.javascript-infrastructure-provider") String provider)
Trait.SCRIPTACULOUS
)Trait.INITIALIZERS
)@Contribute(value=Compatibility.class) public static void setupCompatibilityDefaults(MappedConfiguration<Trait,Boolean> configuration)
@Contribute(value=JavaScriptStack.class) @Internal public static void setupInternalJavaScriptStack(OrderedConfiguration<StackExtension> configuration)
public JavaScriptSupport buildJavaScriptSupport()
JavaScriptSupport
inside this thread's Environment
.@Contribute(value=Dispatcher.class) @Primary public static void setupModuleDispatchers(OrderedConfiguration<Dispatcher> configuration, ModuleManager moduleManager, OperationTracker tracker, ResourceStreamer resourceStreamer, PathConstructor pathConstructor, JavaScriptStackSource javaScriptStackSource, JavaScriptStackPathConstructor javaScriptStackPathConstructor, LocalizationSetter localizationSetter, @Symbol(value="tapestry.module-path-prefix") String modulePathPrefix, @Symbol(value="tapestry.asset-path-prefix") String assetPathPrefix)
@Contribute(value=MarkupRenderer.class) public void exposeJavaScriptSupportForFullPageRenders(OrderedConfiguration<MarkupRendererFilter> configuration, JavaScriptStackSource javascriptStackSource, JavaScriptStackPathConstructor javascriptStackPathConstructor, Request request)
Environmental
service. Filters
often provide Environmental
services needed by
components as they render.
JavaScriptSupport
@Contribute(value=PartialMarkupRenderer.class) public void exposeJavaScriptSupportForPartialPageRender(OrderedConfiguration<PartialMarkupRendererFilter> configuration, JavaScriptStackSource javascriptStackSource, JavaScriptStackPathConstructor javascriptStackPathConstructor, Request request)
PartialMarkupRendererFilter
s used when rendering a
partial Ajax response.
JavaScriptSupport
@Contribute(value=ModuleManager.class) public static void setupBaseModules(MappedConfiguration<String,Object> configuration, @Path(value="${tapestry.asset.root}/underscore-shim.js") Resource underscoreShim, @Path(value="${tapestry.asset.root}/jquery-shim.js") Resource jqueryShim, @Path(value="${tapestry.asset.root}/typeahead.js") Resource typeahead, @Path(value="${tapestry.asset.root}/moment-2.15.1.js") Resource moment, @Path(value="${tapestry.asset.root}/bootstrap/js/transition.js") Resource transition, @Path(value="${tapestry.asset.root}/bootstrap4/js/bootstrap-util.js") Resource bootstrapUtil, Compatibility compatibility)
@Contribute(value=SymbolProvider.class) @FactoryDefaults public static void setupFactoryDefaults(MappedConfiguration<String,Object> configuration)
@Contribute(value=ModuleManager.class) public static void setupFoundationFramework(MappedConfiguration<String,Object> configuration, @Symbol(value="tapestry.javascript-infrastructure-provider") String provider, @Path(value="classpath:org/apache/tapestry5/t5-core-dom-prototype.js") Resource domPrototype, @Path(value="classpath:org/apache/tapestry5/t5-core-dom-jquery.js") Resource domJQuery)
@Contribute(value=ModuleManager.class) public static void setupApplicationCatalogModules(MappedConfiguration<String,Object> configuration, LocalizationSetter localizationSetter, ComponentMessagesSource messagesSource, ResourceChangeTracker resourceChangeTracker, @Symbol(value="tapestry.compact-json") boolean compactJSON)
@Contribute(value=MarkupRenderer.class) public static void prepareHTMLPageOnRender(OrderedConfiguration<MarkupRendererFilter> configuration)
<style/>
elements into the <head/>
element that modifies the page loading mask to work on IE 8 and IE 9.@Contribute(value=ComponentOverride.class) public static void overrideGlyphiconWithFontAwesomeIfNeeded(MappedConfiguration<Class,Class> configuration, Compatibility compatibility)
Glyphicon
component with FontAwesomeIcon
if Bootstrap 3
isn't enabled.Trait.BOOTSTRAP_3
,
Compatibility
5.6.3 - Copyright © 2003-2021 The Apache Software Foundation.