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
Nested ClassesModifier and TypeClassDescriptionstatic classHolds the information about a theme.Nested classes/interfaces inherited from class org.jgrapes.webconsole.base.ConsoleWeblet
ConsoleWeblet.ConsoleChannel, ConsoleWeblet.ConsoleResourceChannelNested 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
ConstructorsConstructorDescriptionJQueryUiWeblet(Channel webletChannel, Channel consoleChannel, URI consolePrefix) Instantiates a new jQuery UI weblet. -
Method Summary
Modifier and TypeMethodDescriptionCreates the console base model.voidonJsonInput(JsonInput event, ConsoleConnection channel) Handle JSON input.voidonSetTheme(SetTheme event, ConsoleConnection channel) Handles a change of theme.protected voidprovideConsoleResource(Request.In.Get event, String requestPath, IOSubchannel channel) Provide a console resource.protected voidrenderConsole(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, prependClassTemplateLoaderMethods 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, useMinifiedResourcesMethods inherited from class org.jgrapes.core.Component
channel, component, defaultCriterion, isEligibleFor, setNameMethods 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, unregisterAsGeneratorMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods 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:ConsoleWebletReturns the name of the styling library or toolkit used by the console.This value is informative. It may, however, be used by a
PageResourceProviderFactoryto influence the creation ofPageResourceProviders.- Specified by:
stylingin classConsoleWeblet- Returns:
- the value
-
createConsoleBaseModel
Description copied from class:FreeMarkerConsoleWebletCreates the console base model.- Overrides:
createConsoleBaseModelin 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:FreeMarkerConsoleWebletRender 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
FreeMarkerConsoleWebletis 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:
renderConsolein 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:ConsoleWebletProvide 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:
provideConsoleResourcein 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.
-