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 blank
logoUrl - logo image URL/asset shown in the sidebar header and mobile menu
logoUrlDark - optional dark-mode logo variant; falls back to logoUrl
logoWidth - optional fixed logo width in dp; null keeps the intrinsic width
logoHeight - optional fixed logo height in dp; null keeps each surface's default
faviconUrl - optional favicon the web client installs at runtime
light - brand color overrides for light mode
dark - 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 Details

    • BrandingConfig

      public BrandingConfig(String appName, String logoUrl, String logoUrlDark, Integer logoWidth, Integer logoHeight, String faviconUrl, BrandPalette light, BrandPalette dark)
      Creates an instance of a BrandingConfig record class.
      Parameters:
      appName - the value for the appName record component
      logoUrl - the value for the logoUrl record component
      logoUrlDark - the value for the logoUrlDark record component
      logoWidth - the value for the logoWidth record component
      logoHeight - the value for the logoHeight record component
      faviconUrl - the value for the faviconUrl record component
      light - the value for the light record component
      dark - the value for the dark record component
  • Method Details

    • defaults

      public static BrandingConfig 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

      public String logoFor(String theme)
      The logo for the requested theme: the dark variant in dark mode when set, else logoUrl.
    • paletteFor

      public BrandPalette paletteFor(String theme)
      The brand color overrides for the requested theme.
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • appName

      public String appName()
      Returns the value of the appName record component.
      Returns:
      the value of the appName record component
    • logoUrl

      public String logoUrl()
      Returns the value of the logoUrl record component.
      Returns:
      the value of the logoUrl record component
    • logoUrlDark

      public String logoUrlDark()
      Returns the value of the logoUrlDark record component.
      Returns:
      the value of the logoUrlDark record component
    • logoWidth

      public Integer logoWidth()
      Returns the value of the logoWidth record component.
      Returns:
      the value of the logoWidth record component
    • logoHeight

      public Integer logoHeight()
      Returns the value of the logoHeight record component.
      Returns:
      the value of the logoHeight record component
    • faviconUrl

      public String faviconUrl()
      Returns the value of the faviconUrl record component.
      Returns:
      the value of the faviconUrl record component
    • light

      public BrandPalette light()
      Returns the value of the light record component.
      Returns:
      the value of the light record component
    • dark

      public BrandPalette dark()
      Returns the value of the dark record component.
      Returns:
      the value of the dark record component