Class 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

public abstract class PageResourceProvider extends Component
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:
  • Constructor Details

    • PageResourceProvider

      public PageResourceProvider(Channel channel)
      Creates a new component.
      Parameters:
      channel - the channel to listen on
  • Method Details

    • resourceBundle

      protected ResourceBundle resourceBundle(Locale locale)
      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

      @Handler public final void onResourceRequest(PageResourceRequest event, IOSubchannel channel)
      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 event
      channel - the channel that the request was received on