Class Render
VIEW_META wire contract.
Serializes to the canonical object form meta and popover members are omitted from the wire when unset. The client
juneau-renders.js registry looks up id and invokes the matching renderer, passing the
meta map through as per-column context (and painting popover, when present, from row data
already on the client). Typed factories exist for the renderers that take structured metadata:
progress(int) and pill(String). Timestamp renderers (ts-zulu, datetime)
honor meta.popup: off disables the local/California hover popup; ts-zulu defaults
the popup on, datetime defaults it off.
A compact string sugar is supported via parse(String): everything after the first colon becomes
See Also:
- Since:
- 10.0.0
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAdds a metadata key/value pair to this renderer reference.static RenderCreates a renderer reference with the specified id and no metadata.static RenderParses a render-id string into aRender, applying the"id:field" string sugar.static Renderpill()Creates apillrenderer with the leading dot on and the tone inherited from the chip theme.static RenderCreates apillrenderer with an explicit dot tone.static Renderpill(StatusTone tone) Creates apillrenderer with an explicit dot tone taken from theStatusTonepalette.popover(CellPopover value) Sets the optional per-cell popover.static Renderprogress(int max) Creates aprogressrenderer with the given maximum (denominator).static RenderCreates aprogressrenderer with maximum and optional warn/exceeds thresholds.
-
Field Details
-
id
The renderer id (registry key injuneau-renders.js). -
meta
Optional per-column renderer metadata. Omitted from the wire when absent. -
popover
Optional per-cell popover, omitted from the wire when unset.The runtime appends a sibling trigger next to the rendered cell and paints the popover from row data already on the client. Never assigned
innerHTML.
-
-
Constructor Details
-
Render
public Render()
-
-
Method Details
-
of
Creates a renderer reference with the specified id and no metadata.- Parameters:
id- The renderer id. Must not benull .- Returns:
- A new
Render.
-
parse
Parses a render-id string into aRender, applying the"id:field" string sugar.Everything after the first colon becomes
meta.field ; a bare id (no colon) yields a metadata-free renderer.- Parameters:
s- The render-id string. Must not benull or blank.- Returns:
- A new
Render.
-
meta
Adds a metadata key/value pair to this renderer reference. -
popover
Sets the optional per-cell popover.- Parameters:
value- The popover definition. Can benull to unset.- Returns:
- This object.
-
progress
Creates aprogressrenderer with the given maximum (denominator).Equivalent to
Render.of("progress").meta("max", String.valueOf(max)). Chainmeta(String,Object)forlabel/field.- Parameters:
max- The ratio denominator. Serialized as the stringmeta.max.- Returns:
- A new
Render.
-
progress
Creates aprogressrenderer with maximum and optional warn/exceeds thresholds.warnandexceedsare omitted frommetawhennull . A boxed0is a real threshold ("0"), not omitted.- Parameters:
max- The ratio denominator.warn- Warn threshold in the same units as the cell value. Can benull .exceeds- Exceeds threshold in the same units as the cell value. Can benull .- Returns:
- A new
Render.
-
pill
Creates apillrenderer with the leading dot on and the tone inherited from the chip theme.Equivalent to
Render.of("pill"). The dot color follows the.tag.<field>.<value>theme (currentColor) until an explicittoneis chosen. Chainmeta(String,Object)forfield,dot(on|off) andaction(arowActionsid).actionis optional and only meaningful on a table column: a pill named on a field-grid fill sink is unconditionally display-only and rejects anactionoutright.- Returns:
- A new
Render.
-
pill
Creates apillrenderer with an explicit dot tone.toneis one of the five status tonesinfo|success|warning|error|neutral(seeStatusTone). Anull or blanktoneis omitted frommeta(identical topill());neutralis emitted verbatim and, like an absent tone, leaves the dot inheritingcurrentColor. The tone is not validated server-side: the client (NS._render.pillTones ) ignores an off-palette token, so the dot gets no tone class. Preferpill(StatusTone)to stay on the palette.Not to be confused with
progress(int, Integer, Integer)'swarn/exceedsmeta, which are numeric thresholds rather than tone names and share no vocabulary with this palette.- Parameters:
tone- The explicit dot tone. Can benull or blank to inherit.- Returns:
- A new
Render.
-
pill
Creates apillrenderer with an explicit dot tone taken from theStatusTonepalette.Equivalent to
pill(tone == ; anull ?null : tone.wire())null tone is omitted frommeta, identical topill().Example:
// Renders as {id:"pill",meta:{tone:"warning"}}. Renderr = Render.pill (StatusTone.WARNING );- Parameters:
tone- The explicit dot tone. Can benull to inherit.- Returns:
- A new
Render.
-