Package com.onec.ui
Record Class BrandingConfig
java.lang.Object
java.lang.Record
com.onec.ui.BrandingConfig
- Record Components:
appName- explicit application name; falls back to the profile title when blanklogoUrl- logo image URL/asset shown in the sidebar header and mobile menulogoUrlDark- optional dark-mode logo variant; falls back tologoUrllogoWidth- optional fixed logo width in dp;nullkeeps the intrinsic widthlogoHeight- optional fixed logo height in dp;nullkeeps each surface's defaultfaviconUrl- optional favicon the web client installs at runtimelight- brand color overrides for light modedark- brand color overrides for dark mode
public record BrandingConfig(String appName, String logoUrl, String logoUrlDark, Integer logoWidth, Integer logoHeight, String faviconUrl, BrandPalette light, BrandPalette dark)
extends Record
Declarative back-office branding for a
Layout's shell: an explicit app
name, a logo (with an optional dark-mode variant), a favicon, and brand color
overrides for the light and dark BrandPalettes. Authored via
UiLayoutBuilder.shell() — e.g.
s.shell().nav(NavStyle.SIDEBAR)
.brand("VetoVet")
.logo("/branding/logo.svg")
.favicon("/branding/favicon.svg")
.light(c -> c.primary("#2563EB"))
.dark(c -> c.primary("#3B82F6"));
Every field is optional. A null/empty appName falls back to the
active profile title (today's behavior); a null logoUrl keeps the
text brand; empty palettes keep the renderer's neutral scale. A null
logoWidth/logoHeight leaves the logo at its intrinsic aspect ratio and
each surface's default size.
-
Constructor Summary
ConstructorsConstructorDescriptionBrandingConfig(String appName, String logoUrl, String logoUrlDark, Integer logoWidth, Integer logoHeight, String faviconUrl, BrandPalette light, BrandPalette dark) Creates an instance of aBrandingConfigrecord class. -
Method Summary
Modifier and TypeMethodDescriptionappName()Returns the value of theappNamerecord component.dark()Returns the value of thedarkrecord component.static BrandingConfigdefaults()final booleanIndicates whether some other object is "equal to" this one.Returns the value of thefaviconUrlrecord component.booleanWhether a non-blank app name was authored (else callers fall back to the profile title).final inthashCode()Returns a hash code value for this object.booleanhasLogo()Whether a logo image was authored (else the shell renders the text brand).light()Returns the value of thelightrecord component.The logo for the requested theme: the dark variant in dark mode when set, elselogoUrl.Returns the value of thelogoHeightrecord component.logoUrl()Returns the value of thelogoUrlrecord component.Returns the value of thelogoUrlDarkrecord component.Returns the value of thelogoWidthrecord component.paletteFor(String theme) The brand color overrides for the requested theme.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
BrandingConfig
public BrandingConfig(String appName, String logoUrl, String logoUrlDark, Integer logoWidth, Integer logoHeight, String faviconUrl, BrandPalette light, BrandPalette dark) Creates an instance of aBrandingConfigrecord class.- Parameters:
appName- the value for theappNamerecord componentlogoUrl- the value for thelogoUrlrecord componentlogoUrlDark- the value for thelogoUrlDarkrecord componentlogoWidth- the value for thelogoWidthrecord componentlogoHeight- the value for thelogoHeightrecord componentfaviconUrl- the value for thefaviconUrlrecord componentlight- the value for thelightrecord componentdark- the value for thedarkrecord component
-
-
Method Details
-
defaults
-
hasAppName
public boolean hasAppName()Whether a non-blank app name was authored (else callers fall back to the profile title). -
hasLogo
public boolean hasLogo()Whether a logo image was authored (else the shell renders the text brand). -
logoFor
The logo for the requested theme: the dark variant in dark mode when set, elselogoUrl. -
paletteFor
The brand color overrides for the requested theme. -
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
appName
Returns the value of theappNamerecord component.- Returns:
- the value of the
appNamerecord component
-
logoUrl
Returns the value of thelogoUrlrecord component.- Returns:
- the value of the
logoUrlrecord component
-
logoUrlDark
Returns the value of thelogoUrlDarkrecord component.- Returns:
- the value of the
logoUrlDarkrecord component
-
logoWidth
Returns the value of thelogoWidthrecord component.- Returns:
- the value of the
logoWidthrecord component
-
logoHeight
Returns the value of thelogoHeightrecord component.- Returns:
- the value of the
logoHeightrecord component
-
faviconUrl
Returns the value of thefaviconUrlrecord component.- Returns:
- the value of the
faviconUrlrecord component
-
light
Returns the value of thelightrecord component.- Returns:
- the value of the
lightrecord component
-
dark
Returns the value of thedarkrecord component.- Returns:
- the value of the
darkrecord component
-