Package org.jgrapes.webconsole.base
Class PageResourceProvider
java.lang.Object
org.jgrapes.core.internal.ComponentVertex
org.jgrapes.core.Component
org.jgrapes.webconsole.base.PageResourceProvider
- All Implemented Interfaces:
Iterable<ComponentType>
,Channel
,ComponentType
,Eligible
,Manager
- Direct Known Subclasses:
BrowserRequireProvider
,ChartJsProvider
,DatatablesProvider
,FontAwesomeProvider
,ForkAwesomeProvider
,GridstackProvider
,JgWcComponentsProvider
,JQueryProvider
,JQueryUi
,JQueryUiTouchPunchProvider
,LodashProvider
,LuxonProvider
,MarkdownItProvider
,MomentProvider
,VueJsProvider
,VueProvider
,VuexProvider
Base class for implementing components that add resources to
the
<HEAD>
section of the web console page.A derived class must implement a handler for ConsoleReady
that generates an AddPageResources
event. This
will, in turn, result in a PageResourceRequest
that must
be handled by the derived class’
onResourceRequest(PageResourceRequest, IOSubchannel)
method.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.jgrapes.core.Channel
Channel.Default
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfinal void
onResourceRequest
(PageResourceRequest event, IOSubchannel channel) A default handler for resource requests.protected ResourceBundle
resourceBundle
(Locale locale) Provides a resource bundle for localization.Methods inherited from class org.jgrapes.core.Component
channel, component, defaultCriterion, isEligibleFor, setName
Methods inherited from class org.jgrapes.core.internal.ComponentVertex
activeEventPipeline, addHandler, attach, channelReplacements, children, componentPath, componentVertex, detach, fire, initComponentsHandlers, iterator, name, newEventPipeline, newEventPipeline, parent, registerAsGenerator, root, toString, unregisterAsGenerator
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
PageResourceProvider
Creates a new component.- Parameters:
channel
- the channel to listen on
-
-
Method Details
-
resourceBundle
Provides a resource bundle for localization.The default implementation looks up a bundle using the package name plus “l10n” as base name.
- Returns:
- the resource bundle
-
onResourceRequest
A default handler for resource requests.Searches for a file with the requested resource URI in the component’s class path and sets its
URL
as result if found.- Parameters:
event
- the resource request eventchannel
- the channel that the request was received on
-