Class JQueryUiWeblet
- All Implemented Interfaces:
Iterable<ComponentType>
,Channel
,ComponentType
,Eligible
,Manager
Request
/Response
events.Some resource requests (page resource, conlet resource)
are forwarded via the WebConsole
component to the
web console components.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Holds the information about a theme.Nested classes/interfaces inherited from class org.jgrapes.webconsole.base.ConsoleWeblet
ConsoleWeblet.ConsoleChannel, ConsoleWeblet.ConsoleResourceChannel
Nested classes/interfaces inherited from interface org.jgrapes.core.Channel
Channel.Default
-
Field Summary
Fields inherited from class org.jgrapes.webconsole.base.freemarker.FreeMarkerConsoleWeblet
freeMarkerConfig, UTF_8
-
Constructor Summary
ConstructorDescriptionJQueryUiWeblet
(Channel webletChannel, Channel consoleChannel, URI consolePrefix) Instantiates a new jQuery UI weblet. -
Method Summary
Modifier and TypeMethodDescriptionCreates the console base model.void
onJsonInput
(JsonInput event, ConsoleConnection channel) Handle JSON input.void
onSetTheme
(SetTheme event, ConsoleConnection channel) Handles a change of theme.protected void
provideConsoleResource
(Request.In.Get event, String requestPath, IOSubchannel channel) Provide a console resource.protected void
renderConsole
(Request.In.Get event, IOSubchannel channel, UUID consoleConnectionId) Render the console page using the freemarker template “console.ftl.html”.setFallbackResourceSupplier
(BiFunction<ThemeProvider, String, URL> supplier) Sets a function for obtaining a fallback resource bundle for a given theme provider and locale.styling()
Returns the name of the styling library or toolkit used by the console.Methods inherited from class org.jgrapes.webconsole.base.freemarker.FreeMarkerConsoleWeblet
expandConsoleModel, prependClassTemplateLoader, prependClassTemplateLoader
Methods inherited from class org.jgrapes.webconsole.base.ConsoleWeblet
connectionInactivityTimeout, connectionNetworkTimeout, connectionRefreshInterval, console, consoleHierarchy, consoleResourceBundle, onClosed, onConsoleCommand, onDiscardSession, onGet, onGetRedirect, onInput, onResourceRequestCompleted, onSetLocale, onSetLocaleCompleted, onUpgraded, prefix, prependConsoleResourceProvider, prependResourceBundleProvider, renderSupport, setConnectionInactivityTimeout, setConnectionNetworkTimeout, setConnectionRefreshInterval, setUseMinifiedResources, supportedLocales, updateSupportedLocales, useMinifiedResources
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
-
JQueryUiWeblet
Instantiates a new jQuery UI weblet.- Parameters:
webletChannel
- the weblet channelconsoleChannel
- the web console channelconsolePrefix
- the web console prefix
-
-
Method Details
-
styling
Description copied from class:ConsoleWeblet
Returns the name of the styling library or toolkit used by the console.This value is informative. It may, however, be used by a
PageResourceProviderFactory
to influence the creation ofPageResourceProvider
s.- Specified by:
styling
in classConsoleWeblet
- Returns:
- the value
-
createConsoleBaseModel
Description copied from class:FreeMarkerConsoleWeblet
Creates the console base model.- Overrides:
createConsoleBaseModel
in classFreeMarkerConsoleWeblet
- Returns:
- the base model
-
setFallbackResourceSupplier
Sets a function for obtaining a fallback resource bundle for a given theme provider and locale.- Parameters:
supplier
- the function- Returns:
- the web console fo reasy chaining
-
renderConsole
protected void renderConsole(Request.In.Get event, IOSubchannel channel, UUID consoleConnectionId) throws IOException, InterruptedException Description copied from class:FreeMarkerConsoleWeblet
Render the console page using the freemarker template “console.ftl.html”.The template for the console page (and all included templates) are loaded using the a list of template class loaders created as follows:
-
Start with the actual type of the console conlet.
-
Using the current type, add a freemarker class template loader
ClassTemplateLoader(ClassLoader, String)
that uses the package name as path (all dots replaced with slashes). -
Repeat step 2 with the super class of the current type until type
FreeMarkerConsoleWeblet
is reached.
This approach allows a (base) console weblet to provide a console page template that includes another template e.g. “footer.ftl.html” to provide a specific part of the console page. A derived console weblet can then provide its own “footer.ftl.html” and thus override the version from the base class(es).
- Overrides:
renderConsole
in classFreeMarkerConsoleWeblet
- Parameters:
event
- the eventchannel
- the channel- Throws:
IOException
- Signals that an I/O exception has occurred.InterruptedException
- the interrupted exception
-
-
provideConsoleResource
protected void provideConsoleResource(Request.In.Get event, String requestPath, IOSubchannel channel) Description copied from class:ConsoleWeblet
Provide a console resource.The implementation tries to load the resource using
Class.getResource(String)
for each class in the class hierarchy, starting with the finally derived class.- Overrides:
provideConsoleResource
in classConsoleWeblet
- Parameters:
event
- the eventrequestPath
- the request path relativized to the common part for console resourceschannel
- the channel
-
onJsonInput
@Handler(channels=ConsoleChannel.class) public void onJsonInput(JsonInput event, ConsoleConnection channel) throws InterruptedException, IOException Handle JSON input.- Parameters:
event
- the eventchannel
- the channel- Throws:
InterruptedException
- the interrupted exceptionIOException
- Signals that an I/O exception has occurred.
-
onSetTheme
@Handler(channels=ConsoleChannel.class) public void onSetTheme(SetTheme event, ConsoleConnection channel) throws InterruptedException, IOException Handles a change of theme.- Parameters:
event
- the eventchannel
- the channel- Throws:
InterruptedException
- the interrupted exceptionIOException
- Signals that an I/O exception has occurred.
-