Class ThemesRest
java.lang.Object
jakarta.servlet.GenericServlet
jakarta.servlet.http.HttpServlet
org.apache.juneau.rest.server.servlet.RestServlet
org.apache.juneau.rest.server.servlet.BasicRestServlet
org.apache.juneau.petstore.console.PetstoreConsolePage
org.apache.juneau.petstore.console.dev.ThemesRest
- All Implemented Interfaces:
jakarta.servlet.Servlet,jakarta.servlet.ServletConfig,Serializable,BasicUniversalConfig,DefaultConfig,DefaultHtmlConfig
Themes: the stock console themes and one custom token theme, switchable with
?theme=.
The chosen name reaches base.ftlh as the petstoreTheme view attribute, which feeds
<@console theme=...>. ?theme=custom also sets petstoreCustomTheme, which turns on a
nameless <@theme> block (it inherits the page theme, light-brown here) with <@token>
overrides: a leaf and an alias.
Example:
<@console brand="My app" theme="light-brown"> <@theme> <@token name="--jc-pill-red-bg" value="#fdeceb"/> <@token name="--jc-tab-bar-bg" alias="var(--jc-card-bg)"/> </@theme> ... </@console>
GET /console/dev/themes?theme=gray
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.juneau.rest.server.servlet.RestServlet
RestServlet.Builder<R extends RestServlet,SELF extends RestServlet.Builder<R, SELF>>, RestServlet.DefaultBuilder<R extends RestServlet> -
Field Summary
FieldsModifier and TypeFieldDescriptionEvery name?theme=accepts, stock themes first.static final StringThe name?theme=takes for the custom token theme.static final StringThe custom theme's stock seed.Fields inherited from class org.apache.juneau.petstore.console.PetstoreConsolePage
PAGE_HEADER, TEMPLATESFields inherited from class jakarta.servlet.http.HttpServlet
LEGACY_DO_HEAD -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class org.apache.juneau.petstore.console.PetstoreConsolePage
builder, freemarker, store, twinMethods inherited from class org.apache.juneau.rest.server.servlet.RestServlet
builder, createAuthenticator, destroy, doLog, getContext, getPath, getPaths, getRequest, getResponse, getRestBuilder, init, log, log, service, setContextMethods inherited from class jakarta.servlet.http.HttpServlet
doDelete, doGet, doHead, doOptions, doPatch, doPost, doPut, doTrace, getLastModified, isSensitiveHeader, serviceMethods inherited from class jakarta.servlet.GenericServlet
getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
-
Field Details
-
CUSTOM
The name?theme=takes for the custom token theme.- See Also:
-
CUSTOM_SEED
The custom theme's stock seed.- See Also:
-
CHOICES
Every name?theme=accepts, stock themes first.
-
-
Constructor Details
-
ThemesRest
public ThemesRest()
-
-
Method Details
-
page
Renders the Themes page.- Parameters:
req- The request;?builderrenders the builder twin.theme- The theme to render in, ornull for the default.- Returns:
- The page.
- Throws:
BadRequest- If the name is not one ofCHOICES.
-