Class StyleTestConlet
java.lang.Object
org.jgrapes.core.internal.ComponentVertex
org.jgrapes.core.Component
org.jgrapes.webconsole.base.AbstractConlet<Serializable>
org.jgrapes.webconsole.base.freemarker.FreeMarkerConlet<Serializable>
org.jgrapes.webconlet.examples.styletest.StyleTestConlet
- All Implemented Interfaces:
Iterable<ComponentType>,Channel,ComponentType,Eligible,Manager
-
Nested Class Summary
Nested classes/interfaces inherited from class org.jgrapes.webconsole.base.AbstractConlet
AbstractConlet.ConletTrackingInfoNested classes/interfaces inherited from interface org.jgrapes.core.Channel
Channel.Default -
Field Summary
Fields inherited from class org.jgrapes.webconsole.base.AbstractConlet
TYPE_INSTANCE_SEPARATOR -
Constructor Summary
ConstructorsConstructorDescriptionStyleTestConlet(Channel componentChannel) Creates a new component with its channel set to the given channel. -
Method Summary
Modifier and TypeMethodDescriptionprotected Set<Conlet.RenderMode> doRenderConlet(RenderConletRequestBase<?> event, ConsoleConnection channel, String conletId, Serializable conletState) Called byAbstractConlet.onAddConletRequest(AddConletRequest, ConsoleConnection)andAbstractConlet.onRenderConletRequest(RenderConletRequest, ConsoleConnection)to complete rendering the web console component.protected booleandoSetLocale(SetLocale event, ConsoleConnection channel, String conletId) Called byAbstractConlet.onSetLocale(SetLocale, ConsoleConnection)for each web console component in the console connection.voidonConsoleReady(ConsoleReady event, ConsoleConnection consoleConnection) Trigger loading of resources when the console is ready.Methods inherited from class org.jgrapes.webconsole.base.freemarker.FreeMarkerConlet
doGetResource, fmConletModel, fmModel, fmModel, fmSessionModel, fmTypeModel, freemarkerConfig, processTemplate, processTemplateMethods inherited from class org.jgrapes.webconsole.base.AbstractConlet
afterOnClosed, conletIds, conletIdsByConsoleConnection, conletViews, createNewState, createStateRepresentation, doConletDeleted, doRemoveConletType, doUpdateConletState, generateInstanceId, l10nBundles, localizations, onAddConletRequest, onClosed, onConletDeleted, onConletResourceRequest, onDetached, onNotifyConletModel, onRenderConletRequest, onSetLocale, putInSession, readContent, readContent, recreateState, removeState, resourceBundle, setPeriodicRefresh, stateFromSession, statesFromSession, supportedLocales, trackConlet, trackedConnections, type, typeFromIdMethods 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
-
StyleTestConlet
Creates a new component with its channel set to the given channel.- Parameters:
componentChannel- the channel that the component’s handlers listen on by default and thatManager.fire(Event, Channel...)sends the event to
-
-
Method Details
-
onConsoleReady
@Handler public void onConsoleReady(ConsoleReady event, ConsoleConnection consoleConnection) throws TemplateNotFoundException, MalformedTemplateNameException, ParseException, IOException Trigger loading of resources when the console is ready.- Parameters:
event- the eventconsoleConnection- the console connection- Throws:
TemplateNotFoundException- the template not found exceptionMalformedTemplateNameException- the malformed template name exceptionParseException- the parse exceptionIOException- Signals that an I/O exception has occurred.
-
doRenderConlet
protected Set<Conlet.RenderMode> doRenderConlet(RenderConletRequestBase<?> event, ConsoleConnection channel, String conletId, Serializable conletState) throws Exception Description copied from class:AbstractConletCalled byAbstractConlet.onAddConletRequest(AddConletRequest, ConsoleConnection)andAbstractConlet.onRenderConletRequest(RenderConletRequest, ConsoleConnection)to complete rendering the web console component.The
- Specified by:
doRenderConletin classAbstractConlet<Serializable>- Parameters:
event- the eventchannel- the channelconletId- the component idconletState- the conlet’s state; may benullif the conlet doesn’t have associated state information- Returns:
- the rendered modes
- Throws:
Exception- the exception
-
doSetLocale
protected boolean doSetLocale(SetLocale event, ConsoleConnection channel, String conletId) throws Exception Description copied from class:AbstractConletCalled byAbstractConlet.onSetLocale(SetLocale, ConsoleConnection)for each web console component in the console connection.Derived classes must send events for updating the representation to match the new locale.
If the method returns
falsethis indicates that the representation cannot be updated without reloading the web console page.The default implementation fires a
RenderConletRequestwith tracked render modes (one of or bothConlet.RenderMode.PreviewandConlet.RenderMode.View), thus updating the known representations. (Assuming that “Edit” and “Help” modes are represented with modal dialogs and therefore locale changes aren’t possible while these are open.)- Overrides:
doSetLocalein classAbstractConlet<Serializable>- Parameters:
event- the eventchannel- the channelconletId- the web console component id- Returns:
- true, if adaption to new locale without reload is possible
- Throws:
Exception- the exception
-